-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
89 lines (78 loc) · 3.32 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
<project name="darep" default="zipdist" basedir=".">
<property name="src" location="src" />
<property name="srcTest" location="test" />
<property name="build" location="bin" />
<property name="dist" location="dist" />
<property name="sdkDist" location="${dist}/sdk" />
<property name="wrapperScript" location="${src}/data-repository" />
<property name="wrapperScriptWindows" location="${src}/data-repository.cmd" />
<property name="README" location="README" />
<property name="distZip" location="data-repository.zip" />
<property name="resources" location="resources" />
<property name="serverDefaultProperties" location="${src}/server-default.properties" />
<property name="pluginJarName" value="data-repository-plugin.jar" />
<property name="pluginHowTo" value="how-to-plugin.txt"/>
<path id="junitLib">
<pathelement location="lib/junit-4.10.jar" />
</path>
<path id="plugin-classpath">
<fileset dir="${sdkDist}">
<include name="*.jar" />
</fileset>
</path>
<target name="clean" description="Deletes build and distribution files">
<delete dir="${build}" />
<delete dir="${dist}" />
<delete file="${distZip}" />
</target>
<target name="init" depends="clean" description="Init">
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<mkdir dir="${dist}/sdk" />
<tstamp />
</target>
<target name="compile" depends="init" description="Compile sources">
<javac srcdir="${src}" destdir="${build}" includeantruntime="false" />
</target>
<target name="makeSDK" depends="compile" description="Generate the data-repository sdk">
<jar jarfile="${sdkDist}/darepLib.jar" basedir="${build}" includes="darep/server/CompletenessChecker.class" />
<copy tofile="${sdkDist}/how-to-plugin.txt" file="${pluginHowTo}" />
<javadoc sourcefiles="src/darep/server/CompletenessChecker.java" destdir="${sdkDist}/doc" />
</target>
<target name="jar" depends="compile" description="Generate JAR">
<jar jarfile="${dist}/${ant.project.name}.jar" basedir="${build}">
<fileset dir="${resources}"/>
<manifest>
<attribute name="Main-Class" value="darep.DarepController"/>
<attribute name="Class-Path" value="data-repository-plugin.jar"/>
</manifest>
</jar>
</target>
<target name="compile-test" depends="compile" description="Compile test sources.">
<javac srcdir="${srcTest}" destdir="${build}" classpathref="junitLib" includeantruntime="false" />
</target>
<target name="test" depends="compile-test" description="Run all tests">
<junit haltonfailure="true">
<classpath refid="junitLib" />
<classpath path="${build}" />
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${srcTest}">
<include name="**/*" />
</fileset>
</batchtest>
</junit>
</target>
<target name="dist" depends="jar, test" description="Creates a complete distribution in folder 'dist'">
<copy tofile="${dist}/data-repository" file="${wrapperScript}" />
<chmod file="${dist}/data-repository" perm="u+x" />
<copy tofile="${dist}/data-repository.cmd" file="${wrapperScriptWindows}" />
<copy tofile="${dist}/README" file="${README}" />
<copy tofile="${dist}/server-default.properties" file="${serverDefaultProperties}" />
</target>
<target name="zipdist" depends="dist" description="Creates a distribution zip-archive">
<zip destfile="${distZip}">
<fileset dir="dist" />
</zip>
</target>
</project>