pulseview/android/custom_rules.xml

124 lines
4.7 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the PulseView project.
Copyright (C) 2014 Marcus Comstedt <marcus@mc.pp.se>
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="pulseview-source-path" value="${basedir}/.."/>
<property name="pulseview-build-path" value="${pulseview-source-path}"/>
<property name="cmake-cache" value="${pulseview-build-path}/CMakeCache.txt"/>
<target name="-get-prefix">
<loadproperties srcFile="${cmake-cache}" prefix="cmake">
<filterchain>
<replaceregex pattern=":[A-Z]*=" replace="="/>
</filterchain>
</loadproperties>
<property name="prefix" value="${cmake.CMAKE_INSTALL_PREFIX}"/>
<property name="android.abi" value="${cmake.ANDROID_ABI}"/>
</target>
<target name="-declare-anttasks" depends="-get-prefix">
<taskdef resource="anttasks.properties"
classpath="${prefix}/jar/sigrok-androidutils-anttasks.jar"/>
</target>
<target name="-pre-build" depends="-get-prefix, -declare-anttasks">
<copylibs todir="${native.libs.absolute.dir}" property="bundled_libs">
<fileset dir="${pulseview-build-path}/libs"/>
<include name="libpulseview.so"/>
<exclude name="libQt5*.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 todir="${native.libs.absolute.dir}">
<fileset dir="${prefix}/jar">
<include name="QtAndroid-bundled.jar" />
<include name="QtAndroidAccessibility-bundled.jar" />
</fileset>
</copy>
<copy todir="${native.libs.absolute.dir}/${android.abi}">
<fileset dir="${prefix}/lib">
<include name="libQt5Core.so" />
<include name="libQt5Gui.so" />
<include name="libQt5Widgets.so" />
<include name="libQt5Svg.so" />
</fileset>
</copy>
<copy todir="${native.libs.absolute.dir}/${android.abi}">
<fileset dir="${prefix}/plugins">
<include name="platforms/android/libqtforandroid.so"/>
<include name="platforms/libqeglfs.so"/>
<include name="platforms/libqminimal.so"/>
<include name="platforms/libqminimalegl.so"/>
<include name="platforms/libqoffscreen.so"/>
<include name="generic/libqevdevkeyboardplugin.so"/>
<include name="generic/libqevdevmouseplugin.so"/>
<include name="generic/libqevdevtabletplugin.so"/>
<include name="generic/libqevdevtouchplugin.so"/>
<include name="imageformats/libqsvg.so"/>
<include name="iconengines/libqsvgicon.so"/>
</fileset>
<filtermapper>
<replacestring from="/" to="_" />
<prefixlines prefix="libplugins_" />
</filtermapper>
</copy>
<copy file="${prefix}/jar/sigrok-androidutils.jar"
tofile="${jar.libs.absolute.dir}/sigrok-androidutils.jar"/>
<copy file="${prefix}/share/sigrok-androidutils/device_filter.xml"
tofile="${resource.absolute.dir}/xml/device_filter.xml"/>
<copy file="bundled_libs.xml.in"
tofile="${resource.absolute.dir}/values/bundled_libs.xml">
<filterset>
<filter token="bundled_libs" value="${bundled_libs}"/>
</filterset>
</copy>
<copy file="${pulseview-source-path}/icons/pulseview.png"
tofile="${resource.absolute.dir}/drawable/logo.png"/>
<copy todir="${source.absolute.dir}">
<fileset dir="${prefix}/src/android/java/src">
<include name="org/qtproject/qt5/android/bindings/**"/>
<include name="org/kde/necessitas/ministro/**"/>
</fileset>
</copy>
<copy todir="${resource.absolute.dir}">
<fileset dir="${prefix}/src/android/java/res">
<include name="**/strings.xml"/>
</fileset>
</copy>
<copy todir="${asset.absolute.dir}/libsigrokdecode">
<fileset dir="${prefix}/share/libsigrokdecode"/>
</copy>
<copy todir="${asset.absolute.dir}/python3.3">
<fileset dir="${prefix}/lib/python3.3">
<include name="**/*.py"/>
<exclude name="**/test/**"/>
<exclude name="**/tests/**"/>
<exclude name="**/tkinter/**"/>
<exclude name="**/turtledemo/**"/>
<exclude name="**/turtle.py"/>
<exclude name="**/idlelib/**"/>
</fileset>
</copy>
<copy todir="${asset.absolute.dir}/sigrok-firmware">
<fileset dir="${prefix}/share/sigrok-firmware"/>
</copy>
</target>
</project>