-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
104 lines (91 loc) · 3.31 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
<!--
Ant build file for SystemProperties
Targets suitable for NetBeans free-form project.
http://ant.apache.org/
-->
<project name="ClassViewer" default="default" basedir=".">
<!-- set global properties for this build -->
<property name="proj" value="ClassViewer"/>
<property name="main" value="ClassViewer"/>
<property name="srcDir" value="."/>
<property name="buildDir" value="build"/>
<property name="distDir" value="."/>
<property name="tempDir" value="temp"/>
<property name="javadocDir" value="javadoc"/>
<property name="jversion" value="1.5"/>
<property name="version" value="1.0.0"/>
<!-- Initialize -->
<target name="init" description="Initialize the build process.">
<!-- Create a time stamp -->
<tstamp/>
</target>
<!-- Compile source files to class files -->
<target name="compile" depends="init" description="Compile the program.">
<mkdir dir="${buildDir}"/>
<javac srcDir="${srcDir}" destDir="${buildDir}"
debug="on" source="${jversion}" target="${jversion}">
</javac>
</target>
<!-- Build jar from classes -->
<target name="build" depends="compile" description="Build a jar file.">
<jar destfile="${distDir}/${proj}.jar">
<manifest>
<attribute name="Main-Class" value="com.jstevh.viewer.${main}"/>
</manifest>
<fileset dir="${buildDir}" includes="**/*.class"/>
<fileset dir="${srcDir}" includes="**/*.xml"/>
</jar>
</target>
<!-- Run the program -->
<target name="run" depends="build" description="Run the program.">
<java jar="${distDir}/${proj}.jar" fork="true"></java>
</target>
<!-- Clean up all build/dist/temp directories -->
<target name="clean" description="Clean the project.">
<delete dir="${buildDir}"/>
<delete dir="${javadocDir}"/>
</target>
<!-- Generate javadoc HTML documentation -->
<target name="doc" depends="compile" description="Generate the javadoc.">
<mkdir dir="${javadocDir}"/>
<mkdir dir="${tempDir}"/>
<copy todir="${tempDir}">
<fileset dir="${srcDir}" includes="**/*.java, **/*.html"/>
</copy>
<javadoc
sourcepath="${tempDir}"
classpath="${buildDir}"
destdir="${javadocDir}"
author="true" version="true"
access="private" use="true"
windowtitle="${proj} v${version} API">
<fileset dir="${tempDir}">
<include name="**/*.java"/>
</fileset>
<doctitle>
<![CDATA[<h2>${proj} v${version} API</h2>]]>
</doctitle>
<bottom>
<![CDATA[<i>Copyright © James Harris, et al. GPL]]>
</bottom>
</javadoc>
<delete dir="${tempDir}"/>
</target>
<!-- NetBeans debug target -->
<target name="debug-nb" depends="compile" description="Debug the program in NetBeans.">
<!-- Run the program -->
<nbjpdastart addressproperty="jpda.address" name="${main}" transport="dt_socket">
<classpath path="${buildDir}"/>
</nbjpdastart>
<java classname="${main}" fork="true">
<classpath path="${buildDir}"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=none"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
</java>
</target>
<!-- Default target -->
<target name="default" depends="clean, build" description="Default clean and build.">
</target>
</project>