-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.xml
86 lines (72 loc) · 2.45 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="pocketsphinx-android" default="jar">
<property file="build.properties"/>
<property name="build.vsn" value="0.8"/>
<property name="build.name" value="${ant.project.name}-${build.vsn}"/>
<property name="build.njobs" value="1" />
<target name="clean">
<delete>
<fileset dir="jni" includes="**/*.c"/>
</delete>
<delete dir="build"/>
<delete dir="gen"/>
<delete dir="lib"/>
<delete dir="obj"/>
</target>
<target name="compile" depends="swig">
<mkdir dir="build/classes"/>
<javac
source="1.6"
target="1.6"
deprecation="true"
destdir="build/classes"
includeAntRuntime="false"
classpath="${sdk.dir}/platforms/android-${sdk.vsn}/android.jar">
<compilerarg value="-Xlint:-options"/>
<src path="gen"/>
<src path="src"/>
</javac>
</target>
<target name="swig">
<mkdir dir="gen/edu/cmu/pocketsphinx"/>
<parallel threadCount="${build.njobs}">
<exec executable="swig" failonerror="true">
<arg line="-I../sphinxbase/include -I../sphinxbase/swig"/>
<arg line="-java -package edu.cmu.pocketsphinx"/>
<arg line="-outdir gen/edu/cmu/pocketsphinx/ -o jni/sphinxbase_wrap.c"/>
<arg line="../sphinxbase/swig/sphinxbase.i"/>
</exec>
<exec executable="swig" failonerror="true">
<arg line="-I../sphinxbase/swig"/>
<arg line="-I../pocketsphinx/include -I../pocketsphinx/swig"/>
<arg line="-java -package edu.cmu.pocketsphinx"/>
<arg line="-outdir gen/edu/cmu/pocketsphinx/"/>
<arg line="-o jni/pocketsphinx_wrap.c"/>
<arg line="../pocketsphinx/swig/pocketsphinx.i"/>
</exec>
</parallel>
</target>
<target name="jni" depends="swig">
<exec executable="${ndk.dir}/ndk-build" failonerror="true">
<env key="NDK_LIBS_OUT" value="lib"/>
<arg line="-j ${build.njobs}"/>
</exec>
</target>
<target name="jar" depends="compile,jni">
<jar destfile="build/${build.name}-src.jar">
<fileset dir="gen" includes="**/*.java"/>
<fileset dir="src" includes="**/*.java"/>
</jar>
<jar
basedir="build/classes"
destfile="build/${build.name}-nolib.jar"/>
<copy
file="build/${build.name}-nolib.jar"
tofile="build/${build.name}.jar"/>
<jar
update="true"
destfile="build/${build.name}.jar">
<fileset dir="." includes="lib/**"/>
</jar>
</target>
</project>