Newer
Older
<?xml version="1.0" encoding="UTF-8"?>
- Portions copied and modified from Android SDK
- Copyright (c) 2005-2008, The Android Open Source Project
- Apache 2.0 license
-->
<project name="I2PAndroid" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contain the path to the SDK. It should *NOT* be checked in in Version
Control Systems. -->
<property file="local.properties"/>
<!-- The build.properties file can be created by you and is never touched
by the 'android' tool. This is the place to change some of the default property values
used by the Ant rules.
Here are some properties you may want to change/update:
application-package
the name of your application package as defined in the manifest. Used by the
'uninstall' rule.
source-folder
the name of the source folder. Default is 'src'.
out-folder
the name of the output folder. Default is 'bin'.
Properties related to the SDK location or the project target should be updated
using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your application and
should be checked in in Version Control Systems.
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
-->
<property file="build.properties"/>
<!-- set the old name to the new name -->
<property name="sdk-location" value="${sdk.dir}" />
<!-- The default.properties file is created and updated by the 'android' tool, as well
as ADT.
This file is an integral part of the build system for your application and
should be checked in in Version Control Systems. -->
<property file="default.properties"/>
<!-- Custom Android task to deal with the project target, and import the proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
<pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
<pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
<pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
<pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
<pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
</path>
<taskdef name="setup"
classname="com.android.ant.SetupTask"
classpathref="android.antlibs"/>
<!-- Execute the Android Setup task that will setup some properties specific to the target,
and import the rules files.
To customize the rules, copy/paste them below the task, and disable import by setting
the import attribute to false:
<setup import="false" />
This will ensure that the properties are setup correctly but that your customized
targets are used.
-->
<setup import="true" />
<echo>Ignore warning about SDK version</echo>
<!--
================================================================================
New I2P rules
================================================================================
-->
<!-- overrides of those in main_rules.xml -->
<target name="-pre-build" depends="copy-i2p-resources, incrementBuild" />
<target name="-pre-compile" depends="buildrouter" />
<target name="-post-compile" depends="hackcleanup, jbigi" />
<property name="i2pbase" value="../i2p.i2p"/>
<target name="buildrouter" depends="-dirs" >
<!-- build router and core -->
<copy file="${i2pbase}/build/router.jar" todir="${jar.libs.dir}" />
<!-- org.bouncycastle.crypto already in android
but we need a little trickery because our HMac is incompatible...
and the libs aren't in the SDK to compile against??? -->
<jar destfile="${jar.libs.dir}/crypto.jar" >
<include name="org/bouncycastle/crypto/Digest.class" />
<include name="org/bouncycastle/crypto/Mac.class" />
<include name="org/bouncycastle/crypto/digests/GeneralDigest.class" />
<include name="org/bouncycastle/crypto/digests/MD5Digest.class" />
</zipfileset >
<!-- lots of unneeded stuff could be deleted here -->
<jar destfile="${jar.libs.dir}/i2p.jar" >
<exclude name="net/i2p/util/LogWriter.class" />
<exclude name="net/i2p/util/SecureDirectory.class" />
<exclude name="net/i2p/util/SecureFile.class" />
<exclude name="net/i2p/util/SecureFileOutputStream.class" />
<exclude name="org/bouncycastle/crypto/Digest.class" />
<exclude name="org/bouncycastle/crypto/Mac.class" />
<exclude name="org/bouncycastle/crypto/digests/GeneralDigest.class" />
<exclude name="org/bouncycastle/crypto/digests/MD5Digest.class" />
</zipfileset >
<!-- some resources -->
<target name="copy-i2p-resources" depends="-dirs" >
<copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" />
<copy file="${i2pbase}/installer/resources/blocklist.txt" tofile="res/raw/blocklist_txt" />
<target name="hackcleanup">
<delete file="${jar.libs.dir}/crypto.jar" />
<exec executable="sh" osfamily="unix" failonerror="true">
<arg value="jni/build.sh" />
<copy file="jni/libjbigi.so" todir="${native.libs.dir}/armeabi" />
<target name="incrementBuild">
<buildnumber file="scripts/build.number" />
<exec executable="sh" osfamily="unix" failonerror="true">
<arg value="-c" />
<arg value="scripts/setversion.sh" />
<!-- this loads my.version.code and my.version.name -->
<property file="scripts/version.properties" />
</target>
<!-- install now does both -->
<target name="reinstall" depends="install" />
<target name="distclean" depends="clean">
<delete dir="${jar.libs.dir}" verbose="${verbose}" />
<delete file="res/drawable/i2plogo.png" verbose="${verbose}"/>
<delete file="res/raw/blocklist_txt" verbose="${verbose}" />
<delete dir="jni/build/" verbose="${verbose}" />
<delete file="jni/libjbigi.so" verbose="${verbose}" />
<delete file="scripts/build.number" verbose="${verbose}" />
<delete file="scripts/version.properties" verbose="${verbose}" />
<!--
================================================================================
From here down copied from SDK tools/ant/main_rules.xml from Tools version 11
and then modified
================================================================================
-->
<!-- not necessary to copy if setup import="true" -->
<!--
override this because the ant task com.android.ant.AaptExecLoopTask has issues:
a) it uses version.code which main_rules sets to "" and
b) it can't set versionName via the aapt task, have to use the aapt command line
-->
<!-- Puts the project's resources into the output package file
This actually can create multiple resource package in case
Some custom apk with specific configuration have been
declared in default.properties.
-->
<target name="-package-resources">
<echo>Packaging resources</echo>
<exec executable="${aapt}" failonerror="true" >
<arg value="package" />
<arg value="--version-code" />
<arg value="${my.version.code}" />
<arg value="--version-name" />
<arg value="${my.version.name}" />
<arg value="-f" />
<arg value="-m" />
<arg value="-M" />
<arg value="AndroidManifest.xml" />
<arg value="-I" />
<arg value="${android.jar}" />
<arg value="-S" />
<arg value="${resource.absolute.dir}" />
<arg value="-J" />
<arg value="${gen.absolute.dir}" />
<arg value="-F" />
<arg value="${out.absolute.dir}/${resource.package.file.name}" />