-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·127 lines (111 loc) · 3.76 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<project name="rtmidi" default="dist">
<property name="rtmidi.version" value="1.0.10"/>
<property name="rtmidi.jar" value="JRtMidi-${rtmidi.version}.jar"/>
<path id="rtmidi.classpath">
<pathelement location="dist/${rtmidi.jar}"/>
<pathelement location="jtest"/>
<pathelement location="bin"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<mkdir dir="org/rtmidi"/>
<mkdir dir="dist"/>
<mkdir dir="javadoc"/>
</target>
<!-- Generates the JNI wrapper C++ and Java code
on Windows you may need to use Cygwin to run the command 'swig -directors -c++ -java -package org.rtmidi -outdir org/rtmidi JRtMidi.i'
-->
<target name="swig" depends="init">
<exec executable="swig">
<arg line="-directors -c++ -java -package org.rtmidi -outdir org/rtmidi JRtMidi.i"/>
</exec>
<!-- Originally: swig -directors -c++ -java -package org.rtmidi -outdir org/rtmidi JRtMidi.i"/> -->
</target>
<target name="swig-clean">
<delete file="JRtMidi_wrap.cxx"/>
<delete file="JRtMidi_wrap.h"/>
<delete dir="org"/>
</target>
<!-- Builds the library -->
<target name="scons" depends="swig">
<exec executable="scons" vmlauncher="false"/>
</target>
<target name="scons-clean">
<exec executable="scons" vmlauncher="false">
<arg value="-c"/>
</exec>
<delete>
<fileset dir=".">
<include name="*.obj"/>
</fileset>
</delete>
</target>
<!-- Removes Java .class files-->
<target name="clean">
<delete dir="bin"/>
<delete>
<fileset dir="jtest">
<include name="*.class"/>
</fileset>
</delete>
</target>
<!-- Compiles the Java code -->
<target name="compile" depends="init">
<javac destdir="bin" srcdir="org">
<include name="**/*.java"/>
</javac>
</target>
<!-- Creates Javadoc -->
<target name="doc" depends="init">
<javadoc destdir="javadoc" classpathref="rtmidi.classpath">
<fileset dir="org">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
<!-- Deletes the Javadoc -->
<target name="doc-clean">
<delete dir="javadoc"/>
</target>
<!-- Creates a Jar of the Java code and puts it and the library into the 'dist' folder -->
<target name="dist" depends="compile,scons">
<jar destfile="dist/${rtmidi.jar}" basedir="bin">
<fileset dir="bin">
<include name="**/*.class"/>
</fileset>
<fileset dir="org">
<include name="**/*.java"/>
</fileset>
</jar>
<copy todir="dist">
<fileset dir=".">
<!-- copy the library objects to the dist folder as well-->
<include name="*jrtmidi*"/>
<exclude name="*.lib"/>
<exclude name="*.exp"/>
</fileset>
</copy>
</target>
<target name="clean-all" depends="clean,swig-clean,scons-clean,doc-clean"/>
<!-- This is a Linux only test -->
<target name="virtualports" depends="dist">
<javac classpathref="rtmidi.classpath" destdir="jtest" srcdir="jtest">
<include name="*.java"/>
</javac>
<java classpathref="rtmidi.classpath" classname="VirtualPortInOutTest"/>
</target>
<!-- This test is cross platform, and makes sound in windows!-->
<target name="midiout" depends="dist">
<javac classpathref="rtmidi.classpath" destdir="jtest" srcdir="jtest">
<include name="*.java"/>
</javac>
<java classpathref="rtmidi.classpath" classname="MidiOutTest"/>
</target>
<!-- This test is cross platform, and makes sound in windows!-->
<target name="midiin" depends="dist">
<javac classpathref="rtmidi.classpath" destdir="jtest" srcdir="jtest">
<include name="*.java"/>
</javac>
<java classpathref="rtmidi.classpath" classname="MidiInTest"/>
</target>
</project>