-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
211 lines (174 loc) · 8.62 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<!-- ======================================================================
Doom Struct Build File
Matt Tropiano
====================================================================== -->
<project name="build" default="compile">
<description>Doom Struct</description>
<property file="build.properties" />
<!-- Dependencies -->
<property name="dev.base" value=".." />
<property name="S" value="${path.separator}" />
<property name="shell.dir" value="shell" />
<property name="dist.dir" value="dist" />
<!-- Project Libs -->
<property name="json.lib.version" value="1.2.0" />
<property name="json.tag" value="${json.lib.version}-RELEASE" />
<property name="json.project" value="blackrook-json-${json.lib.version}" />
<property name="json.jar" value="${json.project}.jar" />
<property name="json.jar.src" value="${json.project}-sources.jar" />
<property name="sql.lib.version" value="1.3.0" />
<property name="sql.tag" value="${sql.lib.version}-RELEASE" />
<property name="sql.project" value="blackrook-sql-${sql.lib.version}" />
<property name="sql.jar" value="${sql.project}.jar" />
<property name="sql.jar.src" value="${sql.project}-sources.jar" />
<property name="sqlite.lib.version" value="3.21.0.1" />
<property name="sqlite.jar" value="sqlite-jdbc-${sqlite.lib.version}.jar" />
<property name="flatlaf.lib.version" value="2.0.2" />
<property name="flatlaf.jar" value="flatlaf-${flatlaf.lib.version}.jar" />
<!-- Project Info -->
<property name="project.archive" value="doomy" />
<property name="project.javadoc.title" value="Doomy" />
<property name="project.classpath" value="${dev.base}/${json.jar}${S}${dev.base}/${sql.jar}${S}${dev.base}/${sqlite.jar}${S}${dev.base}/${flatlaf.jar}" />
<property name="project.compiler.bootclasspath" value="" />
<property name="project.testclass" value=""/>
<property name="project.testclass.main" value=""/>
<property name="project.javadoc.packages" value="
net.mtrop.doomy,
net.mtrop.doomy.commands,
net.mtrop.doomy.commands.config,
net.mtrop.doomy.commands.engine,
net.mtrop.doomy.commands.engine.config,
net.mtrop.doomy.commands.engine.template,
net.mtrop.doomy.commands.engine.template.config,
net.mtrop.doomy.commands.idgames,
net.mtrop.doomy.commands.idgames.search,
net.mtrop.doomy.commands.iwad,
net.mtrop.doomy.commands.preset,
net.mtrop.doomy.commands.run,
net.mtrop.doomy.commands.wad,
net.mtrop.doomy.commands.wad.source,
net.mtrop.doomy.gui,
net.mtrop.doomy.managers,
net.mtrop.doomy.struct
"
/>
<import file="build-shell.xml" />
<import file="build-dependencies.xml" />
<import file="build-import.xml" />
<!-- Versions -->
<property name="doomy.version" value="${build.version.number}" />
<target name="clean.versions">
<delete dir="${build.versions.dir}" includeemptydirs="true" casesensitive="false" />
</target>
<target name="init.versions" depends="clean.versions">
<mkdir dir="${build.versions.dir}" />
<echo file="${build.versions.dir}/doomy.version" message="${doomy.version}" />
<echo file="${build.versions.dir}/json.version" message="${json.lib.version}" />
<echo file="${build.versions.dir}/sql.version" message="${sql.lib.version}" />
<echo file="${build.versions.dir}/sqlite.version" message="${sqlite.lib.version}" />
<echo file="${build.versions.dir}/flatlaf.version" message="${flatlaf.lib.version}" />
</target>
<!-- Filenames -->
<property name="build.versions.dir" value="${build.dir}/versions" />
<property name="zip.dist.filename" value="${project.archive}-${build.version}.zip" />
<property name="tar.dist.filename" value="${project.archive}-${build.version}.tar.gz" />
<target name="clean.dist">
<delete dir="${dist.dir}" includeemptydirs="true" casesensitive="false" />
</target>
<target name="init.dist" depends="clean.dist">
<mkdir dir="${dist.dir}" />
</target>
<target name="javadoc" depends="init.docs" description="Builds the documentation.">
<javadoc access="protected"
additionalparam="-J-Xmx512m " author="true"
classpath="${project.classpath}${path.separator}${bin.dir}"
doctitle="${project.javadoc.title}"
sourcepath="${src.dir}"
packagenames="${project.javadoc.packages}"
destdir="${docs.dir}"
splitindex="true"
use="true"
version="true"
nodeprecated="false"
nodeprecatedlist="false"
noindex="false"
nonavbar="false"
notree="false"
>
<link href="https://docs.oracle.com/en/java/javase/11/docs/api/"/>
</javadoc>
</target>
<target name="jar.one" depends="compile, init.versions">
<jar destfile="${jar.dir}/${jar.filename}">
<zipgroupfileset file="${dependencies.dir}/${json.jar}"/>
<zipgroupfileset file="${dependencies.dir}/${sql.jar}"/>
<zipgroupfileset file="${dependencies.dir}/${sqlite.jar}"/>
<zipgroupfileset file="${dependencies.dir}/${flatlaf.jar}"/>
</jar>
<copy todir="${bin.dir}/net/mtrop/doomy">
<fileset dir="${build.versions.dir}" includes="*.version" />
</copy>
<jar basedir="${bin.dir}" destfile="${jar.dir}/${jar.filename}" update="true" />
</target>
<!-- Dependencies -->
<target name="dependency.json">
<github-dl repository="BlackRookSoftware/JSON" tag="${json.tag}" file="${json.jar}" dest="${dependencies.dir}" />
<github-dl repository="BlackRookSoftware/JSON" tag="${json.tag}" file="${json.jar.src}" dest="${dependencies.dir}" />
</target>
<target name="dependency.sql">
<github-dl repository="BlackRookSoftware/SQL" tag="${sql.tag}" file="${sql.jar}" dest="${dependencies.dir}" />
<github-dl repository="BlackRookSoftware/SQL" tag="${sql.tag}" file="${sql.jar.src}" dest="${dependencies.dir}" />
</target>
<target name="dependency.sqlite">
<maven-jar-dl group-path="org/xerial" artifact="sqlite-jdbc" version="${sqlite.lib.version}" />
<maven-jar-sources-dl group-path="org/xerial" artifact="sqlite-jdbc" version="${sqlite.lib.version}" />
</target>
<target name="dependency.flatlaf">
<maven-jar-dl group-path="com/formdev" artifact="flatlaf" version="${flatlaf.lib.version}" />
<maven-jar-sources-dl group-path="com/formdev" artifact="flatlaf" version="${flatlaf.lib.version}" />
</target>
<target name="dependencies" depends="init.dependencies, dependency.json, dependency.sql, dependency.sqlite, dependency.flatlaf, dependency.properties" description="Downloads and compiles the dependencies.">
</target>
<!-- Scripts -->
<target name="scripts" description="Creates application shell scripts.">
<shell-cmd name="doomy" todir="${build.dir}/shell/cmd" jarname="jar\*" mainclass="net.mtrop.doomy.DoomyMain" />
<shell-bash name="doomy" todir="${build.dir}/shell/bash" jarname="jar/*" mainclass="net.mtrop.doomy.DoomyMain" />
</target>
<!-- Shells -->
<target name="dist.cmd" depends="init.jar, jar.one, scripts, init.dist">
<zip destfile="${dist.dir}/${zip.dist.filename}" compress="true">
<zipfileset file="${jar.dir}/${jar.filename}" prefix="jar" />
<zipfileset dir="${build.dir}/shell/cmd" />
<zipfileset refid="fileset.documents" prefix="docs" />
<zipfileset dir="docs" prefix="docs" />
</zip>
</target>
<target name="dist.bash" depends="init.jar, jar.one, scripts, init.dist">
<tar destfile="${dist.dir}/${tar.dist.filename}" compression="gzip">
<zipfileset file="${jar.dir}/${jar.filename}" prefix="jar" />
<tarfileset dir="${build.dir}/shell/bash" filemode="755" />
<tarfileset refid="fileset.documents" prefix="docs" />
<tarfileset dir="docs" prefix="docs" />
</tar>
</target>
<target name="dist" depends="dist.bash, dist.cmd" description="Zips together the application and shell scripts.">
</target>
<!-- Deployments -->
<target name="deploy.jar" if="deploy.dir" depends="jar.one" description="Deploys the JAR distribution to a directory.">
<copy todir="${deploy.dir}/jar">
<fileset file="${jar.dir}/${jar.filename}" />
</copy>
</target>
<target name="deploy.cmd" if="deploy.dir" depends="dist.cmd" description="Deploys the CMD distribution to a directory, CLEANING THE DIRECTORY FIRST. USE CAUTION.">
<delete dir="${deploy.dir}" failonerror="false" />
<mkdir dir="${deploy.dir}" />
<unzip src="${dist.dir}/${zip.dist.filename}" dest="${deploy.dir}" />
</target>
<target name="deploy.bash" if="deploy.dir" depends="dist.bash" description="Deploys the Bash distribution to a directory, CLEANING THE DIRECTORY FIRST. USE CAUTION.">
<delete dir="${deploy.dir}" failonerror="false" />
<mkdir dir="${deploy.dir}" />
<unzip src="${dist.dir}/${tar.dist.filename}" dest="${deploy.dir}" />
</target>
</project>