-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
195 lines (159 loc) · 6.88 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="CSVSorter program" default="makeJar" basedir=".">
<description>
CSV-Sorter ANT build
</description>
<property name="version.number" value="0.95 beta"/>
<property name="version.date" value="2018/01/11"/>
<property name="root" location="."/>
<property name="src" location="${root}/src"/>
<property name="build" location="${root}/bin_ant"/>
<property name="dist" location="${root}/dist"/>
<property name="archive" location="${root}/archive"/>
<property name="testbed" location="${root}/testbed"/>
<property name="launcher" location="${root}/launcher"/>
<property name="package" value="tfs/csvsorter"/>
<property name="jar.name" value="csvsorter"/>
<property name="MainProg.name" value="CSVSorter"/>
<property name="MainProg.source" location="${src}/${package}/${MainProg.name}.java"/>
<property name="mainClass" value="tfs.csvsorter.CSVSorter"/>
<property name="docdir" location="${root}/doc"/>
<property name="jobname" value="csvsorter"/>
<property name="launch4j.dir" location="c:\Program Files\Launch4j" />
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="init">
<tstamp/>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="versioning" description="imprint the version information" >
<buildnumber/>
<replaceregexp file="${MainProg.source}"
match="VERSION(\s)*=(.*);"
replace='VERSION = "${version.number}";'
byline="true"/>
<replaceregexp file="${MainProg.source}"
match="DATE(\s)*=(.*);"
replace='DATE = "${version.date}";'
byline="true"/>
<replaceregexp file="${MainProg.source}"
match="BUILD(\s)*=(.*);"
replace='BUILD = ${build.number};'
byline="true"/>
<replaceregexp file="${docdir}/${jobname}.tex"
match="\%\% The csvsorter program(.*)"
replace='\%\% The csvsorter program - version ${version.number} (${version.date})'
byline="true"/>
<replaceregexp file="${docdir}/${jobname}.tex"
match="(.*)def\\version\{(.*)\}"
replace='\\\\def\\\\version{${version.number}}'
byline="true"/>
<replaceregexp file="${docdir}/${jobname}.tex"
match="(.*)def\\datum\{(.*)\}"
replace='\\\\def\\\\datum{${version.date}}'
byline="true"/>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="compileDebug" depends="init" description="debug compile the source" >
<mkdir dir="${build}/${package}" />
<javac srcdir="${src}"
destdir="${build}"
includes="${package}/**"
deprecation="on"
debug="on"
includeAntRuntime="false"
/>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="compile" depends="init" description="compile the source" >
<mkdir dir="${build}/${package}" />
<!-- The bootstrap option is missing in the following -->
<javac srcdir="${src}"
destdir="${build}"
includes="${package}/**"
deprecation="on"
includeAntRuntime="false"
source="1.7"
target="1.7"
>
</javac>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="-jarIt" description="Core of the jar building" >
<jar jarfile="${build}/${jar.name}.jar">
<fileset dir="${build}">
<include name="${package}/**/*.class"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-Date" value="${TODAY} ${TSTAMP}"/>
<attribute name="Main-Class" value ="${mainClass}" />
<attribute name="Specification-Title" value="CSV-Sorter"/>
</manifest>
</jar>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="makeJar" depends="versioning,compile,-jarIt" description="build jar-Datei" >
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="testbed" depends="clean,compileDebug,-jarIt" description="copy jar-Datei to testbed" >
<mkdir dir="${testbed}" />
<copy todir="${testbed}">
<fileset dir="${build}">
<include name="${jar.name}.jar"/>
</fileset>
</copy>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="runTestbed" depends="init,testbed" description="starts the program" >
<java jar="${testbed}/${jar.name}.jar"
fork="true"
dir="${testbed}"
failonerror="true"
jvm="javaw"
>
<arg value="-c" />
<arg value="stresstest.xml" />
</java>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="pdflatex" description="PDF-LaTeX" if="jobname">
<exec executable="pdflatex" dir="${docdir}">
<arg line="--quiet --shell-escape ${jobname}"/>
</exec>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="documentation" depends="init" description="Build PDF documentation" if="jobname">
<antcall target="pdflatex"/>
<antcall target="pdflatex"/>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="makeLauncher" depends="makeJar" description="Create Windows Launcher" >
<copy file="${launcher}/launch4j.xml" todir="${build}"/>
<copy file="${launcher}/csvsorter.ico" todir="${build}"/>
<launch4j configFile="${build}/launch4j.xml"/>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="distribution" depends="clean,makeJar,makeLauncher,documentation" description="generate the distribution" >
<mkdir dir="${dist}" />
<copy todir="${dist}">
<fileset dir="${build}">
<include name="${jar.name}.jar"/>
<include name="${jar.name}.exe"/>
</fileset>
</copy>
<copy todir="${dist}">
<fileset dir="${docdir}">
<include name="${jobname}.pdf"/>
</fileset>
</copy>
<zip destfile="${archive}/csvsorter_${DSTAMP}.zip" basedir="${dist}"/>
</target>
<!-- /////////////////////////////////////////////////////////////////////////// -->
<target name="clean" description="clean up" >
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
</project>