forked from Epoxide-Software/EnchantingPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
117 lines (93 loc) · 3.95 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<project name="EnchantingPlus" default="main">
<property environment="env"/>
<property file="build.properties" />
<property name="build.dir" value="build"/>
<property name="src.dir" value="src"/>
<property name="resources.dir" value="resources"/>
<property name="mcp.dir" value="mcp"/>
<property name="mcp.version" value="1.5.1"/>
<available file="./.git" type="dir" property="git.present" />
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="initialize-version" depends="not-version-provided,git.revision">
<property name="project.version.full" value="${project.version}.${build.number}"/>
</target>
<target name="not-version-provided" unless="build.number">
<condition property="build.number" value="${build.number}" else="beta">
<isset property="test"/>
</condition>
</target>
<target name="git.revision" if="git.present">
<exec executable="git" dir="src" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--always"/>
<arg value="--abbrev=0"/>
<arg value="HEAD"/>
</exec>
<condition property="project.version" value="${git.revision}" else="0.0.0">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
</target>
<target name="copy-src">
<copy todir="${mcp.dir}/src/minecraft">
<fileset dir="${src.dir}" />
<filterset>
<filter token="FINGERPRINT" value="${mod.fingerprint}" />
<filter token="VERSION" value="${project.version.full}" />
</filterset>
</copy>
</target>
<target name="compile" depends="initialize-version,copy-src">
<delete dir="${build.dir}/classes"/>
<mkdir dir="${build.dir}/classes"/>
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
<arg line="/c recompile.bat"/>
</exec>
<exec dir="${mcp.dir}" executable="bash" osfamily="unix">
<arg line="recompile.sh" />
</exec>
<exec dir="${mcp.dir}" executable="cmd" osfamily="windows">
<arg line="/c reobfuscate_srg.bat"/>
</exec>
<exec dir="${mcp.dir}" executable="bash" osfamily="unix">
<arg line="reobfuscate_srg.sh"/>
</exec>
<copy todir="${build.dir}/classes/eplus">
<fileset dir="${mcp.dir}/reobf/minecraft/eplus"/>
</copy>
<copy todir="${build.dir}/classes">
<fileset dir="${resources.dir}">
<exclude name="mcmod.info"/>
</fileset>
</copy>
<copy todir="${build.dir}/classes">
<fileset file="${resources.dir}/mcmod.info"/>
<filterset>
<filter token="VERSION" value="${project.version.full}" />
</filterset>
</copy>
<delete dir="${mcp.dir}/src/minecraft/eplus"/>
</target>
<target name="package" depends="compile">
<delete dir="${build.dir}/jar"/>
<mkdir dir="${build.dir}/jar"/>
<jar destfile="${build.dir}/jar/${ant.project.name}-${mcp.version}-${project.version.full}.jar" basedir="${build.dir}/classes"/>
<signjar jar="${build.dir}/jar/${ant.project.name}-${mcp.version}-${project.version.full}.jar" keystore="${keystore.location}" alias="${keystore.alias}" storepass="${keystore.password}" />
</target>
<target name="main">
<buildnumber file="build.num"/>
<antcall target="package"/>
</target>
<target name="build-test">
<antcall target="package"/>
</target>
<target name="build-number">
<input message="Enter a build number:" addproperty="build.number"/>
<antcall target="package" />
</target>
</project>