-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.xml
159 lines (145 loc) · 6.92 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
<?xml version="1.0" ?>
<!--
| Copyright (c) 2001-2019 Steve Purcell.
| Copyright (c) 2002 Vidar Holen.
| Copyright (c) 2002 Michal Ceresna.
| Copyright (c) 2005 Ewan Mellor.
| Copyright (c) 2010-2012 penSec.IT UG (haftungsbeschränkt).
|
| All rights reserved.
|
| Redistribution and use in source and binary forms, with or without
| modification, are permitted provided that the following conditions are met:
| Redistributions of source code must retain the above copyright notice, this
| list of conditions and the following disclaimer. Redistributions in binary
| form must reproduce the above copyright notice, this list of conditions and
| the following disclaimer in the documentation and/or other materials provided
| with the distribution. Neither the name of the copyright holder nor the names
| of its contributors may be used to endorse or promote products derived from
| this software without specific prior written permission.
|
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
| POSSIBILITY OF SUCH DAMAGE.
-->
<project default="build" basedir=".">
<property name="Name" value="Jargs"/>
<property name="version" value="2.0-SNAPSHOT"/>
<property name="debug" value="on"/>
<property name="build.src" value="src/main/java"/>
<property name="build.classes" value="target/classes"/>
<property name="test.src" value="src/test/java"/>
<property name="test.classes" value="target/test-classes"/>
<property name="examples.src" value="src/examples/java"/>
<property name="examples.classes" value="target/examples-classes"/>
<property name="source-version" value="1.5" />
<property name="jdk-version" value="1.5" />
<property name="javadoc.outdir" value="target/site/apidocs"/>
<property name="javadoc.doctitle" value="JArgs command line option parsing library"/>
<property name="javadoc.header" value='For updates and more see <a target="_top" href="http://jargs.sanityinc.com/">jargs.sanityinc.com</a>'/>
<property name="javadoc.bottom" value='Copyright &copy; 2001-20194 Steve Purcell. Copyright &copy; 2002 Vidar Holen. Copyright &copy; 2002 Michal Ceresna. Copyright &copy; 2005 Ewan Mellor. Copyright (c) 2010-2012 penSec.IT UG (haftungsbeschränkt). Released under the terms of the BSD licence.'/>
<property name="javadoc.packages" value="com.sanityinc.jargs"/>
<property name="junit.jar" value="/usr/share/java/junit.jar"/>
<target name="build" description="Build and test Jargs."
depends="compile,jars,javadoc,test" />
<target name="compile">
<mkdir dir="${build.classes}"/>
<javac destdir="${build.classes}" debug="${debug}"
source="${source-version}" target="${jdk-version}"
includeantruntime="false">
<classpath path="${build.classes}:${java.class.path}"/>
<src path="${build.src}" />
</javac>
</target>
<target name="compile-test" depends="compile">
<mkdir dir="${test.classes}"/>
<javac destdir="${test.classes}" debug="${debug}"
source="${source-version}" target="${jdk-version}"
includeantruntime="false">
<classpath path="${build.classes}:${junit.jar}:${java.class.path}"/>
<src path="${test.src}" />
</javac>
</target>
<target name="compile-examples" depends="compile">
<mkdir dir="${examples.classes}"/>
<javac destdir="${examples.classes}" debug="${debug}"
source="${source-version}" target="${jdk-version}"
includeantruntime="false">
<classpath path="${build.classes}:${junit.jar}:${java.class.path}"/>
<src path="${examples.src}" />
</javac>
</target>
<target name="jars" depends="runtimejar,testjar" />
<target name="runtimejar" depends="compile">
<mkdir dir="target"/>
<mkdir dir="target/jar-temp"/>
<copy todir="target/jar-temp">
<fileset dir="${build.classes}"/>
</copy>
<jar jarfile="target/jargs-${version}.jar" basedir="target/jar-temp"/>
<delete dir="target/jar-temp"/>
</target>
<target name="testjar" depends="compile-test,compile-examples">
<mkdir dir="target"/>
<mkdir dir="target/jar-temp"/>
<copy todir="target/jar-temp">
<fileset dir="${test.classes}"/>
<fileset dir="${examples.src}"/>
</copy>
<jar jarfile="target/jargs-${version}-tests.jar" basedir="target/jar-temp"/>
<delete dir="target/jar-temp"/>
</target>
<target name="test" depends="compile,compile-test">
<java classname="org.junit.runner.JUnitCore"
classpath="${build.classes}:${test.classes}:${junit.jar}:${java.class.path}" >
<arg value="com.sanityinc.jargs.AllTests"/>
</java>
</target>
<target name="run-examples" depends="compile-examples">
<java classname="com.sanityinc.jargs.examples.OptionTest"
classpath="${build.classes}:${examples.classes}:${java.class.path}">
</java>
<java classname="com.sanityinc.jargs.examples.AutoHelpParser"
classpath="${build.classes}:${examples.classes}:${java.class.path}">
<arg value="--help" />
</java>
<java classname="com.sanityinc.jargs.examples.CustomOptionTest"
classpath="${build.classes}:${examples.classes}:${java.class.path}">
<arg value="-d" />
<arg value="09/23/2012" />
</java>
<java classname="com.sanityinc.jargs.examples.OptionParserSubclassTest"
classpath="${build.classes}:${examples.classes}:${java.class.path}">
</java>
</target>
<target name="clean"
description="Remove all generated files.">
<delete dir="target" />
</target>
<target name="javadoc">
<mkdir dir="${javadoc.outdir}"/>
<javadoc
sourcepath="${build.src}"
protected="true"
destdir="${javadoc.outdir}"
author="true"
version="true"
use="true"
windowtitle="${javadoc.doctitle}"
doctitle="${javadoc.doctitle}"
header="${javadoc.header}"
footer="${javadoc.header}"
bottom="${javadoc.bottom}">
<package name="**.*" />
<classpath path="${build.classes}:${junit.jar}:${java.class.path}"/>
</javadoc>
</target>
</project>