-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
97 lines (84 loc) · 3.54 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="xnatfs" basedir="." default="all">
<property name="src.dir" value="Source"/>
<property name="classes.dir" value="Class"/>
<property name="doc.dir" value="Documentation"/>
<property name="dist.dir" value="${java.io.tmpdir}/${user.name}/xnatfs"/>
<property name="major" value="0"/>
<property name="minor" value="1"/>
<property name="patch" value="0"/>
<property name="version" value="${major}.${minor}.${patch}"/>
<!-- Figure out how to call ant recursively -->
<condition property="AntCommand" value="${ant.home}/bin/ant.bat">
<os family="windows"/>
</condition>
<condition property="AntCommand" value="${ant.home}/bin/ant">
<not>
<os family="windows"/>
</not>
</condition>
<!-- Access environment variables -->
<property environment="env"/>
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${classes.dir}"/>
</path>
<target name="all" description="Build the source" depends="compile"/>
<target name="clean" description="Delete all generated files">
<delete dir="${classes.dir}" failonerror="false"/>
</target>
<target name="compile" description="Compiles the Task">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="on" excludes="Test/**" deprecation="true" target="1.5">
<compilerarg compiler="javac1.5" value="-Xlint:unchecked"/>
<classpath refid="classpath"/>
</javac>
</target>
<!-- Javadoc runs in a seperate JVM, so the proxy settings are
ignored. Prefetch the package-list for the external packages that
Dart uses and make them availible to the "doc" task below -->
<target name="doc">
<mkdir dir="${doc.dir}/api"/>
<javadoc destdir="${doc.dir}/api">
<classpath refid="classpath"/>
<fileset dir="${src.dir}"/>
<link href="http://java.sun.com/j2se/1.5/docs/api/" offline="true" packagelistLoc="${doc.dir}/PackageList/Java"/>
</javadoc>
</target>
<!-- Very cool! Build/update the jar file from all the libraries -->
<target name="jar" depends="compile">
<delete file="xnatfs.jar"/>
<jar compress="true" destfile="xnatfs.jar" update="false" duplicate="preserve" index="true">
<fileset dir="${classes.dir}">
<include name="**"/>
</fileset>
<zipgroupfileset dir="lib">
<include name="**/*.jar"/>
</zipgroupfileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.xnat.xnatfs.xnatfs"/>
<section name="common">
<attribute name="Specification-Title" value="xnatfs"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="BIRN"/>
<attribute name="Implementation-Title" value="xnatfs"/>
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
<attribute name="Implementation-Vendor" value="BIRN"/>
</section>
</manifest>
</jar>
</target>
<!-- Build a binary distribution -->
<target name="dist" depends="jar">
<delete dir="${dist.dir}" failonerror="false"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/xnatfs-${version}"/>
<tar destfile="xnatfs-${version}.tar" basedir="${dist.dir}/"/>
<gzip zipfile="xnatfs-${version}.tar.gz" src="xnatfs-${version}.tar"/>
<delete file="xnatfs-${version}.tar"/>
<zip destfile="xnatfs-${version}.zip" basedir="${dist.dir}"/>
</target>
</project>