| 1 | <?xml version="1.0" encoding="ISO-8859-1" ?> |
|---|
| 2 | <project name="SpeechRecorder" default="package" basedir="."> |
|---|
| 3 | <description>VoxForge Speech Recorder (postlet)</description> |
|---|
| 4 | |
|---|
| 5 | <!-- set global properties for this build --> |
|---|
| 6 | <property name="root" location="."/> |
|---|
| 7 | <property name="src" location="src"/> |
|---|
| 8 | <property name="src.java" location="${src}"/> |
|---|
| 9 | <property name="build" location="build"/> |
|---|
| 10 | <property name="build.java" location="${build}"/> |
|---|
| 11 | <property name="include" location="include"/> |
|---|
| 12 | <property name="dist" location="dist"/> |
|---|
| 13 | <!-- <property name="temp" location="temp"/> --> |
|---|
| 14 | <property name="lib" location="lib"/> |
|---|
| 15 | <property name="log" location="log"/> |
|---|
| 16 | <property name="doc" location="doc"/> |
|---|
| 17 | |
|---|
| 18 | <property name="version" value="0.1"/> |
|---|
| 19 | |
|---|
| 20 | <!-- "dev" mode options - I recommend that developers modify these |
|---|
| 21 | on the command line by specifying "-Doptimize=off -Ddebug=on" when |
|---|
| 22 | running ant. Levae them at their defaults when producing files |
|---|
| 23 | for real-life use/distribution. --> |
|---|
| 24 | <property name="optimize" value="on"/> |
|---|
| 25 | <property name="debug" value="off"/> |
|---|
| 26 | |
|---|
| 27 | <target name="init" description="Initialise ant" depends="clean"> |
|---|
| 28 | <tstamp> |
|---|
| 29 | <format property="NOW" pattern="dd/MM/yyyy HH:mm" locale="en"/> |
|---|
| 30 | </tstamp> |
|---|
| 31 | <!-- <mkdir dir="${temp}"/> --> |
|---|
| 32 | <mkdir dir="${dist}"/> |
|---|
| 33 | <mkdir dir="${build}"/> |
|---|
| 34 | <mkdir dir="${build.java}"/> |
|---|
| 35 | </target> |
|---|
| 36 | |
|---|
| 37 | <target name="compile" depends="init" |
|---|
| 38 | description="Compile VoxForge Speech" > |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | <!-- Compiles both the recorder and the playback code. |
|---|
| 42 | Separation happens at the bundling stage... --> |
|---|
| 43 | |
|---|
| 44 | <javac srcdir="${src.java}" destdir="${build.java}" |
|---|
| 45 | optimize="${optimize}" |
|---|
| 46 | debug="${debug}" |
|---|
| 47 | source="1.4" |
|---|
| 48 | target="1.4" |
|---|
| 49 | > |
|---|
| 50 | <include name="speechrecorder/*.java"/> |
|---|
| 51 | <include name="org/xiph/speex/*.java"/> |
|---|
| 52 | <include name="org/xiph/speex/spi/*.java"/> |
|---|
| 53 | </javac> |
|---|
| 54 | </target> |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | <target name="package" depends="compile"> |
|---|
| 60 | |
|---|
| 61 | <!-- Before release, a more restricted set of files to include in each JAR should be specified --> |
|---|
| 62 | |
|---|
| 63 | <jar jarfile="${dist}/speechrecorder.jar"> |
|---|
| 64 | <fileset dir="${build.java}"> |
|---|
| 65 | <include name="**/*.class"/> |
|---|
| 66 | <exclude name="**/Test*"/> |
|---|
| 67 | <exclude name="**/ant/**"/> |
|---|
| 68 | <!-- <exclude name="**/player/**"/> --> |
|---|
| 69 | </fileset> |
|---|
| 70 | <metainf dir="${include}/metainf/"/> |
|---|
| 71 | <manifest> |
|---|
| 72 | <section name="build"> |
|---|
| 73 | <attribute name="Build-Date" value="${NOW}"/> |
|---|
| 74 | <attribute name="Built-By" value="${user.name}"/> |
|---|
| 75 | <attribute name="Built-With" value="${os.name} ${os.version} ${os.arch}"/> |
|---|
| 76 | </section> |
|---|
| 77 | <attribute name="Main-Class" value="speechrecorder.RecorderApplet"/> |
|---|
| 78 | </manifest> |
|---|
| 79 | </jar> |
|---|
| 80 | |
|---|
| 81 | <jar jarfile="${dist}/speechrecorder.jar"> |
|---|
| 82 | <fileset dir="${build.java}"> |
|---|
| 83 | <include name="**/*.class"/> |
|---|
| 84 | <exclude name="**/Test*"/> |
|---|
| 85 | <exclude name="**/ant/**"/> |
|---|
| 86 | <exclude name="net/sf/postlet/**"/> |
|---|
| 87 | <exclude name="netscape/**"/> |
|---|
| 88 | <!-- |
|---|
| 89 | |
|---|
| 90 | Don't do any excluding until the playback works... just to be sure... |
|---|
| 91 | |
|---|
| 92 | <exclude name="moodlespeex/CapturePlayback*.class"/> |
|---|
| 93 | <exclude name="moodlespeex/MoodleSpeexRecorder*.class"/> |
|---|
| 94 | <exclude name="moodlespeex/JSpeexEnc*.class"/> |
|---|
| 95 | <exclude name="org/xiph/speex/*Writer.class"/> |
|---|
| 96 | <exclude name="org/xiph/speex/*Encoder.class"/> |
|---|
| 97 | --> |
|---|
| 98 | |
|---|
| 99 | </fileset> |
|---|
| 100 | <metainf dir="${include}/metainf/"/> |
|---|
| 101 | <manifest> |
|---|
| 102 | <section name="build"> |
|---|
| 103 | <attribute name="Build-Date" value="${NOW}"/> |
|---|
| 104 | <attribute name="Built-By" value="${user.name}"/> |
|---|
| 105 | <attribute name="Built-With" value="${os.name} ${os.version} ${os.arch}"/> |
|---|
| 106 | </section> |
|---|
| 107 | <attribute name="Main-Class" value="speechrecorder.PlayerApplet"/> |
|---|
| 108 | </manifest> |
|---|
| 109 | </jar> |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | </target> |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | <target name="clean" description="Clean up" > |
|---|
| 118 | <delete dir="${build}"/> |
|---|
| 119 | <!-- <delete dir="${temp}"/> --> |
|---|
| 120 | </target> |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | </project> |
|---|