aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-05-23 11:04:42 +0200
committerSven Gothel <[email protected]>2023-05-23 11:04:42 +0200
commitd845e8c54ad742dd57a303dcf7fafdfb78a12e33 (patch)
tree02433f97c3b37a76e7f621584938683798b58158
parentbaa2c31d9e4b49f72323e38c7d6fc59affaa29bc (diff)
Enable examples in ant build.xml -> jsyn-examples-${dstamp}.jarHEADmasterjoal
-rw-r--r--.gitignore2
-rw-r--r--build.xml32
2 files changed, 31 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index afa19b0..43af119 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,5 +14,7 @@ temp_recording.wav
# Ignore files generated by ant.
buildant/
+buildant-examples/
dist/
+/bin/
diff --git a/build.xml b/build.xml
index 36dcc7d..bd052a5 100644
--- a/build.xml
+++ b/build.xml
@@ -1,21 +1,30 @@
-<project name="JSynProject" default="dist" basedir=".">
+<project name="JSynProject" default="examples" basedir=".">
<description>
Build JSyn Java Synthesizer
</description>
<!-- set global properties for this build -->
+ <tstamp>
+ <format property="dstamp" pattern="yyyyMMdd"/>
+ </tstamp>
+
<property name="src.dir" location="src/main/java"/>
<property name="doc.dir" location="doc"/>
<property name="build.dir" location="buildant"/>
<property name="dist" location="dist"/>
<property name="main-class" value="com.jsyn.apps.AboutJSyn"/>
- <property name="jarname" value="jsyn"/>
+ <property name="jarfile" value="${dist}/lib/jsyn-${dstamp}.jar"/>
<property name="java-version" value="1.8"/>
+ <property name="examples.dir" location="examples/src/main/java"/>
+ <property name="build.examples.dir" location="buildant-examples"/>
+ <property name="examples.jarfile" value="${dist}/lib/jsyn-examples-${dstamp}.jar"/>
+
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the necessary directories. -->
<mkdir dir="${build.dir}"/>
+ <mkdir dir="${build.examples.dir}"/>
<mkdir dir="${doc.dir}"/>
</target>
@@ -39,7 +48,7 @@
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the jsyn-${DSTAMP}.jar file -->
- <jar jarfile="${dist}/lib/${jarname}-${DSTAMP}.jar" basedir="${build.dir}">
+ <jar jarfile="${jarfile}" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
@@ -59,10 +68,27 @@
<echo message = "=================================================================" />
</target>
+ <target name="examples" depends="dist"
+ description="compile the example source " >
+ <javac target="${java-version}" source="${java-version}"
+ srcdir="${examples.dir}" destdir="${build.examples.dir}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath>
+ <pathelement path="${jarfile}"/>
+ <pathelement path="libs/jportaudio.jar"/>
+ <pathelement path="libs/gluegen-rt.jar"/>
+ <pathelement path="libs/joal.jar"/>
+ </classpath>
+ </javac>
+ <jar jarfile="${examples.jarfile}" basedir="${build.examples.dir}">
+ </jar>
+ </target>
+
<target name="clean"
description="clean up" >
<!-- Delete the directories created by ant. -->
<delete dir="${build.dir}"/>
+ <delete dir="${build.examples.dir}"/>
<delete dir="${doc.dir}"/>
<delete dir="${dist}"/>
</target>