-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·108 lines (108 loc) · 3.89 KB
/
build.xml
File metadata and controls
executable file
·108 lines (108 loc) · 3.89 KB
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
<project default="all" name="genetic">
<property name="obj-dir" location="obj"/>
<property name="inc-dir" location="include"/>
<property name="lib-dir" location="lib"/>
<property name="src-dir" location="src"/>
<property name="project" value="algodesigner-genetic"/>
<property name="version" value="0.0.2"/>
<property name="jarname" value="${project}-${version}.jar"/>
<property name="tst-dir" location="tst" />
<property name="runclass" value="com.algodesigner.genetic.test.EvolutionTest"/>
<target name="init">
<mkdir dir="${obj-dir}"/>
<mkdir dir="${lib-dir}"/>
</target>
<target name="clean-init">
<delete dir="${obj-dir}"/>
<delete dir="${lib-dir}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src-dir}:${tst-dir}" destdir="${obj-dir}">
<classpath>
<pathelement path="${inc-dir}"/>
<fileset dir="${inc-dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
<copy todir="${obj-dir}">
<fileset dir="${src-dir}" includes="resource/**/*"/>
</copy>
<copy todir="${lib-dir}">
<fileset dir="${inc-dir}" includes="**/*"/>
</copy>
</target>
<target name="clean-compile">
<delete>
<fileset dir="${obj-dir}" includes="**/*.class"/>
</delete>
</target>
<target name="test" depends="compile" description="Run unit tests">
<junit printsummary="true" haltonfailure="true">
<formatter type="brief" usefile="false"/>
<classpath>
<pathelement path="${obj-dir}"/>
<pathelement path="${inc-dir}"/>
<fileset dir="${inc-dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<batchtest>
<fileset dir="${obj-dir}" includes="**/*Test.class"/>
<fileset dir="${obj-dir}" includes="**/*Tester.class"/>
</batchtest>
</junit>
</target>
<target name="jar" depends="test">
<jar destfile="${lib-dir}/${jarname}" basedir="${obj-dir}"/>
</target>
<target name="clean-jar">
<delete file="${lib-dir}/${jarname}"/>
</target>
<target name="run" depends="jar">
<java classname="${runclass}" fork="true">
<classpath>
<pathelement path="${lib-dir}"/>
<fileset dir="${lib-dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</java>
</target>
<target name="javadoc" depends="jar">
<javadoc sourcepath="${src-dir}" destdir="${obj-dir}/javadoc">
<classpath>
<pathelement path="${inc-dir}"/>
<fileset dir="${inc-dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
<target name="javadoc-jar" depends="javadoc">
<jar destfile="${lib-dir}/${project}-${version}-javadoc.jar" basedir="${obj-dir}/javadoc">
<fileset dir="${obj-dir}/javadoc">
<include name="**/*"/>
</fileset>
</jar>
</target>
<target name="sources-jar" depends="javadoc-jar">
<jar destfile="${lib-dir}/${project}-${version}-sources.jar" basedir="${src-dir}">
<fileset dir="${src-dir}">
<include name="**/*.java"/>
</fileset>
</jar>
</target>
<target name="copy-pom-to-lib" depends="sources-jar">
<mkdir dir="lib"/>
<copy file="pom.xml"
tofile="${lib-dir}/${project}-${version}.pom"/>
<!-- Replace the version in the copied pom.xml -->
<replaceregexp file="${lib-dir}/${project}-${version}.pom"
match="(<version>)[^<]*(</version>)"
replace="\1${version}\2"
byline="true"/>
</target>
<target name="all" depends="copy-pom-to-lib"/>
<target name="clean" depends="clean-init"/>
</project>