]> sigrok.org Git - pulseview.git/blob - android/custom_rules.xml
7331fe91db248bb1064b8f04c3a5981399b99220
[pulseview.git] / android / custom_rules.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4     This file is part of the PulseView project.
5
6     Copyright (C) 2014 Marcus Comstedt <marcus@mc.pp.se>
7
8     This program is free software: you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17
18     You should have received a copy of the GNU General Public License
19     along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 -->
22 <project>
23
24   <property name="pulseview-source-path" value="${basedir}/.."/>
25   <property name="pulseview-build-path" value="${pulseview-source-path}"/>
26   <property name="cmake-cache" value="${pulseview-build-path}/CMakeCache.txt"/>
27
28   <target name="-get-prefix">
29     <loadproperties srcFile="${cmake-cache}" prefix="cmake">
30       <filterchain>
31         <replaceregex pattern=":[A-Z]*=" replace="=" />
32       </filterchain>
33     </loadproperties>
34     <property name="prefix" value="${cmake.CMAKE_INSTALL_PREFIX}"/>
35   </target>
36
37   <target name="-declare-anttasks" depends="-get-prefix">
38     <taskdef resource="anttasks.properties"
39         classpath="${prefix}/jar/sigrok-androidutils-anttasks.jar"/>
40   </target>
41
42   <target name="-pre-build" depends="-get-prefix, -declare-anttasks">
43     <copylibs todir="${native.libs.absolute.dir}" property="bundled_libs">
44       <fileset dir="${pulseview-build-path}/libs" />
45       <include name="libgnustl_shared.so"/>
46       <exclude name="lib*.so"/>
47     </copylibs>
48     <copy file="${prefix}/jar/sigrok-androidutils.jar"
49           tofile="${jar.libs.absolute.dir}/sigrok-androidutils.jar"/>
50     <copy file="${prefix}/share/sigrok-androidutils/device_filter.xml"
51           tofile="${resource.absolute.dir}/xml/device_filter.xml"/>
52     <copy file="bundled_libs.xml.in"
53           tofile="${resource.absolute.dir}/values/bundled_libs.xml">
54       <filterset>
55         <filter token="bundled_libs" value="${bundled_libs}"/>
56       </filterset>
57     </copy>
58     <copy file="${pulseview-source-path}/icons/sigrok-logo-notext.png"
59           tofile="${resource.absolute.dir}/drawable/logo.png" />
60     <copy todir="${source.absolute.dir}">
61       <fileset dir="${prefix}/src/android/java/src">
62         <include name="org/qtproject/qt5/android/bindings/**"/>
63         <include name="org/kde/necessitas/ministro/**"/>
64       </fileset>
65     </copy>
66     <copy todir="${resource.absolute.dir}">
67       <fileset dir="${prefix}/src/android/java/res">
68         <include name="**/strings.xml"/>
69       </fileset>
70     </copy>
71     <copy todir="${asset.absolute.dir}/libsigrokdecode">
72       <fileset dir="${prefix}/share/libsigrokdecode" />
73     </copy>
74     <copy todir="${asset.absolute.dir}/python3.3">
75       <fileset dir="${prefix}/lib/python3.3">
76         <include name="**/*.py"/>
77         <exclude name="**/test/**"/>
78       </fileset>
79     </copy>
80   </target>
81 </project>