-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
105 lines (95 loc) · 3.98 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
<project name="json" default="default" xmlns:if="ant:if">
<property name="build.sysclasspath" value="ignore"/>
<property file="build.properties"/>
<property name="description" value="ZPath API"/>
<property name="dist" value="dist"/> <!-- where to build the Jars -->
<property name="classes.main" value="build/main"/> <!-- where to compile the classes -->
<property name="docs" value="docs"/>
<property name="src.main" value="src/main"/>
<property name="jar.main" value="${dist}/zpath-${version}.jar"/>
<property name="classes.test" value="build/test"/> <!-- where to compile the classes -->
<property name="src.test" value="src/test"/>
<property name="jar.test" value="${dist}/zpath-test-${version}.jar"/>
<path id="path.build">
<fileset dir="lib" includes="*.jar"/>
</path>
<target name="clean">
<delete dir="${classes.main}" />
<delete dir="${classes.test}" />
<delete dir="${dist}" />
<delete dir="${docs}" />
</target>
<target name="build">
<mkdir dir="${classes.main}"/>
<mkdir dir="${dist}"/>
<javac encoding="utf-8" debug="true" source="8" target="8" destdir="${classes.main}">
<src path="${src.main}"/>
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xlint:rawtypes"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:finally"/>
<compilerarg value="-Xlint:overrides"/>
<classpath refid="path.build" />
</javac>
<copy todir="${classes.main}">
<fileset dir="${src.main}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar.main}" update="false">
<fileset dir="${classes.main}" />
<manifest>
<attribute name="Build-By" value="${user.name}/${java.version}"/>
<attribute name="Build-Date" value="${ISONOW}"/>
<attribute name="Main-Class" value="me.zpath.Main"/>
<attribute name="Implementation-Title" value="${ant.project.name}"/>
<attribute name="Implementation-Version" value="${buildversion}"/>
</manifest>
</jar>
</target>
<target name="javadoc">
<mkdir dir="${docs}"/>
<condition property="javadoc.additionalparam" value="-notimestamp"><matches pattern="^1.8" string="${java.version}"/></condition>
<property name="javadoc.additionalparam" value="-notimestamp --ignore-source-errors"/>
<javadoc destdir="${docs}" access="public" author="false" version="false" windowtitle="${description} ${version}" charset="UTF-8" encoding="UTF-8" docencoding="UTF-8" additionalparam="${javadoc.additionalparam}" use="true" breakiterator="true">
<sourcefiles>
<fileset dir="${src.main}"/>
</sourcefiles>
<doctitle><![CDATA[${description} ${version}]]></doctitle>
<header><![CDATA[${description} ${version}]]></header>
<link href="https://faceless2.github.io/json/docs/"/>
<link href="https://docs.oracle.com/en/java/javase/11/docs/api/"/>
</javadoc>
</target>
<target name="test" depends="build">
<mkdir dir="${classes.test}"/>
<javac encoding="utf-8" debug="true" source="8" target="8" destdir="${classes.test}">
<src path="${src.test}"/>
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xlint:deprecation"/>
<classpath>
<pathelement location="${jar.main}"/>
<path refid="path.build"/>
</classpath>
</javac>
<copy todir="${classes.test}">
<fileset dir="${src.test}">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar.test}" update="false">
<fileset dir="${classes.test}" />
</jar>
<java classname="me.zpath.TestHarness" fork="true">
<arg value="--debug" if:set="debug"/>
<arg value="${debug}" if:set="debug"/>
<jvmarg value="-ea"/>
<classpath>
<pathelement location="${jar.main}"/>
<pathelement location="${jar.test}"/>
<path refid="path.build"/>
</classpath>
</java>
</target>
<target name="default" depends="test,javadoc"></target>
</project>