-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
67 lines (55 loc) · 2.51 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<project name="Smithy" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="build.properties"/>
<property name="ivy.install.version" value="2.5.1"/>
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${user.home}/.ant"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<property name="version.major" value="${smithy.major_version}"/>
<property name="version.minor" value="${smithy.patch_version}"/>
<property name="version.patch" value="${smithy.patch_version}"/>
<property name="version.mc" value="${mc.version}"/>
<property name="proj.version" value="${version.major}.${version.minor}.${version.patch}"/>
<property name="full.version" value="${version.mc}-${proj.version}"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="build_sources.dir" value="${build.dir}/sources"/>
<property name="dist.dir" value="${build.dir}/dist"/>
<property name="resources.dir" value="resources"/>
<target name="setup">
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${build_sources.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="copy_sources" depends="setup">
<copy todir="${build_sources.dir}">
<fileset dir="src" includes="**/*.java"/>
</copy>
<replace dir="${build_sources.dir}" token="@SMITHY_VERSION@" value="${proj.version}"/>
<replace dir="${build_sources.dir}" token="@MC_VERSION@" value="${mc.version}"/>
</target>
<target name="compile" depends="copy_sources">
<javac srcdir="${build_sources.dir}" destdir="${classes.dir}" fork="yes"/>
<jar destfile="${dist.dir}/Smithy-${full.version}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="io.ansan.mc.smithy.launch.Launch"/>
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
</project>