-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathbuild.xml
132 lines (118 loc) · 6.53 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="classifier" default="default" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3">
<description>Builds, tests, and runs the project classifier.</description>
<import file="nbproject/build-impl.xml"/>
<property name="ivy.install.version" value="2.1.0-rc2" />
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
</condition>
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="http://insecure.repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<target name="resolve" description="--> retrieve dependencies with ivy" depends="init-ivy">
<ivy:retrieve />
</target>
<target name="download-traindata" unless="offline">
<!-- download the trained data from web site -->
<get src="http://rdp.cme.msu.edu/download/rdpclassifiertraindata/data.tgz"
dest="${build.classes.dir}" usetimestamp="true"/>
<untar src="${build.classes.dir}/data.tgz" dest="${build.classes.dir}/" compression="gzip" />
<move file="${build.classes.dir}/data.tgz" tofile="${dist.dir}/data.tgz" overwrite="true" />
</target>
<target name="-pre-compile" depends="resolve" />
<target depends="resolve,init,compile,-pre-jar,-post-jar,download-traindata" description="Build JAR." name="jar">
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<pathconvert property="run.classpath.without.build.classes.dir">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to=""/>
</pathconvert>
<pathconvert pathsep=" " property="jar.classpath">
<path path="${run.classpath.without.build.classes.dir}"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
<copy todir="${dist.dir}/lib" flatten="true">
<path>
<pathelement path="${run.classpath.without.build.classes.dir}"/>
</path>
</copy>
<j2seproject1:jar manifest="${manifest.file}">
<j2seproject1:manifest>
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
<j2seproject1:attribute name="Class-Path" value="${jar.classpath}"/>
<!-- if you deal with versions -->
<!-- j2seproject1:attribute name="Build-Version" value="${version}" / -->
</j2seproject1:manifest>
</j2seproject1:jar>
<echo>To run this application from the command line without Ant, try:</echo>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<echo>java -jar "${dist.jar.resolved}"</echo>
<move file="${dist.dir}/data.tgz" tofile="${build.classes.dir}/data.tgz" overwrite="true" />
</target>
<target depends="resolve,init,compile,-pre-jar,-post-jar" description="Build JAR." name="devel">
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<pathconvert property="run.classpath.without.build.classes.dir">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to=""/>
</pathconvert>
<pathconvert pathsep=" " property="jar.classpath">
<path path="${run.classpath.without.build.classes.dir}"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
<copy todir="${dist.dir}/lib" flatten="true">
<path>
<pathelement path="${run.classpath.without.build.classes.dir}"/>
</path>
</copy>
<j2seproject1:jar manifest="${manifest.file}">
<j2seproject1:manifest>
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
<j2seproject1:attribute name="Class-Path" value="${jar.classpath}"/>
<!-- if you deal with versions -->
<!-- j2seproject1:attribute name="Build-Version" value="${version}" / -->
</j2seproject1:manifest>
</j2seproject1:jar>
<echo>To run this application from the command line without Ant, try:</echo>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<echo>java -jar "${dist.jar.resolved}"</echo>
</target>
<target name="junit" depends="compile-test">
<junit printsummary="yes" haltonfailure="yes" showoutput="yes">
<classpath path="${javac.test.classpath}:${build.classes.dir}:${build.test.classes.dir}"/>
<formatter type="xml"/>
<batchtest fork="yes">
<fileset dir="${test.src.dir}" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
</project>