]> sigrok.org Git - pulseview.git/blame_incremental - android/custom_rules.xml
Android: Bundle Qt libs with the APK
[pulseview.git] / android / custom_rules.xml
... / ...
CommitLineData
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 This file is part of the PulseView project.
4
5 Copyright (C) 2014 Marcus Comstedt <marcus@mc.pp.se>
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19-->
20<project>
21 <property name="pulseview-source-path" value="${basedir}/.."/>
22 <property name="pulseview-build-path" value="${pulseview-source-path}"/>
23 <property name="cmake-cache" value="${pulseview-build-path}/CMakeCache.txt"/>
24
25 <target name="-get-prefix">
26 <loadproperties srcFile="${cmake-cache}" prefix="cmake">
27 <filterchain>
28 <replaceregex pattern=":[A-Z]*=" replace="="/>
29 </filterchain>
30 </loadproperties>
31 <property name="prefix" value="${cmake.CMAKE_INSTALL_PREFIX}"/>
32 <property name="android.abi" value="${cmake.ANDROID_ABI}"/>
33 </target>
34
35 <target name="-declare-anttasks" depends="-get-prefix">
36 <taskdef resource="anttasks.properties"
37 classpath="${prefix}/jar/sigrok-androidutils-anttasks.jar"/>
38 </target>
39
40 <target name="-pre-build" depends="-get-prefix, -declare-anttasks">
41 <copylibs todir="${native.libs.absolute.dir}" property="bundled_libs">
42 <fileset dir="${pulseview-build-path}/libs"/>
43 <include name="libgnustl_shared.so"/>
44 <exclude name="lib*.so"/>
45 </copylibs>
46 <copy todir="${native.libs.absolute.dir}">
47 <fileset dir="${prefix}/jar">
48 <include name="QtAndroid-bundled.jar" />
49 <include name="QtAndroidAccessibility-bundled.jar" />
50 </fileset>
51 </copy>
52 <copy todir="${native.libs.absolute.dir}/${android.abi}">
53 <fileset dir="${prefix}/lib">
54 <include name="libQt5Core.so" />
55 <include name="libQt5Gui.so" />
56 <include name="libQt5Widgets.so" />
57 <include name="libQt5Svg.so" />
58 </fileset>
59 </copy>
60 <copy todir="${native.libs.absolute.dir}/${android.abi}">
61 <fileset dir="${prefix}/plugins">
62 <include name="platforms/android/libqtforandroid.so"/>
63 <include name="platforms/libqeglfs.so"/>
64 <include name="platforms/libqminimal.so"/>
65 <include name="platforms/libqminimalegl.so"/>
66 <include name="platforms/libqoffscreen.so"/>
67 <include name="generic/libqevdevkeyboardplugin.so"/>
68 <include name="generic/libqevdevmouseplugin.so"/>
69 <include name="generic/libqevdevtabletplugin.so"/>
70 <include name="generic/libqevdevtouchplugin.so"/>
71 <include name="imageformats/libqsvg.so"/>
72 <include name="iconengines/libqsvgicon.so"/>
73 <include name="accessible/libqtaccessiblewidgets.so"/>
74 </fileset>
75 <filtermapper>
76 <replacestring from="/" to="_" />
77 <prefixlines prefix="libplugins_" />
78 </filtermapper>
79 </copy>
80 <copy file="${prefix}/jar/sigrok-androidutils.jar"
81 tofile="${jar.libs.absolute.dir}/sigrok-androidutils.jar"/>
82 <copy file="${prefix}/share/sigrok-androidutils/device_filter.xml"
83 tofile="${resource.absolute.dir}/xml/device_filter.xml"/>
84 <copy file="bundled_libs.xml.in"
85 tofile="${resource.absolute.dir}/values/bundled_libs.xml">
86 <filterset>
87 <filter token="bundled_libs" value="${bundled_libs}"/>
88 </filterset>
89 </copy>
90 <copy file="${pulseview-source-path}/icons/sigrok-logo-notext.png"
91 tofile="${resource.absolute.dir}/drawable/logo.png"/>
92 <copy todir="${source.absolute.dir}">
93 <fileset dir="${prefix}/src/android/java/src">
94 <include name="org/qtproject/qt5/android/bindings/**"/>
95 <include name="org/kde/necessitas/ministro/**"/>
96 </fileset>
97 </copy>
98 <copy todir="${resource.absolute.dir}">
99 <fileset dir="${prefix}/src/android/java/res">
100 <include name="**/strings.xml"/>
101 </fileset>
102 </copy>
103 <copy todir="${asset.absolute.dir}/libsigrokdecode">
104 <fileset dir="${prefix}/share/libsigrokdecode"/>
105 </copy>
106 <copy todir="${asset.absolute.dir}/python3.3">
107 <fileset dir="${prefix}/lib/python3.3">
108 <include name="**/*.py"/>
109 <exclude name="**/test/**"/>
110 </fileset>
111 </copy>
112 </target>
113</project>