-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcustom_rules.xml
54 lines (46 loc) · 2.64 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="asqliteplus-library-rules" default="help">
<!--
A rule to generate the JAR for inclusion in an Android application.
Output file will be "bin/asqliteplus-0.1.jar".
This target was copied from ${sdk.dir}/tools/ant/build.xml's "-compile"
target which used to compile project's .java files into .class files.
I simplify that target, omitted "build.is.instrumented", "project.is.library",
"android.package.excludes" logic, added ignoring "Manifest.class"
in jar-fileset element during packaging the JAR file.
-->
<property name="library.name" value="asqliteplus"/>
<property name="library.version.name" value="0.1"/>
<target name="jar" depends="-pre-build, -build-setup, -code-gen, -pre-compile">
<do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
<!-- merge the project's own classpath and the tested project's classpath -->
<path id="project.javac.classpath">
<path refid="project.all.jars.path"/>
<path refid="tested.project.classpath"/>
<path path="${java.compiler.classpath}"/>
</path>
<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}"
classpathref="project.javac.classpath"
fork="${need.javac.fork}">
<src path="${source.absolute.dir}"/>
<src path="${gen.absolute.dir}"/>
<compilerarg line="${java.compilerargs}"/>
</javac>
<echo level="info">Creating library output jar file...</echo>
<property name="out.library.jar.file" location="${out.absolute.dir}/${library.name}-${library.version.name}.jar"/>
<propertybyreplace name="project.app.package.path" input="${project.app.package}" replace="." with="/"/>
<jar destfile="${out.library.jar.file}">
<fileset dir="${out.classes.absolute.dir}"
includes="**/*.class"
excludes="${project.app.package.path}/R.class ${project.app.package.path}/R$*.class
${project.app.package.path}/BuildConfig.class ${project.app.package.path}/Manifest.class"/>
<fileset dir="${source.absolute.dir}" excludes="**/*.java"/>
</jar>
</do-only-if-manifest-hasCode>
</target>
</project>