aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Burk <[email protected]>2016-03-23 08:27:20 -0700
committerPhil Burk <[email protected]>2016-03-23 08:27:20 -0700
commit8b705f45ff6618383c2df8d7bd14bd2b61e21cee (patch)
treec416ef249bc7818fb68b03e02405da25cb975f4d
parent431965f53739b2ed9608510781bfc7b9d3b4b0e2 (diff)
Add a doc target to the Ant build script.
You can now generate Javadocs by entering: ant doc
-rw-r--r--.gitignore3
-rw-r--r--build.xml25
2 files changed, 19 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 9fe945e..7a727e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
-# ignore Eclipse BUild files
+# ignore Eclipse and Ant generated directories
/build/
/bin/
/dist/
+/doc/
diff --git a/build.xml b/build.xml
index 105f75c..5aff9d5 100644
--- a/build.xml
+++ b/build.xml
@@ -3,8 +3,9 @@
Build JSyn Java Synthesizer
</description>
<!-- set global properties for this build -->
- <property name="src" location="src"/>
- <property name="build" location="build"/>
+ <property name="src.dir" location="src"/>
+ <property name="doc.dir" location="doc"/>
+ <property name="build.dir" location="build"/>
<property name="dist" location="dist"/>
<property name="main-class" value="com.jsyn.apps.AboutJSyn"/>
<property name="jarname" value="jsyn"/>
@@ -13,14 +14,16 @@
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
- <!-- Create the build directory structure used by compile -->
- <mkdir dir="${build}"/>
+ <!-- Create the necessary directories. -->
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${doc.dir}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
- <javac target="${java-version}" source="${java-version}" srcdir="${src}" destdir="${build}">
+ <javac target="${java-version}" source="${java-version}"
+ srcdir="${src.dir}" destdir="${build.dir}">
<classpath>
<pathelement path="libs/jportaudio.jar"/>
</classpath>
@@ -33,17 +36,23 @@
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the jsyn-${DSTAMP}.jar file -->
- <jar jarfile="${dist}/lib/${jarname}-${DSTAMP}.jar" basedir="${build}">
+ <jar jarfile="${dist}/lib/${jarname}-${DSTAMP}.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
+ <!-- Generate javadocs for current project into ${doc.dir} -->
+ <target name="doc" depends="init" description="generate documentation">
+ <javadoc sourcepath="${src.dir}" destdir="${doc.dir}"/>
+ </target>
+
<target name="clean"
description="clean up" >
- <!-- Delete the ${build} and ${dist} directory trees -->
- <delete dir="${build}"/>
+ <!-- Delete the directories created by ant. -->
+ <delete dir="${build.dir}"/>
+ <delete dir="${doc.dir}"/>
<delete dir="${dist}"/>
</target>
</project>