forked from IsmAvatar/LateralGM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
154 lines (129 loc) · 5.14 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="LateralGM" default="build">
<property name="jarname" value="lgm16b4.jar" />
<property name="jar" value="${basedir}/${jarname}" />
<property name="lgm" value="${basedir}/org/lateralgm" />
<property name="main" value="${lgm}/main" />
<property name="svg" value="${main}/lgm-splash.svg" />
<property name="png" value="${main}/lgm-splash.png" />
<property name="about" value="${lgm}/messages/messages.properties" />
<!-- Eclipse users: pre-build and post-refresh
Ensure that Eclipse builds the
project before executing ant scripts,
and refreshes the project afterwards.
Also notice that "clean" and "compile"
are NOT intended for eclipse usage,
and may confuse eclipse considerably.
-->
<tstamp>
<!-- Not used yet -->
<format property="time" pattern="yyyyMMdd'T'hhmm'Z'" timezone="GMT" />
</tstamp>
<target name="prepared-jar" depends="compile" description="Prepares a jar for distribution without updating the splash screen">
<antcall target="initialize" />
<antcall target="jar-all" />
<antcall target="revert" />
</target>
<target name="build" description="Fully prepares a jar for distribution and updates the splash screen">
<antcall target="build-all" />
</target>
<target name="jar" description="Constructs a raw jar">
<antcall target="jar-all" />
</target>
<target name="jar-all" description="Constructs a raw jar">
<jar destfile="${jar}" update="true" manifest="META-INF/MANIFEST.MF" basedir=".">
<exclude name="${jarname}" />
</jar>
</target>
<target name="build-all" depends="batik,compile" description="Fully prepares a jar for distribution and updates the splash screen">
<antcall target="initialize" />
<antcall target="build-image" />
<antcall target="jar-all" />
<antcall target="revert" />
</target>
<target name="jar-src" description="Constructs a raw jar of source-only files">
<jar destfile="${jar}" update="true" manifest="META-INF/MANIFEST.MF" basedir=".">
<exclude name="${jarname}" />
<exclude name="**/*.class" />
<exclude name="**/lgm-logo.png" />
<exclude name="**/lgm-splash.png" />
<exclude name="**/arrows.png" />
<exclude name="**/default.ico" />
</jar>
</target>
<target name="build-src" description="Prepares a source-only jar">
<antcall target="initialize" />
<antcall target="jar-src" />
<antcall target="revert" />
</target>
<target name="jar-bin" depends="compile" description="Constructs a raw jar of binary-only files">
<jar destfile="${jar}" update="true" manifest="META-INF/MANIFEST.MF" basedir=".">
<exclude name="${jarname}" />
<exclude name="**/*.java" />
<exclude name="**/*.svg" />
<exclude name="**/.checkstyle" />
<exclude name="**/.project" />
<exclude name="**/*.jardesc" />
<exclude name="**/build.xml" />
<exclude name="**/checkstyle.xml" />
<exclude name=".settings/**" />
</jar>
</target>
<target name="build-bin" depends="batik,svn,compile" description="Fully prepares a binary-only jar for distribution">
<antcall target="initialize" />
<antcall target="build-image" />
<antcall name="jar-bin" />
<antcall target="revert" />
</target>
<target name="clean" unless="eclipse.running">
<!-- Do not call this in eclipse!!! -->
<delete verbose="true">
<fileset dir="${basedir}" includes="**/*.class" />
</delete>
</target>
<target name="compile" unless="eclipse.running">
<!-- You shouldn't need to call this in eclipse -->
<javac source="1.6" target="1.6" sourcepath="" classpath="" srcdir="${basedir}" includeantruntime="no">
<include name="**/*.java" />
</javac>
</target>
<!-- Usually you should leave this up to a higher-level target,
due to the backup, replace, and revert calls -->
<target name="build-image" depends="batik">
<rasterize result="image/png" height="240" width="480" src="${svg}" dest="${png}" />
</target>
<!-- Dependancies for some targets.
Made into targets so they don't crash the
whole script if they can't be found -->
<target name="batik">
<taskdef name="rasterize" classname="org.apache.tools.ant.taskdefs.optional.RasterizerTask" />
</target>
<target name="svn">
<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" />
</target>
<!-- low-level "function" targets not intended for external use -->
<target name="getRevision" depends="svn">
<svn>
<status path="${basedir}" revisionProperty="svn.revision" />
</svn>
<echo message="r${svn.revision}" />
</target>
<target name="backup">
<copy file="${about}" tofile="${about}~" overwrite="true" />
<copy file="${svg}" tofile="${svg}~" overwrite="true" />
<copy file="${png}" tofile="${png}~" overwrite="true" />
</target>
<target name="replace" depends="getRevision">
<replace file="${svg}" token="$$rev$$" value="${svn.revision}" />
<replace file="${about}" token="$$rev$$" value="${svn.revision}" />
</target>
<target name="revert">
<move file="${svg}~" tofile="${svg}" overwrite="true" />
<move file="${png}~" tofile="${png}" overwrite="true" />
<move file="${about}~" tofile="${about}" overwrite="true" />
</target>
<target name="initialize" depends="svn">
<antcall target="backup" />
<antcall target="replace" />
</target>
</project>