-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·109 lines (96 loc) · 4.1 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
<project name="rgdcore" default="build" basedir=".">
<property name="svn.head.revision" value="11173"/>
<property name="src.dir" value="src"/>
<property name="build.dir" value="classes"/>
<property name="lib.dir" value="lib"/>
<property name="doc.dir" value="doc"/>
<property name="logs.dir" value="logs"/>
<property name="dist.dir" value="dist"/>
<property name="name" value="rgdcore"/>
<property name="version" value="1.1.3"/>
<path id="master-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<!-- Remove old build files -->
<target name="clean" description="Clean output directories">
<mkdir dir="${build.dir}"/>
<delete>
<fileset dir="${build.dir}" includes="**/*.class"/>
</delete>
<delete file="${lib.dir}/${name}_${version}.jar" failonerror="false"/>
</target>
<!--Prepare for build -->
<target name="prepare" description="Prepare for build">
<mkdir dir="${build.dir}"/>
<mkdir dir="${doc.dir}"/>
<mkdir dir="${lib.dir}"/>
<mkdir dir="${logs.dir}"/>
</target>
<!-- Compile all of our class files -->
<target name="compile" depends="prepare" description="Compile .java files into .class files">
<javac destdir="${build.dir}" target="17" source="17" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="master-classpath"/>
</javac>
</target>
<target name="build" depends="compile" description="Compile main source tree java files and build war file">
<!-- Create jar file with custom MANIFEST.FM -->
<delete file="MANIFEST.FM"/>
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<!-- Convert project class path to string property as required by MANIFEST.FM spec -->
<pathconvert property="mf.classpath" pathsep=" " dirsep="/">
<path refid="master-classpath" />
<chainedmapper>
<flattenmapper />
<globmapper from="*.jar" to="lib/*.jar" />
</chainedmapper>
</pathconvert>
<manifest file="MANIFEST.FM">
<attribute name="Main-Class" value="src.edu.mcw.rgd.dataload.DataLoadingManager"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Class-Path" value="${mf.classpath}"/>
<attribute name="RGD-Svn-Revision" value="${svn.head.revision}"/>
<attribute name="App-Version" value="rgdcore_${version}"/>
</manifest>
<jar destfile="${lib.dir}/${name}_${version}.jar"
manifest="MANIFEST.FM">
<fileset dir="${build.dir}">
</fileset>
</jar>
<delete file="MANIFEST.FM" failonerror="true"/>
</target>
<!-- create distribution directory -->
<target name="dist" depends="build" description="Create distribution directory with files ready for deployment">
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/${lib.dir}"/>
<mkdir dir="${dist.dir}/${logs.dir}"/>
<copy todir="${dist.dir}/${lib.dir}">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
<move todir="${dist.dir}" file="${dist.dir}/${lib.dir}/${name}_${version}.jar"/>
</target>
<target name="clean+dist" depends="clean,dist" description="Clean and then build distribution" >
</target>
<target name="dist+docs" depends="dist" description="Create distribution with documentation" >
<mkdir dir="docs"/>
<javadoc
failonerror="false"
destdir="docs/${name}"
author="true"
version="true"
use="true"
windowtitle="${name}">
<classpath refid="master-classpath"/>
<fileset dir="src" defaultexcludes="yes">
</fileset>
</javadoc>
</target>
</project>