-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
54 lines (47 loc) · 1.78 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
<project name="stackiter" default="dist-orig">
<target name="clean">
<delete dir="build"/>
</target>
<target name="dist-shrunk" depends="shrink, finish">
<description>
Shrink (and obfuscate most of) the jar before signing it.
Resulting jnlp and jar are left directly under build.
</description>
</target>
<target name="dist-orig" depends="jar, finish">
<description>
Resulting jnlp and jar are left directly under build.
No shrinking or obfuscation is performed.
</description>
</target>
<target name="finish">
<copy file="stackiter.jnlp" todir="build"/>
<replaceregexp file="build/stackiter.jnlp" match="codebase=".*?"" replace="codebase="${codebase}""/>
<signjar jar="build/stackiter.jar" alias="${alias}" storepass="${storepass}"/>
</target>
<target name="jar" depends="clean">
<mkdir dir="build/class"/>
<javac srcdir="src" destdir="build/class" classpath="lib/jbox2d.jar"/>
<unzip dest="build/class" src="lib/jbox2d.jar">
<!-- Explicitly leave out files referencing Processing since I don't want to worry about them for ProGuard or otherwise. -->
<patternset includes="**/*.class" excludes="**/SPH*.class"/>
</unzip>
<jar destfile="build/stackiter.jar" basedir="build/class">
<manifest>
<attribute name="Main-Class" value="stackiter.sim.Stackiter"/>
</manifest>
</jar>
</target>
<target name="shrink" depends="jar">
<move file="build/stackiter.jar" tofile="build/stackiter-orig.jar"/>
<taskdef resource="proguard/ant/task.properties" classpath="lib/proguard.jar"/>
<proguard>
-libraryjars "${java.home}/lib/rt.jar"
-injars build/stackiter-orig.jar
-outjars build/stackiter.jar
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
</proguard>
</target>
</project>