-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
115 lines (101 loc) · 4.13 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
<!--
This file is part of the sigrok-androidutils project.
Copyright (C) 2014 Marcus Comstedt <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<project>
<property name="android.abi" value="armeabi"/>
<target name="utils" >
<mkdir dir="build"/>
<javac srcdir="src" destdir="build" includeantruntime="no"
classpath="${android.sdk}/platforms/${android.platform}/android.jar"/>
<jar destfile="sigrok-androidutils.jar">
<fileset dir="build" />
</jar>
</target>
<target name="anttasks" >
<mkdir dir="ant/build"/>
<javac srcdir="ant/src" destdir="ant/build" includeantruntime="yes"/>
<jar destfile="ant/sigrok-androidutils-anttasks.jar">
<fileset dir="ant/build" />
<fileset dir="ant/resources"/>
</jar>
</target>
<target name="-declare-anttasks">
<taskdef resource="anttasks.properties"
classpath="ant/sigrok-androidutils-anttasks.jar"/>
</target>
<target name="aar" depends="-declare-anttasks">
<copylibs todir="jni/${android.abi}" property="bundled_libs" rpath-link="${prefix}/lib">
<fileset file="${prefix}/lib/jni/libsigrok_java_core_classes.so" />
<exclude name="libc.so"/>
<exclude name="libm.so"/>
<exclude name="libdl.so"/>
<exclude name="liblog.so"/>
<exclude name="libstdc++.so"/>
<exclude name="libz.so"/>
</copylibs>
<copy file=".libs/libsigrokandroidutils.so" todir="jni/${android.abi}" />
<mkdir dir="aidl" />
<loadresource property="bindings.versioncode">
<propertyresource name="bindings.version" />
<filterchain>
<tokenfilter>
<filetokenizer />
<replaceregex pattern="[0-9]+" replace="0000\0" flags="g" />
<replaceregex pattern="0*([0-9]{3})\.?" replace="\1" flags="g" />
<replaceregex pattern="0*([1-9][0-9]*|0)([^0-9].*)?$" replace="\1" />
</tokenfilter>
</filterchain>
</loadresource>
<jar destfile="classes.jar">
<zipfileset includes="**/*.class" src="sigrok-androidutils.jar" />
<zipfileset includes="**/*.class" src="${prefix}/share/java/sigrok-core.jar" />
</jar>
<zip destfile="sigrok-core-android-${bindings.version}.aar">
<zipfileset dir="aidl" prefix="aidl" />
<zipfileset dir="jni" prefix="jni" />
<zipfileset dir="." includes="classes.jar" />
<mappedresources>
<concat>
<fileset file="AndroidManifest.xml.in" />
<filterchain>
<expandproperties />
</filterchain>
</concat>
<mergemapper to="AndroidManifest.xml" />
</mappedresources>
<mappedresources>
<concat><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<resources>
<array name="sigrok_androidutils_jni_libs">
${bundled_libs}
</array>
</resources>]]></concat>
<mergemapper to="res/values/sigrok_androidutils_jni_libs.xml" />
</mappedresources>
<zipfileset file="device_filter.xml" fullpath="res/xml/sigrok_androidutils_device_filter.xml"/>
</zip>
</target>
<target name="pom" >
<echo file="sigrok-core-android-${bindings.version}.pom"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sigrok</groupId>
<artifactId>sigrok-core-android</artifactId>
<version>${bindings.version}</version>
<packaging>aar</packaging>
</project>
]]></echo>
</target>
</project>