forked from MyEssentials/MyTown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
77 lines (67 loc) · 3.59 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
<?xml version="1.0" ?>
<project name="MyTown" default="build">
<property file="build.properties" prefix="build"/>
<property file="environment.properties" prefix="environment"/>
<target name="clean">
<delete file="${environment.mcp_location}/src/minecraft/mcmod.info" />
<delete dir="${environment.mcp_location}/src/minecraft/com/sperion" />
<delete dir="${environment.mcp_location}/src/minecraft/ee" />
<delete dir="${environment.mcp_location}/src/minecraft/ic2" />
<delete dir="${environment.mcp_location}/src/minecraft/mithion" />
<delete dir="${environment.mcp_location}/src/minecraft/mods" />
<delete dir="${environment.mcp_location}/reobf/minecraft" />
</target>
<target name="increment_build_number">
<propertyfile file="build.properties">
<entry key="build_number" type="int" operation="+" default="1" />
</propertyfile>
</target>
<target name="prep">
<copy todir="${environment.mcp_location}/src/minecraft">
<fileset dir="${environment.base_location}/sources/ForgePerms/src/" excludes="**/mcmod.info" />
</copy>
<copy todir="${environment.mcp_location}/src/minecraft">
<fileset dir="${environment.source_location}/src/" />
</copy>
</target>
<target name="replace_tokens">
<replace dir="${environment.mcp_location}/src/minecraft/ee" token="@VERSION@" value="${build.mod_version}" />
<replace dir="${environment.mcp_location}/src/minecraft/ee" token="@BUILD_NUMBER@" value="${build.build_number}" />
<replace file="${environment.mcp_location}/src/minecraft/mcmod.info" token="@VERSION@" value="${build.mod_version}" />
<replace file="${environment.mcp_location}/src/minecraft/mcmod.info" token="@BUILD_NUMBER@" value="${build.build_number}" />
</target>
<target name="recompile">
<exec dir="${environment.mcp_location}" executable="cmd" osfamily="windows">
<arg line="/c recompile.bat" />
</exec>
<exec dir="${environment.mcp_location}" executable="bash" osfamily="unix">
<arg line="recompile.sh" />
</exec>
</target>
<target name="reobfuscate">
<exec dir="${environment.mcp_location}" executable="cmd" osfamily="windows">
<arg line="/c reobfuscate_srg.bat" />
</exec>
<exec dir="${environment.mcp_location}" executable="bash" osfamily="unix">
<arg line="reobfuscate_srg.sh" />
</exec>
</target>
<target name="build" depends="clean, prep, replace_tokens, recompile, reobfuscate">
<mkdir dir="${environment.build_location}/MC ${build.minecraft_version}" />
<jar destfile="${environment.build_location}/MC ${build.minecraft_version}/MyTown-${build.mod_version}.${build.build_number}.jar">
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="mcmod.info" />
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="pack.mcmeta" />
<fileset dir="${environment.mcp_location}/reobf/minecraft" excludes="**/com/**,**/org/**"/>
</jar>
<antcall target="clean" />
</target>
<target name="release" depends="clean, increment_build_number, prep, replace_tokens, recompile, reobfuscate">
<mkdir dir="${environment.release_location}" />
<jar destfile="${environment.release_location}/MyTown-${build.mod_version}.${build.build_number}.jar">
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="mcmod.info" />
<fileset dir="${environment.mcp_location}/src/minecraft/" includes="pack.mcmeta" />
<fileset dir="${environment.mcp_location}/reobf/minecraft" excludes="**/com/**,**/org/**"/>
</jar>
<antcall target="clean" />
</target>
</project>