-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.xml
More file actions
247 lines (206 loc) · 11.7 KB
/
build.xml
File metadata and controls
247 lines (206 loc) · 11.7 KB
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?xml version="1.0" encoding="UTF-8"?>
<!--
================================================================================
# Copyright (c) 2011 Emitrom, LLC
# All rights reserved.
#
# build.xml file to build Touch4j
================================================================================
-->
<project basedir="." name="touch4j" default="stage">
<!-- Handy for nightly builds -->
<tstamp>
<format property="timestamp" pattern="yyyyMMddHHmm" locale="en" />
</tstamp>
<!-- Define the basedir explicitly if we want to import this file -->
<dirname property="base.dir" file="${ant.file}" />
<!-- Load build.properties and overwrite any properties set above -->
<property file="${base.dir}/build.properties" />
<!-- Miscelaneous properties -->
<property name="touch4j.gwt.xml" value="com.emitrom.gwt4.touch.Touch4j" />
<property name="src.dir" value="${base.dir}/src" />
<property name="lib.dir" value="${base.dir}/lib" />
<property name="build.dir" value="${base.dir}/build" />
<property name="chameleon.dir" value="${base.dir}/chameleon" />
<property name="war.dir" value="${base.dir}/war" />
<property name="release.dir" value="${base.dir}/release" />
<property name="stage.dir" value="${base.dir}/stage" />
<property name="cujo.dir" value="${release.dir}/cujo" />
<property name="tools.dir" value="${base.dir}/tools"/>
<property name="install.file" value="INSTALL" />
<property name="license.file" value="license.txt" />
<property name="commercial.license.file" value="Emitrom-Commercial-License-v3.pdf" />
<property name="apache.license.file" value="LICENSE" />
<property name="credits.file" value="CREDITS" />
<property name="notice.file" value="NOTICE" />
<property name="proxy-vole.dir" value="${lib.dir}/com.btr/proxy-vole/2011.11.02/"/>
<property name="bis.guard" value="${tools.dir}/bisguard/JavaAntidecompiler.jar"/>
<!-- Classpath -->
<path id="touch4j.classpath">
<pathelement location="${src.dir}" />
<pathelement location="${build.dir}" />
<pathelement location="${proxy-vole.dir}" />
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<path id="svnant.classpath">
<fileset dir="${tools.dir}/svnant/" includes="*.jar" />
</path>
<!-- svnant typedef -->
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
<!-- Clean -->
<target name="clean" description="Deletes the build and stage directories">
<delete dir="${build.dir}" />
<delete dir="${stage.dir}" />
</target>
<!-- Prepare -->
<target name="prepare">
<mkdir dir="${build.dir}" />
<mkdir dir="${stage.dir}" />
<mkdir dir="${chameleon.dir}" />
<svn>
<checkout force="true" url="${platform.depot}" destPath="${chameleon.dir}" />
</svn>
</target>
<!-- JavaDocs -->
<target name="javadocs" depends="prepare" description="Generate Touch4j Java Docs">
<javadoc
destdir="javadoc"
author="true"
version="true"
use="true"
windowtitle="Touch4j ${version}"
classpathref="touch4j.classpath">
<fileset dir="${src.dir}/com/emitrom/gwt4/touch" defaultexcludes="yes">
<include name="**/*.java"/>
</fileset>
<fileset dir="${chameleon.dir}/com/emitrom/platform" defaultexcludes="yes">
<include name="**/*.java"/>
</fileset>
<doctitle><![CDATA[<h1>Touch4j ${version}</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2011-2012 Emitrom LLC. All Rights Reserved.</i>]]></bottom>
<tag name="todo" scope="all" description="To do:"/>
<group title="Touch4j Framework" packages="com.emitrom.gwt4.touch"/>
<link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="javadoc/packagelist"/>
<link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
</javadoc>
</target>
<!-- Compile -->
<target name="javac" depends="prepare" description="Compile Java source">
<!-- Compile the chameleon files, and copy them over, too -->
<javac srcdir="${chameleon.dir}" includes="**" encoding="utf-8" destdir="${build.dir}" source="1.6" target="1.6" nowarn="true" debug="true" debuglevel="lines,vars,source">
<classpath refid="touch4j.classpath" />
</javac>
<copy todir="${build.dir}/com/emitrom/platform">
<fileset dir="${chameleon.dir}/com/emitrom/platform" includes="**/*.*" />
</copy>
<copy todir="${build.dir}/com/emitrom/platform/maps" file="${chameleon.dir}/com/emitrom/platform/maps/Maps.gwt.xml" />
<copy todir="${build.dir}/com/emitrom/platform/device" file="${chameleon.dir}/com/emitrom/platform/device/Device.gwt.xml" />
<javac srcdir="${src.dir}/com/emitrom/gwt4/touch" includes="**" excludes="**/Cujoless*.*" encoding="utf-8" destdir="${build.dir}" source="1.6" target="1.6" nowarn="true" debug="true" debuglevel="lines,vars,source">
<classpath refid="touch4j.classpath" />
</javac>
<!-- We need to copy the source files, if not GWT will complain -->
<copy todir="${build.dir}/com/emitrom/gwt4/touch">
<fileset dir="${src.dir}/com/emitrom/gwt4/touch" includes="**/*.java" excludes="**/Cujoless*.*" />
</copy>
<!-- Copy the modules, too -->
<copy todir="${build.dir}/com/emitrom/gwt4/touch" file="${src.dir}/com/emitrom/gwt4/touch/Touch4j.gwt.xml" />
<copy todir="${build.dir}/com/emitrom/gwt4/touch/charts" file="${src.dir}/com/emitrom/gwt4/touch/charts/Charts.gwt.xml" />
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/grid" file="${src.dir}/com/emitrom/gwt4/touch/ux/grid/Grid.gwt.xml" />
<!-- Copy the accordion files -->
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/accordion" file="${src.dir}/com/emitrom/gwt4/touch/ux/accordion/Accordion.gwt.xml" />
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/accordion/public">
<fileset dir="${src.dir}/com/emitrom/gwt4/touch/ux/accordion/public" includes="**/*.*" />
</copy>
<!-- Copy the pull refresh files -->
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/dataview/pullrefresh" file="${src.dir}/com/emitrom/gwt4/touch/ux/dataview/pullrefresh/PullRefresh.gwt.xml" />
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/dataview/pullrefresh/public">
<fileset dir="${src.dir}/com/emitrom/gwt4/touch/ux/dataview/pullrefresh/public" includes="**/*.*" />
</copy>
<!-- Copy the rating files -->
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/rating" file="${src.dir}/com/emitrom/gwt4/touch/ux/rating/Rating.gwt.xml" />
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/rating/public">
<fileset dir="${src.dir}/com/emitrom/gwt4/touch/ux/rating/public" includes="**/*.*" />
</copy>
<!-- Copy the touchCalendar files -->
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/touchcalendar" file="${src.dir}/com/emitrom/gwt4/touch/ux/touchcalendar/TouchCalendar.gwt.xml" />
<copy todir="${build.dir}/com/emitrom/gwt4/touch/ux/touchcalendar/public">
<fileset dir="${src.dir}/com/emitrom/gwt4/touch/ux/touchcalendar/public" includes="**/*.*" />
</copy>
</target>
<!-- Compile Cujo -->
<target name="javac-cujo" depends="prepare" description="Compile Java source">
<javac srcdir="${src.dir}/com/emitrom/touch4j" includes="**" encoding="utf-8" destdir="${build.dir}" source="1.6" target="1.6" nowarn="true" debug="true" debuglevel="lines,vars,source">
<classpath refid="touch4j.classpath" />
</javac>
</target>
<!-- Unleash cujo -->
<target name="run-cujo" depends="javac-cujo" description="Encrypts template files, preparing them for distribution">
<java classname="com.emitrom.touch4j.cujo.Cujo">
<classpath refid="touch4j.classpath"/>
<arg value="${build.dir}/com/emitrom/touch4j/license" />
</java>
</target>
<!-- Create Gold Jar files -->
<target name="breed-cujo" depends="clean,run-cujo" description="Creates the base, encrypted, touch4j.jar file">
<delete dir="${cujo.dir}" />
<mkdir dir="${cujo.dir}" />
<jar destfile="${release.dir}/cujo/${ant.project.name}-${version}-raw.jar" basedir="${build.dir}" includes="**/license/*.*">
<manifest>
<attribute name="Main-Class" value="com.emitrom.touch4j.license.GateKeeper" />
</manifest>
</jar>
</target>
<!-- Encrypt the staged Jar file -->
<target name="encrypt" depends="breed-cujo" description="Applies BIS Guard encryption to the Jar file">
<java jar="${bis.guard}" fork="true">
<arg value="${release.dir}/cujo/${ant.project.name}-${version}-raw.jar" />
<arg value="${release.dir}/cujo/${ant.project.name}-${version}.jar" />
<arg value="com.emitrom.touch4j.license.GateKeeper" />
<arg value="${java.antidecompiler.license}" />
</java>
</target>
<!-- Build Jar -->
<target name="package-jar" depends="javac" description="Takes the gold, encrypted touch4j-x.jar file, and updates it">
<copy file="${release.dir}/cujo/${ant.project.name}-${version}.jar" tofile="${stage.dir}/${ant.project.name}-${version}-${timestamp}.jar" />
<jar destfile="${stage.dir}/${ant.project.name}-${version}-${timestamp}.jar" update="true">
<fileset dir="${build.dir}" includes="**/gwt4/**/*.*" />
<fileset dir="${build.dir}" includes="**/platform/**/*.*" />
</jar>
</target>
<!-- Build Jar -->
<target name="apache-package-jar" depends="javac" description="Takes the gold, encrypted touch4j-x.jar file, and updates it">
<jar destfile="${stage.dir}/${ant.project.name}-${version}-${timestamp}.jar" update="true">
<fileset dir="${build.dir}" includes="**/gwt4/**/*.*" excludes="**/rebind/**/*.*" />
<fileset dir="${build.dir}" includes="**/platform/**/*.*" />
</jar>
</target>
<!-- Stage -->
<target name="stage" depends="clean, prepare, package-jar" description="Stages all files, ready for release">
<copy file="${install.file}" tofile="${stage.dir}/${install.file}" />
<copy file="${license.file}" tofile="${stage.dir}/${license.file}" />
<copy file="${credits.file}" tofile="${stage.dir}/${credits.file}" />
<copy file="${notice.file}" tofile="${stage.dir}/${notice.file}" />
<copy file="${commercial.license.file}" tofile="${stage.dir}/${commercial.license.file}" />
<jar destfile="${stage.dir}/${ant.project.name}-${version}-${timestamp}.jar" update="true">
<fileset dir="${proxy-vole.dir}" includes="**/*.*"/>
</jar>
</target>
<!-- Stage -->
<target name="apache-stage" depends="clean, prepare, apache-package-jar" description="Stages all files, ready for release">
<copy file="${install.file}" tofile="${stage.dir}/${install.file}" />
<copy file="${credits.file}" tofile="${stage.dir}/${credits.file}" />
<copy file="${apache.license.file}" tofile="${stage.dir}/${apache.license.file}" />
</target>
<!-- Release -->
<target name="release" depends="encrypt, stage" description="Creates the Touch4j .zip file that can be released.">
<move file="${stage.dir}/${ant.project.name}-${version}-${timestamp}.jar" tofile="${stage.dir}/${ant.project.name}-${version}.jar" />
<!-- create the distributable file -->
<zip destfile="${release.dir}/${ant.project.name}-${version}.zip" basedir="${stage.dir}" />
</target>
<!-- Cujoless Release -->
<target name="apache-release" depends="apache-stage" description="Creates the Touch4j .zip file that can be released.">
<move file="${stage.dir}/${ant.project.name}-${version}-${timestamp}.jar" tofile="${stage.dir}/${ant.project.name}-${version}.jar" />
<!-- create the distributable file -->
<zip destfile="${release.dir}/${ant.project.name}-${version}.zip" basedir="${stage.dir}" />
</target>
</project>