forked from ontologyportal/SigmaUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
128 lines (111 loc) · 4.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
<project xmlns:ivy="antlib:org.apache.ivy.ant"
name="SigmaUtils" default="all" basedir=".">
<property name="ivy.install.version" value="2.5.1"/>
<property name="ivy.home" value="${basedir}/.ivy"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<target name="check.for.ivy.jar">
<available file="${ivy.jar.file}" property="ivy.present"/>
</target>
<target name="download-ivy" depends="check.for.ivy.jar" unless="ivy.present">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="https://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>
<property name="app.name" value="sigmaUtils"/>
<property name="build.home" value="build"/>
<property name="build.classes" value="${build.home}/classes"/>
<property name="build.test.classes" value="${build.home}/test-classes"/>
<!--<property name="build.lib" value="${build.home}/lib"/>-->
<property environment="env"/>
<property name="javac.release" value="11"/>
<target name="init" depends="init-ivy">
<echo>Java Version via Ant: ${ant.java.version}</echo>
<echo>Java Version System Prop: ${java.version}</echo>
<ivy:retrieve/>
</target>
<target name="compile" depends="init" description="Compile the project and place in ${build.classes}.">
<mkdir dir="${build.classes}"/>
<javac destdir="${build.classes}"
debug="on"
optimize="on"
deprecation="on"
includeantruntime="false"
classpathref="compile.classpath"
release="${javac.release}">
<src refid="core.sourcepath"/>
</javac>
<!-- <copy todir="${build.lib}">
<fileset dir="${basedir}/lib"/>
</copy>-->
</target>
<path id="core.sourcepath">
<pathelement path="src/java"/>
</path>
<path id="compile.classpath">
<fileset dir="${basedir}/lib">
<include name="*.jar"/>
</fileset>
</path>
<path id="test.sourcepath">
<pathelement path="test/unit/java"/>
</path>
<path id="classpath.test">
<pathelement location="lib/junit-4.13.2.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
<pathelement location="${build.classes}"/>
</path>
<target name="test-compile" depends="compile">
<mkdir dir="${build.test.classes}"/>
<javac destdir="${build.test.classes}" includeantruntime="false">
<src refid="test.sourcepath"/>
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="test-compile">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${build.test.classes}"/>
</classpath>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="test/unit/java" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
<!-- target name="all" depends="dist, api_doc" -->
<target name="all" depends="clean,test">
<jar destfile="${basedir}/sigmaUtils.jar">
<fileset dir="${build.classes}"/>
</jar>
<tstamp>
<format property="TODAY_US" pattern="yyyy-MM-dd HH:mm:ss:sss zzz" locale="en,US"/>
</tstamp>
<echo>the system date/time is ${TODAY_US}</echo>
</target>
<target name="clean" description="Delete old build, lib contents">
<!-- avoid problems with package name changes by deleting everything -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${build.home}"/>
</delete>
<delete includeemptydirs="true" failonerror="false"> <!-- keep local ivy lib up to date -->
<fileset dir="${basedir}/lib"> <!-- keep ./lib -->
<include name="*.jar"/>
</fileset>
</delete>
<delete file="${app.name}.jar"/>
</target>
</project>