-
Notifications
You must be signed in to change notification settings - Fork 227
/
build.xml
125 lines (104 loc) · 4.96 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
<!-- Ant makefile for ImageJ -->
<project name="ImageJ" default="run">
<property name="build.dir" value="build" />
<property name="jarfile" value="ij.jar" />
<property name="javadoc.dir" value="../api" />
<property name="repository" value="https://maven.scijava.org/content/groups/public" />
<property name="src-tests.dir" value="tests" />
<property name="build-tests.dir" value="${build.dir}/tests" />
<property name="build-tests-lib.dir" value="${build.dir}/tests/lib" />
<target name="compile" description="Compile the source code.">
<!-- First, ensure the build directory exists. -->
<mkdir dir="${build.dir}" />
<!-- Build everything; add debug="on" to debug -->
<javac srcdir="./ij" destdir="${build.dir}" optimize="on" source="1.6" target="1.6" debug="on" includeantruntime="false" encoding="utf-8">
</javac>
</target>
<target name="build" depends="compile" description="Build ij.jar.">
<!-- Copy needed files into the build directory. -->
<copy file="IJ_Props.txt" todir="${build.dir}" />
<copy file="images/microscope.gif" tofile="${build.dir}/microscope.gif" />
<copy file="images/about.jpg" tofile="${build.dir}/about.jpg" />
<copy file="plugins/MacAdapter.class" tofile="${build.dir}/ij/plugin/MacAdapter.class" />
<copy file="plugins/MacAdapter9.class" tofile="${build.dir}/ij/plugin/MacAdapter9.class" />
<copy todir="${build.dir}/macros"><fileset dir="macros"/></copy>
<!-- Build ij.jar. -->
<jar jarfile="${jarfile}" basedir="${build.dir}"
manifest="MANIFEST.MF"
excludes="${src-tests.dir}" />
</target>
<target name="clean" description="Delete the build files.">
<delete dir="${build.dir}" />
<delete file="${jarfile}" />
</target>
<target name="run" depends="build" description="Build and run ImageJ.">
<copy file="${jarfile}" toDir=".." />
<java maxmemory="640m" jar="${jarfile}" fork="yes" />
</target>
<target name="run2" depends="build" description="Build and run ImageJ.">
<!-- Run in ImageJ directory -->
<copy file="${jarfile}" toDir=".." />
<java maxmemory="640m" dir=".." jar="${jarfile}" fork="yes" />
</target>
<target name="zip" depends="clean" description="Build zrc.zip.">
<zip zipfile="../src.zip"
basedir=".."
includes="source/**"
excludes="source/.gdb_history source/.FBCIndex source/.FBCLockFolder/**"
/>
</target>
<target name="javadocs" description="Build the JavaDocs.">
<delete dir="${javadoc.dir}" />
<mkdir dir="${javadoc.dir}" />
<javadoc
sourcepath="."
encoding="utf-8"
packagenames="ij.*"
destdir="${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="ImageJ API">
</javadoc>
</target>
<target name="compile-tests" depends="compile" description="Compile the unit tests.">
<!-- First, ensure needed build directories exist. -->
<mkdir dir="${build-tests.dir}" />
<mkdir dir="${build-tests-lib.dir}" />
<!-- Download dependencies needed for the unit tests. -->
<get src="${repository}/junit/junit/4.13.2/junit-4.13.2.jar"
dest="${build-tests-lib.dir}" skipexisting="true" />
<get src="${repository}/org/hamcrest/hamcrest/2.2/hamcrest-2.2.jar"
dest="${build-tests-lib.dir}" skipexisting="true" />
<get src="${repository}/ome/formats-api/6.9.0/formats-api-6.9.0.jar"
dest="${build-tests-lib.dir}" skipexisting="true" />
<get src="${repository}/ome/formats-bsd/6.9.0/formats-bsd-6.9.0.jar"
dest="${build-tests-lib.dir}" skipexisting="true" />
<!-- Build the unit tests in debug mode. -->
<path id="compile-tests.classpath">
<pathelement location="${build.dir}" />
<fileset dir="${build-tests-lib.dir}" includes="*.jar" />
</path>
<javac srcdir="${src-tests.dir}" destdir="${build-tests.dir}" classpathref="compile-tests.classpath"
optimize="on" source="1.8" target="1.8" debug="on" includeantruntime="false" encoding="utf-8"
excludes="data/**" />
</target>
<target name="run-tests" depends="compile-tests" description="Run the unit tests.">
<path id="run-tests.classpath">
<pathelement location="${build.dir}" />
<pathelement location="${build-tests.dir}" />
<fileset dir="${build-tests-lib.dir}" includes="*.jar" />
</path>
<!-- Construct a list of test classes to run. -->
<path id="test-files">
<fileset dir="${src-tests.dir}" includes="**/*Test.java" />
</path>
<pathconvert dirsep="." pathsep=" " property="test-classes" refid="test-files">
<regexpmapper from="^.*/tests/(.*)\.java$$" to="\1" />
</pathconvert>
<!-- Run all the test classes. -->
<java classname="org.junit.runner.JUnitCore" classpathref="run-tests.classpath" fork="yes">
<arg line="${test-classes}" />
</java>
</target>
</project>