forked from hyphanet/plugin-Spider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
121 lines (107 loc) · 4.22 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
<?xml version="1.0"?>
<!-- ant build file for Freenet -->
<project name="Freenet" default="dist" basedir=".">
<property name="freenet-cvs-snapshot.location" location="../fred/build/libs/freenet.jar"/>
<property name="freenet-ext.location" location="../fred/lib/freenet/freenet-ext.jar"/>
<property name="svn.revision" value="@custom@"/>
<property name="source-version" value="1.8"/>
<property name="target-version" value="1.8"/>
<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/Spider/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/Spider/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}" target="${target-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.8">
<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}/Spider.jar" duplicate="fail">
<manifest>
<attribute name="Plugin-Main-Class" value="plugins.Spider.Spider"/>
</manifest>
<fileset dir="src/" casesensitive="no">
<include name="*.txt"/>
</fileset>
<fileset dir="${build}/"/>
</jar>
</target>
<target name="javadoc">
<javadoc destdir="docs">
<link href="http://java.sun.com/j2se/1.5.0/docs/api" />
<link href="../../plugin-Library/docs/" />
<classpath>
<pathelement location="${freenet-ext.location}"/>
<pathelement location="${freenet-cvs-snapshot.location}"/>
</classpath>
<packageset dir="src" defaultexcludes="yes">
<include name="**"/>
</packageset>
</javadoc>
</target>
<!-- ================================================== -->
<target name="clean" description="Delete class files and docs dir.">
<delete dir="${build}"/>
<delete dir="${build-test}"/>
<delete dir="${dist}"/>
</target>
</project>