-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom_rules.xml
76 lines (67 loc) · 2.88 KB
/
custom_rules.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="custom_rules">
<!-- Include external libs -->
<property name="jar.libs.dir" value="libs" />
<property name="jar.libs.absolute.dir" location="${jar.libs.dir}" />
<path id="classpath">
<fileset dir="${jar.libs.absolute.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<property name="dex.file.name" value="classes.dex" />
<property name="out.dir" value="bin" />
<property name="out.absolute.dir" location="${out.dir}" />
<property name="out.absolute.bundle.dir" location="${out.absolute.dir}/bundle" />
<property name="intermediate.dex.bundle.file" location="${out.absolute.bundle.dir}/${dex.file.name}" />
<property name="out.bundle.file" value="${out.absolute.dir}/bundle.jar" />
<target name="-pre-compile">
<mkdir dir="${out.absolute.bundle.dir}" />
</target>
<!-- overwrite the compile target in uibuild.xml to include to external jars -->
<target name="compile" depends="-build-setup, -pre-compile">
<javac encoding="${java.encoding}"
source="${java.source}" target="${java.target}"
debug="true" extdirs="" includeantruntime="false"
destdir="${out.classes.absolute.dir}"
bootclasspathref="project.target.class.path"
verbose="${verbose}"
fork="${need.javac.fork}">
<src path="${source.absolute.dir}" />
<classpath refid="classpath"/>
<compilerarg line="${java.compilerargs}" />
</javac>
</target>
<!-- empty default post-dex target. Create a similar target in
your build.xml and it'll be called instead of this one. -->
<target name="-post-dex">
<dex executable="${dx}"
output="${intermediate.dex.bundle.file}"
nolocals="@{nolocals}"
verbose="${verbose}">
<fileset dir="${jar.libs.absolute.dir}">
<include name="**/*.jar"/>
</fileset>
</dex>
</target>
<!-- empty default post-jar target. Create a similar target in
your build.xml and it'll be called instead of this one. -->
<target name="-post-jar">
<jar destfile="${out.bundle.file}">
<fileset file="${intermediate.dex.bundle.file}" />
</jar>
</target>
<target name="install" description="Install the test package">
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="push" />
<arg value="${out.file}" />
<arg value="/data/local/tmp" />
</exec>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="push" />
<arg value="${out.bundle.file}" />
<arg value="/data/local/tmp" />
</exec>
</target>
</project>