11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<project default =" main" name =" high-scale-lib" xmlns : ivy =" antlib:org.apache.ivy.ant" >
33
4- <property name =" ivy.version" value =" 2.2.0" />
5- <property name =" ivy.url"
6- value =" http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
4+ <property name =" ivy.version" value =" 2.2.0" />
5+ <property name =" ivy.url"
6+ value =" http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
77
88 <property file =" publish.properties" />
99
10- <property name =" basedir" value =" ." />
11- <property name =" build.src" value =" ${ basedir } /src" />
12- <property name =" build.src.java" value =" ${ basedir } /src/java" />
13- <property name =" build.dir" value =" ${ basedir } /build" />
14- <property name =" build.dir.lib" value =" ${ build.dir } /lib" />
15- <property name =" build.classes" value =" ${ build.dir } /classes" />
16- <property name =" dist.dir" value =" ${ build.dir } /dist" />
17-
18- <path id =" autoivy.classpath" >
19- <fileset dir =" ${ build.dir.lib } " >
20- <include name =" **/*.jar" />
21- </fileset >
22- <pathelement location =" ${ build.dir } /ivy-${ ivy.version } .jar" />
23- </path >
24-
10+ <property name =" basedir" value =" ." />
11+ <property name =" build.src" value =" ${ basedir } /src" />
12+ <property name =" build.src.java" value =" ${ basedir } /src/main/java" />
13+ <property name =" build.src.test.java" value =" ${ basedir } /src/test/java" />
14+ <property name =" build.dir" value =" ${ basedir } /build" />
15+ <property name =" build.dir.lib" value =" ${ build.dir } /lib" />
16+ <property name =" build.classes" value =" ${ build.dir } /classes" />
17+ <property name =" build.testclasses" value =" ${ build.dir } /test-classes" />
18+ <property name =" dist.dir" value =" ${ build.dir } /dist" />
19+
20+ <path id =" autoivy.classpath" >
21+ <fileset dir =" ${ build.dir.lib } " >
22+ <include name =" **/*.jar" />
23+ </fileset >
24+ <pathelement location =" ${ build.dir } /ivy-${ ivy.version } .jar" />
25+ </path >
26+
27+ <path id =" test.compile.classpath" >
28+ <path refid =" autoivy.classpath" />
29+ <pathelement location =" ${ build.classes } " />
30+ </path >
31+
32+ <path id =" test.classpath" >
33+ <path refid =" test.compile.classpath" />
34+ <pathelement location =" ${ build.classes } " />
35+ <pathelement location =" ${ build.testclasses } " />
36+ </path >
37+
2538 <target name =" init" >
2639 <mkdir dir =" ${ build.dir } " />
2740 <mkdir dir =" ${ build.dir.lib } " />
2841 <mkdir dir =" ${ build.classes } " />
42+ <mkdir dir =" ${ build.testclasses } " />
2943 <mkdir dir =" ${ dist.dir } " />
3044 </target >
3145
32- <target name =" ivy-download" depends =" init" unless =" ivy.jar.exists" >
33- <echo >Downloading Ivy...</echo >
34- <get src =" ${ ivy.url } /${ ivy.version } /ivy-${ ivy.version } .jar"
35- dest =" ${ build.dir.lib } /ivy-${ ivy.version } .jar" usetimestamp =" true" />
36- </target >
37-
38- <target name =" ivy-init" depends =" ivy-download" unless =" ivy.initialized" >
39- <taskdef resource =" org/apache/ivy/ant/antlib.xml"
40- uri =" antlib:org.apache.ivy.ant"
41- classpathref =" autoivy.classpath" />
42- <property name =" ivy.initialized" value =" true" />
43- </target >
46+ <target name =" ivy-download" depends =" init" unless =" ivy.jar.exists" >
47+ <echo >Downloading Ivy...</echo >
48+ <get src =" ${ ivy.url } /${ ivy.version } /ivy-${ ivy.version } .jar"
49+ dest =" ${ build.dir.lib } /ivy-${ ivy.version } .jar" usetimestamp =" true" />
50+ </target >
4451
45- <target name =" ivy-retrieve-build" depends =" ivy-init, resolve" >
46- <ivy : retrieve type =" jar,source" sync =" true"
47- pattern =" ${ build.dir.lib } /[type]s/[artifact]-[revision].[ext]" />
48- </target >
52+ <target name =" ivy-init" depends =" ivy-download" unless =" ivy.initialized" >
53+ <taskdef resource =" org/apache/ivy/ant/antlib.xml"
54+ uri =" antlib:org.apache.ivy.ant"
55+ classpathref =" autoivy.classpath" />
56+ <property name =" ivy.initialized" value =" true" />
57+ </target >
58+
59+ <target name =" ivy-retrieve-build" depends =" ivy-init, resolve" >
60+ <ivy : retrieve type =" jar,source" pattern =" ${ build.dir.lib } /[type]s/[artifact].[ext]" />
61+ </target >
4962
5063 <target name =" resolve" >
5164 <ivy : resolve file =" ivy.xml" revision =" ${ version } " />
5265 </target >
5366
54- <target name =" main" depends =" compile, jar" description =" Main target" >
55- <echo >
56- Building the .jar file.
57- </echo >
58- </target >
59-
60- <target name =" compile" depends =" ivy-retrieve-build" description =" Compilation target" >
61- <javac srcdir =" src" destdir =" ${ build.classes } " />
62- </target >
67+ <target name =" main" depends =" compile, jar" description =" Main target" >
68+ <echo >
69+ Building the .jar file.
70+ </echo >
71+ </target >
72+
73+ <target name =" compile" depends =" ivy-retrieve-build" description =" Compilation target" >
74+ <javac srcdir =" ${ build. src.java } " destdir =" ${ build.classes } " />
75+ </target >
6376
6477 <target name =" gen-pom" depends =" ivy-init" >
65- <ivy : makepom ivyfile =" ivy.xml" pomfile =" ${ dist.dir } /${ ant.project.name } .pom" >
66- <mapping conf =" default" scope =" compile" />
78+ <ivy : makepom ivyfile =" ivy.xml" pomfile =" ${ dist.dir } /${ ant.project.name } .pom" >
79+ <mapping conf =" default" scope =" compile" />
6780 </ivy : makepom >
6881 </target >
6982
7083 <target name =" jar" description =" jar target" depends =" compile" >
71- <jar jarfile =" ${ dist.dir } /high-scale-lib.jar" basedir =" ${ build.classes } " includes =" org/**/*.class" />
84+ <jar jarfile =" ${ dist.dir } /high-scale-lib.jar" basedir =" ${ build.classes } " includes =" org/**/*.class" />
7285 </target >
73-
86+
87+ <target name =" compile-tests" depends =" compile" >
88+ <javac srcdir =" ${ build.src.test.java } " destdir =" ${ build.testclasses } " >
89+ <classpath refid =" test.compile.classpath" />
90+ </javac >
91+ </target >
92+
93+ <target name =" test" depends =" compile-tests" description =" run unit tests" >
94+ <junit >
95+ <classpath refid =" test.classpath" />
96+ <test name =" org.cliffc.high_scale_lib.HighScaleLibTestSuite" />
97+ </junit >
98+ </target >
99+
74100 <target name =" publish" description =" publish jar to artifactory" depends =" jar, gen-pom" >
75- <ivy : publish resolver =" artifactory-publish" overwrite =" true" organisation =" ${ organization } " module =" ${ module } " revision =" ${ version } " >
101+ <ivy : publish resolver =" artifactory-publish" overwrite =" true" organisation =" ${ organization } " module =" ${ module } " revision =" ${ version } " >
76102 <artifacts pattern =" ${ dist.dir } /[artifact].[ext]" />
77-
78- <artifact name =" ${ ivy.module } " ext =" pom" type =" pom" />
103+ <artifact name =" ${ ivy.module } " ext =" pom" type =" pom" />
79104 </ivy : publish >
80105 </target >
81106
82107 <target name =" publish-local" description =" publish jar to the local repo" depends =" jar" >
83- <ivy : publish resolver =" local" overwrite =" true" organisation =" ${ organization } " module =" ${ module } " revision =" ${ version } " >
108+ <ivy : publish resolver =" local" overwrite =" true" organisation =" ${ organization } " module =" ${ module } " revision =" ${ version } " >
84109 <artifacts pattern =" ${ dist.dir } /[artifact].[ext]" />
85110 </ivy : publish >
86111 </target >
87112
88113 <target name =" clean" description =" get rid of any build artifacts" >
89114 <delete dir =" ${ dist.dir } " />
90115 <delete dir =" ${ build.dir } " />
91- <delete dir =" doc" />
116+ <delete dir =" doc" />
92117 </target >
93118
94119 <target name =" javadoc" description =" generate the docs" >
95- <javadoc sourcepath =" src" destdir =" doc" />
120+ <javadoc sourcepath =" src" destdir =" doc" />
96121 </target >
97122</project >
0 commit comments