2009-07-03 22:13:18 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2011-06-03 12:14:54 +00:00
|
|
|
|
|
|
|
<!--
|
|
|
|
- Portions copied and modified from Android SDK
|
|
|
|
- Copyright (c) 2005-2008, The Android Open Source Project
|
|
|
|
- Apache 2.0 license
|
|
|
|
- See ../licenses/LICENSE-Apache2.0.txt
|
|
|
|
-->
|
|
|
|
|
|
|
|
<project name="I2PAndroid" default="help">
|
2009-07-03 22:13:18 +00:00
|
|
|
|
|
|
|
<!-- 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.
|
|
|
|
|
|
|
|
-->
|
|
|
|
<property file="build.properties"/>
|
2011-06-03 12:14:54 +00:00
|
|
|
<!-- set the old name to the new name -->
|
|
|
|
<property name="sdk-location" value="${sdk.dir}" />
|
2009-07-03 22:13:18 +00:00
|
|
|
|
|
|
|
<!-- 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.
|
|
|
|
-->
|
2011-06-05 22:38:35 +00:00
|
|
|
<setup import="true" />
|
2009-07-03 22:13:18 +00:00
|
|
|
|
2011-06-05 22:38:35 +00:00
|
|
|
<echo>Ignore warning about SDK version</echo>
|
2009-07-03 22:13:18 +00:00
|
|
|
<!--
|
|
|
|
================================================================================
|
|
|
|
New I2P rules
|
|
|
|
================================================================================
|
|
|
|
-->
|
2009-03-10 05:20:48 +00:00
|
|
|
|
2011-06-05 22:38:35 +00:00
|
|
|
<!-- 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" />
|
|
|
|
|
|
|
|
<!-- new rules -->
|
|
|
|
|
2011-06-03 12:14:54 +00:00
|
|
|
<target name="buildrouter" depends="-dirs" >
|
2009-07-03 22:13:18 +00:00
|
|
|
<!-- build router and core -->
|
|
|
|
<ant dir=".." target="buildrouter" />
|
2009-03-10 05:20:48 +00:00
|
|
|
|
2009-07-03 22:13:18 +00:00
|
|
|
<!-- router -->
|
2011-06-03 12:14:54 +00:00
|
|
|
<copy file="../build/router.jar" todir="${jar.libs.dir}" />
|
2009-07-03 22:13:18 +00:00
|
|
|
|
|
|
|
<!-- core -->
|
2011-06-04 00:29:02 +00:00
|
|
|
|
2009-07-03 22:13:18 +00:00
|
|
|
<!-- 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??? -->
|
2011-06-03 12:14:54 +00:00
|
|
|
<jar destfile="${jar.libs.dir}/crypto.jar" >
|
2011-06-04 00:29:02 +00:00
|
|
|
<zipfileset src="../build/i2p.jar" >
|
2009-07-03 22:13:18 +00:00
|
|
|
<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" />
|
2011-06-04 00:29:02 +00:00
|
|
|
</zipfileset >
|
2009-07-03 22:13:18 +00:00
|
|
|
</jar>
|
2011-06-04 00:29:02 +00:00
|
|
|
|
2009-07-03 22:13:18 +00:00
|
|
|
<!-- lots of unneeded stuff could be deleted here -->
|
2011-06-04 00:29:02 +00:00
|
|
|
<jar destfile="${jar.libs.dir}/i2p.jar" >
|
|
|
|
<zipfileset src="../build/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 >
|
|
|
|
</jar>
|
|
|
|
</target>
|
2009-07-03 22:13:18 +00:00
|
|
|
|
2011-06-04 00:29:02 +00:00
|
|
|
<!-- some resources -->
|
|
|
|
<target name="copy-i2p-resources" depends="-dirs" >
|
2009-07-03 22:13:18 +00:00
|
|
|
<copy file="../installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" />
|
|
|
|
<copy file="../installer/resources/blocklist.txt" tofile="res/raw/blocklist_txt" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="hackcleanup">
|
2011-06-03 12:14:54 +00:00
|
|
|
<delete file="${jar.libs.dir}/crypto.jar" />
|
2009-07-03 22:13:18 +00:00
|
|
|
</target>
|
|
|
|
|
2011-06-04 00:29:02 +00:00
|
|
|
<target name="jbigi">
|
|
|
|
<exec executable="sh" osfamily="unix" failonerror="true">
|
|
|
|
<arg value="-c" />
|
|
|
|
<arg value="jni/build.sh" />
|
|
|
|
</exec>
|
|
|
|
<copy file="jni/libjbigi.so" todir="${native.libs.dir}/armeabi" />
|
|
|
|
</target>
|
|
|
|
|
2011-06-04 19:31:45 +00:00
|
|
|
<target name="incrementBuild">
|
|
|
|
<buildnumber file="scripts/build.number" />
|
|
|
|
<exec executable="sh" osfamily="unix" failonerror="true">
|
|
|
|
<arg value="-c" />
|
|
|
|
<arg value="scripts/setversion.sh" />
|
|
|
|
</exec>
|
2011-06-05 22:38:35 +00:00
|
|
|
<!-- this loads my.version.code and my.version.name -->
|
|
|
|
<property file="scripts/version.properties" />
|
2011-06-04 19:31:45 +00:00
|
|
|
</target>
|
|
|
|
|
2011-06-03 12:14:54 +00:00
|
|
|
<!-- 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}" />
|
2011-06-04 00:29:02 +00:00
|
|
|
<delete dir="jni/build/" verbose="${verbose}" />
|
|
|
|
<delete file="jni/libjbigi.so" verbose="${verbose}" />
|
2011-06-04 19:31:45 +00:00
|
|
|
<delete file="scripts/build.number" verbose="${verbose}" />
|
2011-06-05 22:38:35 +00:00
|
|
|
<delete file="scripts/version.properties" verbose="${verbose}" />
|
2011-06-03 12:14:54 +00:00
|
|
|
</target>
|
2010-03-05 13:48:26 +00:00
|
|
|
|
2009-07-03 22:13:18 +00:00
|
|
|
<!--
|
|
|
|
================================================================================
|
2011-06-03 12:14:54 +00:00
|
|
|
From here down copied from SDK tools/ant/main_rules.xml from Tools version 11
|
2009-07-03 22:13:18 +00:00
|
|
|
and then modified
|
|
|
|
================================================================================
|
|
|
|
-->
|
|
|
|
|
2011-06-05 22:38:35 +00:00
|
|
|
<!-- not necessary to copy if setup import="true" -->
|
2011-06-03 12:14:54 +00:00
|
|
|
|
2009-03-10 05:20:48 +00:00
|
|
|
|
2011-06-05 22:38:35 +00:00
|
|
|
<!--
|
|
|
|
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
|
2011-06-03 12:14:54 +00:00
|
|
|
-->
|
|
|
|
|
|
|
|
<!-- Puts the project's resources into the output package file
|
2009-07-03 22:13:18 +00:00
|
|
|
This actually can create multiple resource package in case
|
|
|
|
Some custom apk with specific configuration have been
|
|
|
|
declared in default.properties.
|
|
|
|
-->
|
2011-06-03 12:14:54 +00:00
|
|
|
<target name="-package-resources">
|
2009-07-03 22:13:18 +00:00
|
|
|
<echo>Packaging resources</echo>
|
2011-06-05 22:38:35 +00:00
|
|
|
<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}" />
|
2009-03-10 05:20:48 +00:00
|
|
|
</exec>
|
|
|
|
</target>
|
2011-06-03 12:14:54 +00:00
|
|
|
|
2009-03-10 05:20:48 +00:00
|
|
|
</project>
|