forked from XVicarious/INpureCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
126 lines (115 loc) · 4.66 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
118
119
120
121
122
123
124
125
126
<!-- MAKE SURE TO RENAME THE PROJECT -->
<project name="INpureCore" default="main">
<property environment="env"/>
<property name="src.dir" value="src/main/java"/>
<property name="api.dir" value="src/api/java"/>
<property name="utils.dir" value="utils"/>
<property name="deps.dir" value="deps"/>
<property name="download.dir" value="downloads"/>
<property name="build.dir" value="."/>
<property name="gradle.output.dir" value="${build.dir}/build/libs"/>
<property name="gradle.output" value="${gradle.output.dir}/modid-1.0.jar"/>
<property name="reobf.dir" value="${build.dir}/reobf"/>
<property name="bin.dir" value="${build.dir}/bin"/>
<property name="lib.dir" value="${build.dir}/libs"/>
<property name="forge.url" value="http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.7.10-10.13.2.1277/forge-1.7.10-10.13.2.1277-src.zip"/>
<target name="properties">
<available property="has.folders" type="dir" file="${download.dir}"/>
<available property="has.forge" file="${download.dir}/forge.zip"/>
<available property="has.libs" file="${lib.dir}/jruby.jar"/>
</target>
<target name="make.dirs" unless="has.folders" depends="properties">
<mkdir dir="${deps.dir}"/>
<mkdir dir="${api.dir}"/>
<mkdir dir="${download.dir}"/>
<mkdir dir="${reobf.dir}"/>
<mkdir dir="${bin.dir}"/>
<mkdir dir="${lib.dir}"/>
</target>
<target name="download.libs" depends="make.dirs" unless="has.libs">
<get dest="${lib.dir}">
<url url="http://files.inpureprojects.info/libs/commons-codec-1.9.jar"/>
<url url="http://files.inpureprojects.info/libs/commons-compress-1.8.1.jar"/>
<url url="http://files.inpureprojects.info/libs/jruby.jar"/>
<url url="http://files.inpureprojects.info/libs/luaj-jse-3.0.jar"/>
<url url="http://files.inpureprojects.info/libs/groovy-2.3.9.jar"/>
<url url="http://files.inpureprojects.info/libs/commons-io-2.4.jar"/>
<url url="http://files.inpureprojects.info/libs/groovy-jsr223-2.3.9.jar"/>
</get>
</target>
<target name="setup.forge" depends="download.libs" unless="has.forge">
<echo message="Downloading ForgeGradle..."/>
<get dest="${download.dir}/forge.zip">
<url url="${forge.url}"/>
</get>
<echo message="Unzipping ForgeGradle..."/>
<unzip src="${download.dir}/forge.zip" dest="${build.dir}" overwrite="false"/>
<echo message="Cleaning up ForgeGradle files..."/>
<delete>
<fileset dir="${build.dir}">
<include name="*.txt"/>
</fileset>
</delete>
<delete dir="${build.dir}/eclipse"/>
<delete dir="${build.dir}/src/main/java/com"/>
<echo message="Running ForgeGradle Setup..."/>
<chmod dir="${build.dir}" perm="ugo+rx" includes="gradlew"/>
<exec dir="${build.dir}" executable="cmd" osfamily="windows">
<arg line="/c gradlew.bat -g .gradle setupDecompWorkspace setupDevWorkspace extractMinecraftSrc idea --refresh-dependencies"/>
</exec>
<exec dir="${build.dir}" executable="sh" osfamily="unix">
<arg line="gradlew -g .gradle setupDecompWorkspace setupDevWorkspace extractMinecraftSrc idea --refresh-dependencies"/>
</exec>
</target>
<target name="setup" depends="setup.forge">
<echo message="Setup: Complete."/>
</target>
<target name="compile" depends="setup">
<exec dir="${build.dir}" executable="cmd" osfamily="windows">
<arg line="/c gradlew.bat -g .gradle build"/>
</exec>
<exec dir="${build.dir}" executable="sh" osfamily="unix">
<arg line="gradlew -g .gradle build"/>
</exec>
</target>
<target name="backup">
<delete file="./Backup.zip"/>
<zip basedir="." destfile="./Backup.zip"/>
</target>
<target name="main" depends="compile">
<echo message="Build script execution complete."/>
</target>
<target name="clean">
<exec dir="${build.dir}" executable="cmd" osfamily="windows">
<arg line="/c gradlew.bat cleanCache"/>
</exec>
<exec dir="${build.dir}" executable="sh" osfamily="unix">
<arg line="gradlew cleanCache"/>
</exec>
<delete dir="${deps.dir}"/>
<delete dir="${download.dir}"/>
<delete dir="${build.dir}/.gradle"/>
<delete dir="${build.dir}/build"/>
<delete dir="${build.dir}/eclipse"/>
<delete dir="${build.dir}/gradle"/>
<delete dir="${build.dir}/.gradle"/>
<delete file="${build.dir}/gradlew"/>
<delete file="${build.dir}/gradlew.bat"/>
<delete dir="${reobf.dir}"/>
<delete dir="${bin.dir}"/>
<delete dir="${lib.dir}"/>
<delete>
<fileset dir="." includes="**/*.iml"/>
<fileset dir="." includes="**/*.ipr"/>
<fileset dir="." includes="**/*.iws"/>
</delete>
</target>
<target name="tests">
<exec dir="${build.dir}" executable="cmd" osfamily="windows">
<arg line="/c gradlew.bat test"/>
</exec>
<exec dir="${build.dir}" executable="sh" osfamily="unix">
<arg line="gradlew test"/>
</exec>
</target>
</project>