-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
148 lines (126 loc) · 5.2 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
<?xml version="1.0"?>
<project name="biasviz" default="compile" basedir=".">
<description>
Simple ant build file for the BiasViz applet.
</description>
<import file="properties.xml" />
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<!-- Put icons in build directory for inclusion in jar -->
<mkdir dir="${build}/icons"/>
<copy todir="${build}/icons">
<fileset dir="${icons}"/>
</copy>
</target>
<target name="compile" depends="init"
description="Compiles code, output goes to the build directory.">
<javac srcdir="${javasrc}" destdir="${build}" target="1.5"/>
</target>
<target name="debug" depends="init"
description="Compiles code with debug symbols and warnings, output goes to the build directory.">
<javac srcdir="${javasrc}" debug="on" destdir="${build}">
<compilerarg value="-Xlint:all,-serial"/>
</javac>
</target>
<target name="jaronly" depends="compile"
description="Creates signed jar of the applet.">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the biasviz.jar file -->
<jar destfile="${dist}/lib/biasviz.jar" basedir="${build}" manifest="${javasrc}/ManifestStandalone.txt"/>
</target>
<target name="jar" depends="compile,makekey"
description="Creates signed jar of the applet.">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the biasviz.jar file -->
<jar destfile="${dist}/lib/biasviz.jar" basedir="${build}" manifest="${javasrc}/Manifest.txt"/>
</target>
<target name="sign" depends="jar,makekey">
<signjar jar="${dist}/lib/biasviz.jar" alias="${keystore.alias}" storepass="${keystore.password}" keypass="${keystore.key.password}"/>
</target>
<target name="check-keystore" >
<condition property="keystore-exists">
<available file="${user.home}/.keystore" type="file"/>
</condition>
</target>
<!-- Create self-signed certificate if no keystore exists -->
<target name="makekey" depends="check-keystore" unless="keystore-exists">
<genkey alias="${keystore.alias}" storepass="${keystore.password}" keypass="${keystore.key.password}">
<dname>
<param name="CN" value="Dummy Key"/>
<param name="OU" value="Dummy Division"/>
<param name="O" value="Dummy Organization"/>
<param name="C" value="CA"/>
</dname>
</genkey>
</target>
<target name="dist" depends="sign"
description="Builds signed jar and copies web front end to ./dist/web/ directory." >
<!-- Copy in the php front end files -->
<mkdir dir="${dist}/web"/>
<copy todir="${dist}/web">
<fileset dir="${websrc}"/>
<fileset file="${dist}/lib/biasviz.jar"/>
</copy>
</target>
<target name="clean"
description="Destroys all generated files and directories.">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="run" depends="debug"
description="Run the applet in a stand-alone window.">
<java classname="Main" classpath="${build}" fork="true">
</java>
</target>
<target name="profileShark" depends="compile"
description="Run the applet in the OS X's Shark profiler.">
<java classname="Main" classpath="${build}" fork="true">
<arg value="${testinput}"/>
<jvmarg value="-XrunShark"/>
</java>
</target>
<target name="deploy-live" depends="dist">
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh"/>
<arg value="-Cavzr"/>
<arg value="--delete"/>
<arg value="${dist}/web/"/>
<arg value="${live.server}:${live.dir}"/>
</exec>
</target>
<target name="deploy-test" depends="dist"
description="Builds everything and pushes files to the test server.">
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh"/>
<arg value="-Cavzr"/>
<arg value="--delete"/>
<arg value="${dist}/web/"/>
<arg value="${test.server}:${test.dir}"/>
</exec>
</target>
<target name="deploy" depends="deploy-live"
description="Builds everything and pushes files to the live server."/>
<target name="srcdist" depends="clean"
description="Creates archives for release purposes.">
<mkdir dir="${dist}/src"/>
<tar destfile="${dist}/src/biasviz.tar.gz" compression="gzip">
<tarfileset dir=".">
<exclude name=".svn"/>
<exclude name="dist/**"/>
</tarfileset>
</tar>
<zip destfile="${dist}/src/biasviz.zip">
<fileset dir=".">
<exclude name=".svn"/>
<exclude name="dist/**"/>
</fileset>
</zip>
</target>
</project>