-
Notifications
You must be signed in to change notification settings - Fork 61
/
build.xml
123 lines (102 loc) · 4.48 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="main" name="high-scale-lib" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="ivy.version" value="2.2.0" />
<property name="ivy.url"
value="http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
<property file="publish.properties"/>
<property name="basedir" value="."/>
<property name="build.src" value="${basedir}/src"/>
<property name="build.src.java" value="${basedir}/src/main/java"/>
<property name="build.src.test.java" value="${basedir}/src/test/java"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.dir.lib" value="${build.dir}/lib"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.testclasses" value="${build.dir}/test-classes"/>
<property name="dist.dir" value="${build.dir}/dist"/>
<path id="autoivy.classpath">
<fileset dir="${build.dir.lib}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${build.dir}/ivy-${ivy.version}.jar"/>
</path>
<path id="test.compile.classpath">
<path refid="autoivy.classpath"/>
<pathelement location="${build.classes}"/>
</path>
<path id="test.classpath">
<path refid="test.compile.classpath"/>
<pathelement location="${build.classes}"/>
<pathelement location="${build.testclasses}"/>
</path>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir.lib}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.testclasses}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="ivy-download" depends="init" unless="ivy.jar.exists">
<echo>Downloading Ivy...</echo>
<get src="${ivy.url}/${ivy.version}/ivy-${ivy.version}.jar"
dest="${build.dir.lib}/ivy-${ivy.version}.jar" usetimestamp="true" />
</target>
<target name="ivy-init" depends="ivy-download" unless="ivy.initialized">
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
classpathref="autoivy.classpath"/>
<property name="ivy.initialized" value="true"/>
</target>
<target name="ivy-retrieve-build" depends="ivy-init, resolve">
<ivy:retrieve type="jar" pattern="${build.dir.lib}/[type]s/[artifact].[ext]"/>
</target>
<target name="resolve">
<ivy:resolve file="ivy.xml" revision="${version}"/>
</target>
<target name="main" depends="compile, jar" description="Main target">
<echo>
Building the .jar file.
</echo>
</target>
<target name="compile" depends="ivy-retrieve-build" description="Compilation target">
<javac srcdir="${build.src.java}" destdir="${build.classes}" debug="true"/>
</target>
<target name="gen-pom" depends="ivy-init">
<ivy:makepom ivyfile="ivy.xml" pomfile="${dist.dir}/${ant.project.name}.pom">
<mapping conf="default" scope="compile"/>
</ivy:makepom>
</target>
<target name="jar" description="jar target" depends="compile">
<jar jarfile="${dist.dir}/high-scale-lib.jar" basedir="${build.classes}" includes="org/**/*.class" />
</target>
<target name="compile-tests" depends="compile">
<javac srcdir="${build.src.test.java}" destdir="${build.testclasses}">
<classpath refid="test.compile.classpath"/>
</javac>
</target>
<target name="test" depends="compile-tests" description="run unit tests">
<junit haltonfailure="true" printsummary="yes">
<classpath refid="test.classpath"/>
<formatter type="plain" usefile="false"/>
<test name="org.cliffc.high_scale_lib.HighScaleLibTestSuite"/>
</junit>
</target>
<target name="publish" description="publish jar to artifactory" depends="jar, gen-pom">
<ivy:publish resolver="artifactory-publish" overwrite="true" organisation="${organization}" module="${module}" revision="${version}">
<artifacts pattern="${dist.dir}/[artifact].[ext]"/>
<artifact name="${ivy.module}" ext="pom" type="pom"/>
</ivy:publish>
</target>
<target name="publish-local" description="publish jar to the local repo" depends="jar">
<ivy:publish resolver="local" overwrite="true" organisation="${organization}" module="${module}" revision="${version}">
<artifacts pattern="${dist.dir}/[artifact].[ext]"/>
</ivy:publish>
</target>
<target name="clean" description="get rid of any build artifacts">
<delete dir="${dist.dir}" />
<delete dir="${build.dir}" />
<delete dir="doc"/>
</target>
<target name="javadoc" description="generate the docs">
<javadoc sourcepath="src" destdir="doc"/>
</target>
</project>