-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
168 lines (137 loc) · 7.1 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
<!--
Copyright 2010 Daniel Bernier
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
ngooglecode upload task: http://code.google.com/p/ant-googlecode/
svnant task: http://subclipse.tigris.org/svnant/svn.html
-->
<project default="test">
<property file="build.credentials.properties" />
<property file="build.properties" />
<property name="svnroot" value="https://wordcram.googlecode.com/svn" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" classpath="lib/ant-googlecode/ant-googlecode-0.0.2.jar" name="gcupload" />
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml">
<classpath>
<fileset dir="lib/svnant">
<include name="*.jar" />
</fileset>
</classpath>
</typedef>
<property name="classpath" value="lib/processing/core.jar;lib/jsoup-1.3.3.jar;lib/cue.language.jar" />
<target name="clean">
<delete dir="build" />
</target>
<target name="compile" depends="clean">
<mkdir dir="build/classes" />
<javac srcdir="src" destdir="build/classes" classpath="${classpath}" source="1.5" target="1.5" includeantruntime="false">
<compilerarg value="-Xlint" />
</javac>
</target>
<target name="test" depends="compile">
<mkdir dir="build/tests" />
<javac srcdir="test" destdir="build/tests" source="1.5" target="1.5" includeantruntime="false"
classpath="${classpath};lib/junit/junit-4.8.2.jar;lib/mockito-all-1.8.5.jar;build/classes">
<compilerarg value="-Xlint" />
</javac>
<junit dir="build/tests" haltonfailure="true">
<classpath path="${classpath};lib/junit/junit-4.8.2.jar;lib/mockito-all-1.8.5.jar;build/classes;build/tests" />
<formatter type="brief" usefile="false" />
<batchtest fork="yes">
<fileset dir="test">
<include name="**/*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="bundleForProcessing" depends="test">
<mkdir dir="build/p5lib/WordCram/library" />
<jar destfile="build/p5lib/WordCram/library/WordCram.jar" basedir="build/classes" />
<copy file="lib/jsoup-1.3.3.jar" todir="build/p5lib/WordCram/library" />
<copy file="lib/cue.language.jar" todir="build/p5lib/WordCram/library" />
<mkdir dir="build/p5lib/WordCram/examples" />
<copy todir="build/p5lib/WordCram/examples">
<fileset dir="example" />
</copy>
<mkdir dir="build/p5lib/WordCram/src" />
<copy todir="build/p5lib/WordCram/src">
<fileset dir="src" />
</copy>
<mkdir dir="build/p5lib/WordCram/reference" />
<javadoc classpath="${classpath}" sourcepath="src" destdir="build/p5lib/WordCram/reference"
windowtitle="WordCram API" use="true" overview="src/overview.html" header="WordCram 0.5">
<!-- TODO version # in build file - property? Or rather, pass it as an arg, and have it default to 'latest' or something. -->
<!-- TODO put these in if it ever seems useful.
<link href="http://processing.googlecode.com/svn/trunk/processing/build/javadoc/" />
<link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
-->
</javadoc>
<copy file="wordcram.png" todir="build/p5lib/WordCram/reference" />
</target>
<target name="publish.local" depends="bundleForProcessing">
<delete dir="${processing.sketchFolder}/libraries/WordCram" />
<mkdir dir="${processing.sketchFolder}/libraries/WordCram" />
<copy todir="${processing.sketchFolder}/libraries/WordCram">
<fileset dir="build/p5lib/WordCram" />
</copy>
</target>
<target name="publish.daily" depends="bundleForProcessing">
<input message="Give us a quick summary for Google Code:" addproperty="publish.summary" />
<tstamp>
<format property="date" pattern="yyyyMMdd" />
</tstamp>
<property name="pub.file" value="wordcram.${date}" />
<tar destfile="build/${pub.file}.tar.gz" basedir="build/p5lib" compression="gzip" />
<zip destfile="build/${pub.file}.zip" basedir="build/p5lib" />
<gcupload username="${gc.username}" password="${gc.password}" projectname="wordcram"
filename="build/${pub.file}.tar.gz" targetfilename="${pub.file}.tar.gz"
summary="${publish.summary}" labels="development, daily" />
<gcupload username="${gc.username}" password="${gc.password}" projectname="wordcram"
filename="build/${pub.file}.zip" targetfilename="${pub.file}.zip"
summary="${publish.summary}" labels="development, daily" />
</target>
<target name="makeReleaseBranch"> <!-- description="Make a release branch from the trunk." -->
<input message="What's the release number?:" addproperty="publish.releaseNumber" /> <!-- TODO version # in build file - property? -->
<svn><copy srcUrl="${svnroot}/trunk"
destUrl="${svnroot}/branches/RB-${publish.releaseNumber}"
message="Added release branch ${publish.releaseNumber}" />
</svn>
</target>
<target name="publish.release" depends="bundleForProcessing">
<!-- run this from a RELEASE branch, NOT TRUNK TODO add a check: check that current dir is under branches.
Can we find the release # from the branch name? should be able to... -->
<input message="Give us a quick summary for Google Code:" addproperty="publish.summary" />
<!-- TODO version # in build file - property? -->
<input message="...and the release number (should match the branch you're on):" addproperty="publish.releaseNumber" />
<property name="pub.file" value="wordcram.${publish.releaseNumber}" />
<tar destfile="build/${pub.file}.tar.gz" basedir="build/p5lib" compression="gzip" />
<zip destfile="build/${pub.file}.zip" basedir="build/p5lib" />
<gcupload username="${gc.username}" password="${gc.password}" projectname="wordcram"
filename="build/${pub.file}.tar.gz" targetfilename="${pub.file}.tar.gz"
summary="${publish.summary}" labels="release, stable, Featured" />
<gcupload username="${gc.username}" password="${gc.password}" projectname="wordcram"
filename="build/${pub.file}.zip" targetfilename="${pub.file}.zip"
summary="${publish.summary}" labels="release, stable, Featured" />
<svn><info target="." propprefix="branch" /></svn>
<svn username="${gc.username}" password="${gc.password}">
<copy srcUrl="${branch.url}" destUrl="${svnroot}/tags/REL_${publish.releaseNumber}"
message="Added release ${publish.releaseNumber}" />
</svn>
<copy todir="../../javadoc">
<fileset dir="build/p5lib/WordCram/reference" />
</copy>
<svn><propset path="../../javadoc/" name="svn:mime-type" value="text/html" recurse="true"/></svn>
<svn><propset path="../../javadoc/stylesheet.css" name="svn:mime-type" value="text/css" recurse="true"/></svn>
<svn><commit dir="../../javadoc" recurse="true"
message="updating javadoc for release ${publish.releaseNumber}" /></svn>
</target>
</project>