-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
105 lines (93 loc) · 3.7 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
<?xml version="1.0"?>
<!-- ant build file for Freenet -->
<project name="Freenet" default="dist" basedir=".">
<property name="freenet-cvs-snapshot.location" location="../freenet.jar"/>
<property name="freenet-ext.location" location="../freenet-ext.jar"/>
<property name="svn.revision" value="@custom@"/>
<property name="source-version" value="1.5"/>
<property name="build" location="build/"/>
<property name="build-test" location="build-test/"/>
<property name="dist" location="dist/"/>
<property name="junit.location" value="/usr/share/java/junit.jar"/>
<available file="src/plugins/FLIRCP/Version.java" property="version.present"/>
<available file="${junit.location}" property="junit.present"/>
<target name="mkdir">
<mkdir dir="${build}"/>
<mkdir dir="${build-test}"/>
<mkdir dir="${dist}"/>
<echo message="Using ${freenet-cvs-snapshot.location} as freenet-cvs-snapshot.jar"/>
<echo message="Using ${freenet-ext.location} as freenet-ext.jar"/>
</target>
<target name="setver" if="version.present">
<!-- Update the Version file -->
<replace file="src/plugins/FLIRCP/Version.java">
<replacefilter token="@custom@" value="${svn.revision}"/>
</replace>
</target>
<!-- ================================================== -->
<target name="compile" depends="mkdir,setver" >
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<!-- FIXME: remove the debug and replace with optimize -->
<javac srcdir="src/" destdir="${build}" debug="on" optimize="on" source="${source-version}">
<classpath>
<pathelement location="${freenet-ext.location}"/>
<pathelement location="${freenet-cvs-snapshot.location}"/>
</classpath>
<include name="**/*.java"/>
<exclude name="**/*Test.java"/>
</javac>
</target>
<!-- ================================================== -->
<target name="unit-build" depends="compile" if="junit.present" unless="skip_tests">
<javac srcdir="src/" destdir="${build-test}" debug="on" optimize="on" source="1.5">
<classpath>
<pathelement path="${build}"/>
<pathelement location="${freenet-ext.location}"/>
<pathelement location="${freenet-cvs-snapshot.location}"/>
<pathelement location="${junit.location}"/>
</classpath>
<compilerarg value="-Xlint"/>
<include name="**/*Test.java"/>
</javac>
</target>
<target name="junit" depends="unit-build" if="junit.present" unless="skip_tests">
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<classpath>
<pathelement path="${build}"/>
<pathelement path="${build-test}"/>
<pathelement location="${freenet-ext.location}"/>
<pathelement location="${freenet-cvs-snapshot.location}"/>
<pathelement location="${junit.location}"/>
</classpath>
<formatter type="plain" usefile="false"/>
<batchtest fork="yes">
<fileset dir="${build-test}">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
<sysproperty key="benchmark" value="${benchmark}" />
<sysproperty key="extensiveTesting" value="${extensiveTesting}" />
</junit>
</target>
<!-- ================================================== -->
<target name="dist" depends="clean,compile,junit"
description="generate the distribution" >
<jar jarfile="${dist}/FLIRCP.jar" duplicate="fail">
<manifest>
<attribute name="Plugin-Main-Class" value="plugins.FLIRCP.FLIRCP"/>
</manifest>
<fileset dir="src/" casesensitive="no">
<include name="*.txt"/>
</fileset>
<fileset dir="${build}/"/>
</jar>
</target>
<!-- ================================================== -->
<target name="clean" description="Delete class files and docs dir.">
<delete dir="${build}"/>
<delete dir="${build-test}"/>
<delete dir="${dist}"/>
</target>
</project>