-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtasks.xml
213 lines (191 loc) · 7.4 KB
/
tasks.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
<?xml version="1.0"?>
<project>
<!-- Load build properties -->
<property file="./build.properties"/>
<!-- Create classpath -->
<path id="classpath">
<pathelement location="${classDir}"/>
<pathelement location="${configDir}"/>
<pathelement location="lib/mixup"/>
<fileset dir="${libDir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Initalization -->
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by build -->
<mkdir dir="${classDir}"/>
</target>
<!-- Compile the java code from ${srcDir} into ${classDir} -->
<target name="build" depends="init" description="build source">
<javac source="1.5" srcdir="${srcDir}" destdir="${classDir}" verbose="${verbose}" debug="on" classpathref="classpath" deprecation="${deprecation}"/>
</target>
<!-- Delete all compiled files except for javadocs -->
<target name="clean" description="clean up">
<delete dir="${tmpDir}"/>
<delete dir="${classDir}"/>
<delete dir="${reportsDir}"/>
</target>
<!-- Clean then build -->
<target name="build-clean" depends="clean,build" description="compile the source from scratch"/>
<!-- Copy test cases into class dir for JUnit tests -->
<target name="copy-testcases" description="copy files from testcase directory into class directory">
<copy todir="${classDir}">
<fileset dir="test" includes="**/testcases/**"/>
</copy>
</target>
<!-- Build JUnit tests -->
<target name="build-test" depends="init,build,copy-testcases" description="compile test cases">
<javac srcdir="${testDir}" destdir="${classDir}"
debug="on" classpathref="classpath" deprecation="${deprecation}"/>
</target>
<!-- Open jar files for building dist -->
<target name="open-jars" depends="build" description="unpack lib/*.jar into a tmp directory">
<delete dir="${tmpDir}"/>
<mkdir dir="${tmpDir}"/>
<unjar dest="${tmpDir}">
<fileset dir="${libDir}" includes="*.jar" excludes="minorThirdIncludes.jar"/>
</unjar>
</target>
<!-- Merge jar files in lib into one jar file -->
<target name="merge-jars" depends="open-jars" description="merge lib/*.jar into a single jar file">
<jar jarfile="minorThirdIncludes.jar" baseDir="${distDir}">
<fileset dir="${tmpDir}" includes="**/*.class"/>
</jar>
</target>
<!-- Build Javadoc -->
<target name="javadoc" description="build javadoc API documentation">
<delete dir="${javadocDir}"/>
<mkdir dir="${javadocDir}/edu/cmu/minorthird/"/>
<javadoc sourcepath="${srcDir}" destdir="${javadocDir}" classpathref="classpath" packagenames="edu.cmu.minorthird.*"/>
</target>
<!-- Make a full source code release zip (depends on build to ensure compilability)-->
<target name="release" depends="build,javadoc">
<mkdir dir="${distDir}"/>
<zip destfile="${distDir}/minorthird_${DSTAMP}.zip">
<fileset dir=".">
<include name="src/**"/>
<include name="test/**"/>
<include name="config/**"/>
<include name="lib/**"/>
<include name="doc/**"/>
<include name="demos/**"/>
<include name="apps/**"/>
<include name="script/**"/>
<include name="*.properties"/>
<include name="*.xml"/>
<include name="*.txt"/>
<exclude name="**/.svn"/>
<exclude name="doc/javadoc/**"/>
</fileset>
</zip>
</target>
<!-- Make a full release jar-->
<target name="release-jar" depends="open-jars">
<mkdir dir="${distDir}"/>
<jar jarfile="${distDir}/minorthird_${DSTAMP}.jar" basedir="${classDir}">
<manifest>
<attribute name="Main-Class" value="edu.cmu.minorthird.Minorthird"/>
</manifest>
<fileset dir="${classDir}">
<include name="edu/cmu/minorthird/**/*.class"/>
</fileset>
<fileset dir="${tmpDir}" includes="**/*"/>
<fileset dir="${configDir}">
<include name="*.properties"/>
<include name="*.config"/>
<include name="selectableTypes.txt"/>
</fileset>
<fileset dir="${libDir}">
<include name="**/*.mixup"/>
<include name="montylingua/*"/>
</fileset>
</jar>
</target>
<!-- Make a classify-only release jar-->
<target name="release-classify" depends="open-jars">
<mkdir dir="${distDir}"/>
<jar jarfile="${distDir}/minorthird-classify_${DSTAMP}.jar" basedir="${classDir}">
<fileset dir="${classDir}">
<include name="edu/cmu/minorthird/classify/**/*.class"/>
<include name="edu/cmu/minorthird/ui/**/*.class"/>
<include name="edu/cmu/minorthird/util/**/*.class"/>
</fileset>
<fileset dir="${tmpDir}" includes="**/*"/>
<fileset dir="${configDir}">
<include name="*.properties"/>
<include name="*.config"/>
<include name="selectableTypes.txt"/>
</fileset>
</jar>
</target>
<!-- Make a documentation release zip-->
<target name="release-doc" depends="init,javadoc">
<mkdir dir="${distDir}"/>
<zip destfile="${distDir}/minorthird-doc_${DSTAMP}.zip">
<fileset dir="./doc" excludes="**/.svn"/>
</zip>
</target>
<!-- Make all the release files for a sourceforge release-->
<target name="release-all" depends="clean,release-doc,release,release-jar,release-classify"/>
<!-- Run (not build) JUnit tests -->
<target name="test" depends="build,build-test" description="run the tests, NOT halting on failure">
<mkdir dir="${reportsDir}"/>
<!-- Apparently the maxmemory doesn't help to increase heap space. Ideas? -->
<junit maxmemory="2048m" printsummary="yes" haltonfailure="no">
<classpath>
<path refid="classpath"/>
</classpath>
<formatter type="plain"/>
<batchtest fork="no" todir="${reportsDir}">
<fileset dir="${classDir}">
<!-- either TestPackage or *Test -->
<include name="**/TestPackage.class"/>
<include name="**/*Test.class"/>
<!-- exclude LongTestPackage because it takes up too much time -->
<exclude name="**/LongTestPackage.class"/>
<!-- inner classes excluded -->
<exclude name="**/*$*.class"/>
<!-- a base class, not to be run, bad name -->
<exclude name="edu/cmu/minorthird/text/learn/ClassifyTest.class"/>
<!-- requires test data -->
<exclude name="**/IOUtilTest.class"/>
<!-- data -->
<exclude name="**/classify/Test.class"/>
<exclude name="**/classify/TrainTest.class"/>
<exclude name="**/LearnToClassifyTest.class"/>
<exclude name="**/EdoTextLabelsTest.class"/>
<exclude name="**/BayesClassifiersTest.class"/>
<exclude name="**/TextLabelsLoaderTest.class"/>
<exclude name="**/SimpleTextLoaderTest.class"/>
<exclude name="com/lgc/wsh/inv/GaussNewtonSolverTest.class"/>
</fileset>
</batchtest>
</junit>
<!-- Delete temporary files -->
<delete file="./tmp.ann"/>
</target>
<!-- Longer JUnit tests -->
<target name="test-long" depends="build,build-test" description="run the tests, NOT halting on failure">
<mkdir dir="${reportsDir}"/>
<junit printsummary="yes" haltonfailure="no">
<classpath><path refid="classpath"/></classpath>
<formatter type="plain"/>
<batchtest fork="no" todir="${reportsDir}">
<fileset dir="${classDir}">
<include name="**/LongTestPackage.class"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- Some app-building task -->
<target name="build-apps" depends="build" description="build the source for the app directory">
<javac srcdir="./apps/" destdir="${classDir}" debug="on" classpathref="classpath"/>
</target>
<!-- More app-building task -->
<target name="build-names" depends="init" description="build the source for app/names">
<javac srcdir="./apps/names/src" destdir="${classDir}" debug="on" classpathref="classpath"/>
</target>
</project>