-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
298 lines (229 loc) · 12.4 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
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?xml version="1.0" encoding="utf-8" ?>
<project name="OnlyAnt" default="build" basedir=".">
<!-- Arguments to gwtc and devmode targets -->
<property name="gwt.args" value="" />
<!-- Configure path to GWT SDK -->
<property name="gwt.sdk" location="/Users/mykaarma/.p2/pool/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt28_2.8.0.201710131939/gwt-2.8.1" />
<property name="build" location="build" />
<property name="src" location="src/com/demo/tasks/" />
<property name="dist" location="dist" />
<path id="project.class.path">
<pathelement location="war/WEB-INF/classes"/>
<pathelement location="${gwt.sdk}/gwt-user.jar"/>
<pathelement location="${gwt.sdk}/gwt-dev.jar"/>
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar"/>
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar"/>
<pathelement location="/Users/mykaarma/Downloads/aws-sdk-java/aws-java-sdk-s3/target/aws-java-sdk-s3-1.11.680-SNAPSHOT.jar"/>
<pathelement location="/Users/mykaarma/Downloads/aws-sdk-java/aws-java-sdk-core/target/aws-java-sdk-core-1.11.680-SNAPSHOT.jar"/>
<!--<pathelement location="/Users/mykaarma/Downloads/aws-sdk-java-v2/aws-sdk-java/target/aws-sdk-java-2.10.22-SNAPSHOT.jar"/>
<pathelement location="/Users/mykaarma/Downloads/aws-sdk-java-v2/services/s3/target/aws-sdk-java-s3-2.10.22-SNAPSHOT.jar"/>
<pathelement location="/Users/mykaarma/Downloads/aws-java-sdk-core-1.11.678.jar"/>-->
<fileset dir="war/WEB-INF/lib" includes="**/*.jar"/>
<!-- Add any additional non-server libs (such as JUnit) here -->
</path>
<target name="init">
<mkdir dir="${build}" />
</target>
<target name="libs" depends = "init" description="Copy libs to WEB-INF/lib">
<mkdir dir="war/WEB-INF/lib" />
<copy todir="war/WEB-INF/lib" file="/home/jenkins/3plibs/gwt-2.8.0/gwt-servlet.jar" />
<copy todir="war/WEB-INF/lib" file="/home/jenkins/3plibs/gwt-2.8.0/gwt-servlet-deps.jar" />
<!-- Add any additional server libs that need to be copied -->
</target>
<target name="javac" depends="libs" description="Compile java source to bytecode">
<mkdir dir="war/WEB-INF/classes"/>
<javac srcdir="src" includes="**" encoding="utf-8"
destdir="war/WEB-INF/classes"
source="1.7" target="1.7" nowarn="true"
includeantruntime = "false"
debug="true" debuglevel="lines,vars,source">
<classpath refid="project.class.path"/>
</javac>
<copy todir="war/WEB-INF/classes">
<fileset dir="src" excludes="**/*.java"/>
</copy>
</target>
<target name="compilejars" depends="javac" description="compile the source">
<javac srcdir="${src}" destdir="${build}" includeantruntime = "false">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="initdist" depends="compilejars" description="generate the distribution">
<mkdir dir="${dist}" />
<jar destfile="${dist}/shared.jar" basedir="${build}" />
</target>
<target name="gwtc" depends="initdist" description="GWT compile to JavaScript (production mode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler" maxmemory="512m">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
</classpath>
<arg line="-war"/>
<arg value="war"/>
<!--<arg line="-style"/>
<arg value="PRETTY"/>-->
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="com.demo.gwt.OnlyAnt"/>
</java>
</target>
<target name="devmode" depends="javac" description="Run development mode (pass -Dgwt.args=-nosuperDevMode to fallback to classic DevMode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode" maxmemory="1g">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
<pathelement location="${gwt.sdk}/gwt-codeserver.jar"/>
</classpath>
<arg value="-startupUrl"/>
<arg value="OnlyAnt.html"/>
<arg line="-war"/>
<arg value="war"/>
<!-- Additional arguments like -style PRETTY, -logLevel DEBUG or -nosuperDevMode -->
<arg line="${gwt.args}"/>
<arg value="com.demo.gwt.OnlyAnt"/>
<arg value="com.demo.gwt.OnlyAnt"/>
</java>
</target>
<target name="eclipse.generate" depends="libs" description="Generate eclipse project">
<java failonerror="true" fork="true" classname="com.google.gwt.user.tools.WebAppCreator">
<classpath>
<path refid="project.class.path"/>
</classpath>
<arg value="-XonlyEclipse"/>
<arg value="-ignore"/>
<arg value="com.demo.gwt.OnlyAnt"/>
</java>
</target>
<property name="enableCDN" value="false"/>
<property name="bucketName" value="{bucketName}"/>
<property name="awsAccessKeyId" value="{awsAccessKeyId}"/>
<property name="awsSecretKey" value="{awsSecretKey}"/>
<property name="tomcatURL" value="{tomcatURL}"/>
<property name="CloudFrontURL" value="{CloudFrontURL}"/>
<!--<taskdef resource="/Users/mykaarma/Downloads/aws-ant-task/src/main/resources/taskdefs.xml" classpath="/Users/mykaarma/Downloads/aws-ant-task/target/aws-ant-tasks-0.5-SNAPSHOT.jar" />-->
<taskdef resource="taskdefs.xml" classpath="/home/jenkins/.m2/repository/com/amazonaws/aws-java-sdk-ant-tasks/1.2.3/aws-java-sdk-ant-tasks-1.2.3.jar" />
<target name="cdn-invalidation" description="Invalidation of static files">
<!--<taskdef name="cloudfront" classpath="/Users/mykaarma/Downloads/aws-ant-task/target/aws-ant-tasks-0.5-SNAPSHOT.jar" classname="it.corley.ant.CloudFront"/>-->
<cloudfront key="${awsAccessKeyId}" secret="${awsSecretKey}" distributionId="${CloudFrontURL}">
<delete path="/*"/>
<!--<delete path="/war/service/gwt/chrome/chrome.css"/>
<delete path="/war/service/service.nocache.js"/>
<delete path="/war/service/GWTCStandard.css"/>-->
<!--<delete path="/css/folder/my-path.css"/>
<delete path="/direct-gen.txt"/>-->
</cloudfront>
</target>
<!--<fail message="Property "foo" has no value">-->
<condition property="workCDN">
<equals arg1="${enableCDN}" arg2="true"/>
</condition>
<!--</fail>-->
<target name="replacejs" if="workCDN" depends="gwtc" description="replace JS file to something else">
<!--<replaceregexp file="war/onlyant/onlyant.nocache.js" flags="s" encoding="utf-8" match="(return\s+true\s*)(})(\nonlyant.succeeded=onlyant\(\);)" replace="onlyant.__moduleBase="http://127.0.0.1:8080/onlyant/";\1;\2\3" />-->
<replaceregexp file="war/onlyant/onlyant.nocache.js" flags="s" encoding="utf-8" match="(return\s+true\s*)(})(\nonlyant.succeeded=onlyant\(\);)" replace="onlyant.__moduleBase="${tomcatURL}/onlyant/";\1;\2\3" />
</target>
<!--<target name="replacejs" description="replace JS file to something else">-->
<!--<replaceregexp file="war/onlyant/onlyant.nocache.js" flags="s" encoding="utf-8" match="(return\s+true\s*)(})(\nonlyant.succeeded=onlyant\(\);)" replace="onlyant.__moduleBase="http://127.0.0.1:8080/onlyant/";\1;\2\3" />-->
<!--<replaceregexp file="war/onlyant/onlyant.nocache.js" flags="s" encoding="utf-8" match="(return true})($)" replace="biz_kaar_desktop_notifier.__moduleBase="http://127.0.0.1:8080/biz.kaar.desktop.notifier/";\1;\2" />
</target>-->
<taskdef resource="taskdefs.xml" classpath="/home/jenkins/.m2/repository/com/amazonaws/aws-java-sdk-ant-tasks/1.2.3/aws-java-sdk-ant-tasks-1.2.3.jar" />
<!--<target name="upload" if="workCDN" depends="replacejs">-->
<target name="upload">
<upload-to-s3 bucketName="${bucketName}" awsAccessKeyId="${awsAccessKeyId}" awsSecretKey="${awsSecretKey}" >
<!--<upload-to-s3 bucketName="" awsAccessKeyId="" awsSecretKey="" >-->
<fileset dir="war" />
</upload-to-s3>
</target>
<!-- <target name="upload-s3">
<path id="tasks.path">
<fileset dir="dist/" includes="*.jar"/>
</path> -->
<!--<taskdef resource="src/com/demo/gwt/shared/tasks.properties" classpathref="tasks.path"/>-->
<!--<taskdef name="s3upload" classname="com.demo.gwt.tasks.S3PutTask" classpath="dist/shared.jar" />-->
<!--<s3delete endpoint="s3.amazonaws.com" key="" secret="" bucket="" dirs="3.5"/>-->
<!--<s3upload endpoint="s3.amazonaws.com" key="" secret="" bucket="" dest="3.5" contentType="application/x-whatever">-->
<!-- fileset structure -->
<!-- <fileset dir="docker"/>
</s3upload>
</target> -->
<!--<aws:s3 accessKey="" secretKey="">
<upload bucketName="static.springframework.org"
file="${target.release.dir}/${release-with-dependencies.zip}"
toFile="SPR/spring-framework-${spring-version}-with-dependencies-${tstamp}-${build.number}.zip"
publicRead="true"/>
<upload bucketName="static.springframework.org"
file="${target.release.dir}/${release.zip}"
toFile="SPR/spring-framework-${spring-version}-${tstamp}-${build.number}.zip"
publicRead="true"/>
</aws:s3>-->
<!--
Test targets suppressed because -junit argument was not specified when running webAppCreator.
<target name="javac.tests" depends="javac" description="Compiles test code">
<javac srcdir="test" includes="**" encoding="utf-8"
source="1.7" target="1.7" nowarn="true"
destdir="war/WEB-INF/classes"
debug="true" debuglevel="lines,vars,source">
<classpath location="path_to_the_junit_jar"/>
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="test.dev" depends="javac.tests" description="Run development mode tests">
<mkdir dir="reports/htmlunit.dev" />
<junit fork="yes" printsummary="yes" haltonfailure="yes" maxmemory="256m">
<sysproperty key="gwt.args" value="-devMode -logLevel WARN -war www-test" />
<sysproperty key="java.awt.headless" value="true" />
<classpath>
<pathelement location="src" />
<pathelement location="test" />
<path refid="project.class.path" />
<pathelement location="/Users/mykaarma/.p2/pool/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt28_2.8.0.201710131939/gwt-2.8.1/validation-api-1.0.0.GA.jar" />
<pathelement location="/Users/mykaarma/.p2/pool/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt28_2.8.0.201710131939/gwt-2.8.1/validation-api-1.0.0.GA-sources.jar" />
<pathelement location="path_to_the_junit_jar" />
</classpath>
<batchtest todir="reports/htmlunit.dev" >
<fileset dir="test" >
<include name="**/*Suite.java" />
</fileset>
</batchtest>
<formatter type="plain" />
<formatter type="xml" />
</junit>
</target>
<target name="test.prod" depends="javac.tests" description="Run production mode tests">
<mkdir dir="reports/htmlunit.prod" />
<junit fork="yes" printsummary="yes" haltonfailure="yes" maxmemory="256m">
<sysproperty key="gwt.args" value="-logLevel WARN -war www-test" />
<sysproperty key="java.awt.headless" value="true" />
<classpath>
<pathelement location="src" />
<pathelement location="test" />
<path refid="project.class.path" />
<pathelement location="/Users/mykaarma/.p2/pool/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt28_2.8.0.201710131939/gwt-2.8.1/validation-api-1.0.0.GA.jar" />
<pathelement location="/Users/mykaarma/.p2/pool/plugins/com.gwtplugins.gwt.eclipse.sdkbundle.gwt28_2.8.0.201710131939/gwt-2.8.1/validation-api-1.0.0.GA-sources.jar" />
<pathelement location="path_to_the_junit_jar" />
</classpath>
<batchtest todir="reports/htmlunit.prod" >
<fileset dir="test" >
<include name="**/*Suite.java" />
</fileset>
</batchtest>
<formatter type="plain" />
<formatter type="xml" />
</junit>
</target>
<target name="test" description="Run development and production mode tests">
<antcall target="test.dev" />
<antcall target="test.prod" />
</target>
-->
<target name="build" depends="gwtc" description="Build this project" />
<target name="war" depends="build" description="Create a war file">
<zip destfile="docker/OnlyAnt.war" basedir="war"/>
</target>
<target name="clean" description="Cleans this project">
<delete dir="war/WEB-INF/classes" failonerror="false" />
<delete dir="war/onlyant" failonerror="false" />
<delete dir="build" failonerror="false" />
<delete dir="dist" failonerror="false" />
</target>
</project>