- Fix up build.xml to work with tools version 11
  - Get rid of dot at front of project name
  - README.txt updates
  - logger_config additions
This commit is contained in:
zzz
2011-06-03 12:14:54 +00:00
parent d5f529819f
commit d7de8ae630
4 changed files with 711 additions and 182 deletions

View File

@@ -7,7 +7,7 @@
<!-- 3 = 1.5, 2 = 1.1, 1 = 1.0; would probably work with 1 but don't have a 1.0 SDK to test against --> <!-- 3 = 1.5, 2 = 1.1, 1 = 1.0; would probably work with 1 but don't have a 1.0 SDK to test against -->
<uses-sdk android:minSdkVersion="2" /> <uses-sdk android:minSdkVersion="2" />
<application android:label="@string/app_name"> <application android:label="@string/app_name">
<activity android:name=".I2PAndroid" <activity android:name="I2PAndroid"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask" > android:launchMode="singleTask" >
<intent-filter> <intent-filter>

View File

@@ -1,11 +1,16 @@
These instructions are for a recent Android SDK (1.6 or later).. These instructions are for a recent Android SDK (1.6 or later)..
Should also still work with a 1.5 SDK. Should also still work with a 1.5 SDK.
The build file is not compatible with the 1.1 SDK any more. The build file is not compatible with the 1.1 SDK any more.
These instructions were last updated for SDK Tools Version 11 with
SDK Platform-tools Version 5, June 2011.
#Download the SDK from http://developer.android.com/sdk/index.html #Download the SDK from http://developer.android.com/sdk/index.html
#Unzip the android SDK in ../../ #Unzip the android SDK in ../../
#So then the android tools will be in ../../android-sdk-linux_86/tools/ #So then the android tools will be in ../../android-sdk-linux_86/tools/
# #
# Run the GUI updater, which you must do to get an SDK Platform:
../../android-sdk-linux_86/tools/android &
# now go to the available packages tab, check the box and click refresh, # now go to the available packages tab, check the box and click refresh,
# and download an SDK Platform # and download an SDK Platform
# Since I2P is configured to run on 1.1 or higher # Since I2P is configured to run on 1.1 or higher
@@ -13,11 +18,15 @@ The build file is not compatible with the 1.1 SDK any more.
# target in default.properties from android-2 to andriod-x # target in default.properties from android-2 to andriod-x
# where x is the API version. # where x is the API version.
# create a file local.properties with the following line: # To run the debugger (ddms) you also need to download the
# sdk-location=/path/to/your/android-sdk-linux_86 # "Android SDK Platform-Tools" package from the GUI updater.
#then build the android apk file: # create a file local.properties with the following line (without the leading # of course):
ant debug # sdk.dir=/path/to/your/android-sdk-linux_86
# The old property was sdk-location=/path/to/your/android-sdk-linux_86
# but it changed in more recent tools.
# DO NOT create a new project or anything. It's all set up right here for you.
# Create the android 1.1 (API 2) virtual device # Create the android 1.1 (API 2) virtual device
# (don't make a custom hardware profile) # (don't make a custom hardware profile)

View File

@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project name=".I2PAndroid" default="help">
<!--
- 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">
<!-- The local.properties file is created and updated by the 'android' tool. <!-- 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 It contain the path to the SDK. It should *NOT* be checked in in Version
@@ -27,6 +35,8 @@
--> -->
<property file="build.properties"/> <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 <!-- The default.properties file is created and updated by the 'android' tool, as well
as ADT. as ADT.
@@ -65,12 +75,12 @@
================================================================================ ================================================================================
--> -->
<target name="buildrouter" depends="dirs" > <target name="buildrouter" depends="-dirs" >
<!-- build router and core --> <!-- build router and core -->
<ant dir=".." target="buildrouter" /> <ant dir=".." target="buildrouter" />
<!-- router --> <!-- router -->
<copy file="../build/router.jar" todir="${external-libs-folder}" /> <copy file="../build/router.jar" todir="${jar.libs.dir}" />
<!-- core --> <!-- core -->
<mkdir dir="tmp" /> <mkdir dir="tmp" />
@@ -82,7 +92,7 @@
<!-- org.bouncycastle.crypto already in android <!-- org.bouncycastle.crypto already in android
but we need a little trickery because our HMac is incompatible... but we need a little trickery because our HMac is incompatible...
and the libs aren't in the SDK to compile against??? --> and the libs aren't in the SDK to compile against??? -->
<jar destfile="${external-libs-folder}/crypto.jar" > <jar destfile="${jar.libs.dir}/crypto.jar" >
<fileset dir="tmp/" > <fileset dir="tmp/" >
<include name="org/bouncycastle/crypto/Digest.class" /> <include name="org/bouncycastle/crypto/Digest.class" />
<include name="org/bouncycastle/crypto/Mac.class" /> <include name="org/bouncycastle/crypto/Mac.class" />
@@ -104,7 +114,8 @@
--> -->
<delete file="tmp/org/bouncycastle/" /> <delete file="tmp/org/bouncycastle/" />
<!-- lots of unneeded stuff could be deleted here --> <!-- lots of unneeded stuff could be deleted here -->
<jar destfile="${external-libs-folder}/i2p.jar" basedir="tmp/" /> <jar destfile="${jar.libs.dir}/i2p.jar" basedir="tmp/" />
<delete dir="tmp/" />
<!-- some resources --> <!-- some resources -->
<mkdir dir="res/drawable/" /> <mkdir dir="res/drawable/" />
@@ -113,26 +124,33 @@
</target> </target>
<target name="hackcleanup"> <target name="hackcleanup">
<delete file="${external-libs-folder}/crypto.jar" /> <delete file="${jar.libs.dir}/crypto.jar" />
</target> </target>
<!-- fix for property name change sometime after SDK 1.5 --> <!-- install now does both -->
<property name="android-jar" value="${android.jar}" /> <target name="reinstall" depends="install" />
<property name="android-aidl" value="${android.aidl}" />
<target name="distclean" depends="clean">
<delete dir="${jar.libs.dir}" verbose="${verbose}" />
<delete dir="tmp/" verbose="${verbose}" />
<delete file="res/drawable/i2plogo.png" verbose="${verbose}"/>
<delete file="res/raw/blocklist_txt" verbose="${verbose}" />
</target>
<!-- <!--
================================================================================ ================================================================================
From here down copied from SDK platforms/android-1.1/templates/android_rules.xml From here down copied from SDK tools/ant/main_rules.xml from Tools version 11
and then modified and then modified
================================================================================ ================================================================================
--> -->
<!-- <!--
This rules file is meant to be imported by the custom Ant task: This rules file is meant to be imported by the custom Ant task:
com.android.ant.AndroidInitTask com.android.ant.SetupTask
The following properties are put in place by the importing task: The following properties are put in place by the importing task:
android-jar, android-aidl, aapt, aidl, and dx android.jar, android.aidl, aapt, aidl, and dx
Additionnaly, the task sets up the following classpath reference: Additionnaly, the task sets up the following classpath reference:
android.target.classpath android.target.classpath
@@ -140,227 +158,726 @@
--> -->
<!-- Custom tasks --> <!-- Custom tasks -->
<taskdef name="aaptexec" <taskdef name="aapt"
classname="com.android.ant.AaptExecLoopTask" classname="com.android.ant.AaptExecLoopTask"
classpathref="android.antlibs"/> classpathref="android.antlibs" />
<taskdef name="aidl"
classname="com.android.ant.AidlExecTask"
classpathref="android.antlibs" />
<taskdef name="renderscript"
classname="com.android.ant.RenderScriptTask"
classpathref="android.antlibs" />
<taskdef name="apkbuilder" <taskdef name="apkbuilder"
classname="com.android.ant.ApkBuilderTask" classname="com.android.ant.ApkBuilderTask"
classpathref="android.antlibs"/> classpathref="android.antlibs" />
<taskdef name="xpath"
classname="com.android.ant.XPathTask"
classpathref="android.antlibs" />
<taskdef name="if"
classname="com.android.ant.IfElseTask"
classpathref="android.antlibs" />
<!-- Properties --> <!-- Properties -->
<property name="android-tools" value="${sdk-location}/tools" /> <!-- Tells adb which device to target. You can change this from the command line
by invoking "ant -Dadb.device.arg=-d" for device "ant -Dadb.device.arg=-e" for
the emulator. -->
<property name="adb.device.arg" value="" />
<property name="android.tools.dir" location="${sdk.dir}/tools" />
<property name="android.platform.tools.dir" location="${sdk.dir}/platform-tools" />
<!-- Name of the application package extracted from manifest file -->
<xpath input="AndroidManifest.xml" expression="/manifest/@package"
output="manifest.package" />
<!-- Value of the hasCode attribute (Application node) extracted from manifest file -->
<xpath input="AndroidManifest.xml" expression="/manifest/application/@android:hasCode"
output="manifest.hasCode" default="true"/>
<!-- Input directories --> <!-- Input directories -->
<property name="source-folder" value="src" /> <property name="source.dir" value="src" />
<property name="gen-folder" value="gen" /> <property name="source.absolute.dir" location="${source.dir}" />
<property name="resource-folder" value="res" /> <property name="gen.dir" value="gen" />
<property name="asset-folder" value="assets" /> <property name="gen.absolute.dir" location="${gen.dir}" />
<property name="source-location" value="${basedir}/${source-folder}" /> <property name="resource.dir" value="res" />
<property name="resource.absolute.dir" location="${resource.dir}" />
<property name="asset.dir" value="assets" />
<property name="asset.absolute.dir" location="${asset.dir}" />
<!-- folder for the 3rd party java libraries --> <!-- Directory for the third party java libraries -->
<property name="external-libs-folder" value="libs" /> <property name="jar.libs.dir" value="libs" />
<property name="jar.libs.absolute.dir" location="${jar.libs.dir}" />
<!-- create a path with all the jar files, from the main project and the
libraries -->
<path id="jar.libs.ref">
<fileset dir="${jar.libs.absolute.dir}" includes="*.jar" />
<path refid="project.libraries.jars" />
</path>
<!-- folder for the native libraries --> <!-- Directory for the native libraries -->
<property name="native-libs-folder" value="libs" /> <property name="native.libs.dir" value="libs" />
<property name="native.libs.absolute.dir" location="${native.libs.dir}" />
<!-- Output directories --> <!-- Output directories -->
<property name="gen-folder" value="gen" /> <property name="out.dir" value="bin" />
<property name="out-folder" value="bin" /> <property name="out.absolute.dir" location="${out.dir}" />
<property name="out-classes" value="${out-folder}/classes" /> <property name="out.classes.dir" value="${out.absolute.dir}/classes" />
<property name="out-classes-location" value="${basedir}/${out-classes}"/> <property name="out.classes.absolute.dir" location="${out.classes.dir}" />
<!-- out folders for a parent project if this project is an instrumentation project -->
<property name="main-out-folder" value="../${out-folder}" />
<property name="main-out-classes" value="${main-out-folder}/classes"/>
<!-- Intermediate files --> <!-- Intermediate files -->
<property name="dex-file" value="classes.dex" /> <property name="dex.file.name" value="classes.dex" />
<property name="intermediate-dex" value="${out-folder}/${dex-file}" /> <property name="intermediate.dex.file"
<!-- dx does not properly support incorrect / or \ based on the platform location="${out.absolute.dir}/${dex.file.name}" />
and Ant cannot convert them because the parameter is not a valid path. <property name="resource.package.file.name"
Because of this we have to compute different paths depending on the platform. --> value="${ant.project.name}.ap_" />
<condition property="intermediate-dex-location"
value="${basedir}\${intermediate-dex}" <!-- The final package file to generate
else="${basedir}/${intermediate-dex}" > These can be overridden by setting them earlier to
<os family="windows"/> different values -->
<property name="out.debug.unaligned.file"
location="${out.absolute.dir}/${ant.project.name}-debug-unaligned.apk" />
<property name="out.debug.file"
location="${out.absolute.dir}/${ant.project.name}-debug.apk" />
<property name="out.unsigned.file.name"
value="${ant.project.name}-unsigned.apk" />
<property name="out.unsigned.file"
location="${out.absolute.dir}/${out.unsigned.file.name}" />
<property name="out.unaligned.file.name"
value="${ant.project.name}-unaligned.apk" />
<property name="out.unaligned.file"
location="${out.absolute.dir}/${out.unaligned.file.name}" />
<property name="out.release.file.name"
value="${ant.project.name}-release.apk" />
<property name="out.release.file"
location="${out.absolute.dir}/${out.release.file.name}" />
<!-- set some properties used for filtering/override. If those weren't defined
before, then this will create them with empty values, which are then ignored
by the custom tasks receiving them. -->
<property name="version.code" value="" />
<property name="aapt.resource.filter" value="" />
<property name="filter.abi" value="" />
<!-- compilation options -->
<property name="java.encoding" value="UTF-8" />
<property name="java.target" value="1.5" />
<property name="java.source" value="1.5" />
<!-- Verbosity -->
<property name="verbose" value="false" />
<!-- This is needed by emma as it uses multilevel verbosity instead of simple 'true' or 'false'
The property 'verbosity' is not user configurable and depends exclusively on 'verbose'
value.-->
<condition property="verbosity" value="verbose" else="quiet">
<istrue value="${verbose}" />
</condition>
<!-- This is needed to switch verbosity of zipalign. Depends exclusively on 'verbose'
-->
<condition property="v.option" value="-v" else="">
<istrue value="${verbose}" />
</condition>
<!-- This is needed to switch verbosity of dx. Depends exclusively on 'verbose' -->
<condition property="verbose.option" value="--verbose" else="">
<istrue value="${verbose}" />
</condition> </condition>
<!-- The final package file to generate --> <!-- properties for signing in release mode -->
<property name="out-debug-package" value="${out-folder}/${ant.project.name}-debug.apk"/> <condition property="has.keystore">
<and>
<isset property="key.store" />
<length string="${key.store}" when="greater" length="0" />
<isset property="key.alias" />
</and>
</condition>
<condition property="has.password">
<and>
<isset property="has.keystore" />
<isset property="key.store.password" />
<isset property="key.alias.password" />
</and>
</condition>
<!-- Tools --> <!-- Tools -->
<condition property="exe" value=".exe" else=""><os family="windows"/></condition> <condition property="exe" value=".exe" else=""><os family="windows" /></condition>
<property name="adb" value="${android-tools}/adb${exe}"/> <property name="adb" location="${android.platform.tools.dir}/adb${exe}" />
<property name="zipalign" location="${android.tools.dir}/zipalign${exe}" />
<!-- rules --> <!-- Emma configuration -->
<property name="emma.dir" value="${sdk.dir}/tools/lib" />
<path id="emma.lib">
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
<!-- End of emma configuration -->
<!-- Create the output directories if they don't exist yet. --> <!-- Macros -->
<target name="dirs">
<!-- Configurable macro, which allows to pass as parameters output directory,
output dex filename and external libraries to dex (optional) -->
<macrodef name="dex-helper">
<element name="external-libs" optional="yes" />
<element name="extra-parameters" optional="yes" />
<sequential>
<!-- sets the primary input for dex. If a pre-dex task sets it to
something else this has no effect -->
<property name="out.dex.input.absolute.dir" value="${out.classes.absolute.dir}" />
<!-- set the secondary dx input: the project (and library) jar files
If a pre-dex task sets it to something else this has no effect -->
<if>
<condition>
<isreference refid="out.dex.jar.input.ref" />
</condition>
<else>
<path id="out.dex.jar.input.ref">
<path refid="jar.libs.ref" />
</path>
</else>
</if>
<echo>Converting compiled files and external libraries into ${intermediate.dex.file}...</echo>
<apply executable="${dx}" failonerror="true" parallel="true">
<arg value="--dex" />
<arg value="--output=${intermediate.dex.file}" />
<extra-parameters />
<arg line="${verbose.option}" />
<arg path="${out.dex.input.absolute.dir}" />
<path refid="out.dex.jar.input.ref" />
<external-libs />
</apply>
</sequential>
</macrodef>
<!-- This is macro that enable passing variable list of external jar files to ApkBuilder
Example of use:
<package-helper output.filepath="/path/to/foo.apk">
<extra-jars>
<jarfolder path="my_jars" />
<jarfile path="foo/bar.jar" />
<jarfolder path="your_jars" />
</extra-jars>
</package-helper> -->
<macrodef name="package-helper">
<attribute name="output.filepath" />
<element name="extra-jars" optional="yes" />
<sequential>
<apkbuilder
outfolder="${out.absolute.dir}"
resourcefile="${resource.package.file.name}"
apkfilepath="@{output.filepath}"
debugpackaging="${build.packaging.debug}"
debugsigning="${build.signing.debug}"
abifilter="${filter.abi}"
verbose="${verbose}"
hascode="${manifest.hasCode}">
<dex path="${intermediate.dex.file}"/>
<sourcefolder path="${source.absolute.dir}"/>
<sourcefolder refid="project.libraries.src"/>
<jarfolder path="${jar.libs.absolute.dir}" />
<jarfolder refid="project.libraries.libs" />
<nativefolder path="${native.libs.absolute.dir}" />
<nativefolder refid="project.libraries.libs" />
<extra-jars/>
</apkbuilder>
</sequential>
</macrodef>
<!-- This is macro which zipaligns in.package and outputs it to out.package. Used by targets
debug, -debug-with-emma and release.-->
<macrodef name="zipalign-helper">
<attribute name="in.package" />
<attribute name="out.package" />
<sequential>
<echo>Running zip align on final apk...</echo>
<exec executable="${zipalign}" failonerror="true">
<arg line="${v.option}" />
<arg value="-f" />
<arg value="4" />
<arg path="@{in.package}" />
<arg path="@{out.package}" />
</exec>
</sequential>
</macrodef>
<!-- This is macro used only for sharing code among two targets, -install and
-install-with-emma which do exactly the same but differ in dependencies -->
<macrodef name="install-helper">
<sequential>
<echo>Installing ${out.debug.file} onto default emulator or device...</echo>
<exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="install" />
<arg value="-r" />
<arg path="${out.debug.file}" />
</exec>
</sequential>
</macrodef>
<!-- Rules -->
<!-- Creates the output directories if they don't exist yet. -->
<target name="-dirs">
<echo>Creating output directories if needed...</echo> <echo>Creating output directories if needed...</echo>
<mkdir dir="${resource-folder}" /> <mkdir dir="${resource.absolute.dir}" />
<mkdir dir="${external-libs-folder}" /> <mkdir dir="${jar.libs.absolute.dir}" />
<mkdir dir="${gen-folder}" /> <mkdir dir="${out.absolute.dir}" />
<mkdir dir="${out-folder}" /> <if condition="${manifest.hasCode}">
<mkdir dir="${out-classes}" /> <then>
<mkdir dir="${gen.absolute.dir}" />
<mkdir dir="${out.classes.absolute.dir}" />
</then>
</if>
</target> </target>
<!-- Generate the R.java file for this project's resources. --> <!-- empty default pre-build target. Create a similar target in
<target name="resource-src" depends="dirs"> your build.xml and it'll be called instead of this one. -->
<echo>Generating R.java / Manifest.java from the resources...</echo> <target name="-pre-build"/>
<exec executable="${aapt}" failonerror="true">
<arg value="package" /> <!-- Generates the R.java file for this project's resources. -->
<arg value="-m" /> <target name="-resource-src" depends="-dirs">
<arg value="-J" /> <if condition="${manifest.hasCode}">
<arg path="${gen-folder}" /> <then>
<arg value="-M" /> <echo>Generating R.java / Manifest.java from the resources...</echo>
<arg path="AndroidManifest.xml" /> <aapt executable="${aapt}"
<arg value="-S" /> command="package"
<arg path="${resource-folder}" /> verbose="${verbose}"
<arg value="-I" /> manifest="AndroidManifest.xml"
<arg path="${android-jar}" /> androidjar="${android.jar}"
</exec> rfolder="${gen.absolute.dir}">
<res path="${resource.absolute.dir}" />
</aapt>
</then>
<else>
<echo>hasCode = false. Skipping...</echo>
</else>
</if>
</target> </target>
<!-- Generate java classes from .aidl files. --> <!-- Generates java classes from .aidl files. -->
<target name="aidl" depends="dirs"> <target name="-aidl" depends="-dirs">
<echo>Compiling aidl files into Java classes...</echo> <if condition="${manifest.hasCode}">
<apply executable="${aidl}" failonerror="true"> <then>
<arg value="-p${android-aidl}" /> <echo>Compiling aidl files into Java classes...</echo>
<arg value="-I${source-folder}" /> <aidl executable="${aidl}" framework="${android.aidl}"
<arg value="-o${gen-folder}" /> genFolder="${gen.absolute.dir}">
<fileset dir="${source-folder}"> <source path="${source.absolute.dir}"/>
<include name="**/*.aidl"/> <source refid="project.libraries.src"/>
</fileset> </aidl>
</apply> </then>
<else>
<echo>hasCode = false. Skipping...</echo>
</else>
</if>
</target> </target>
<!-- Compile this project's .java files into .class files. --> <!-- Compiles RenderScript files into Java and bytecode. -->
<!-- I2P add buildrouter --> <target name="-renderscript" depends="-dirs">
<target name="compile" depends="buildrouter, resource-src, aidl"> <if condition="${manifest.hasCode}">
<javac encoding="ascii" target="1.5" debug="true" extdirs="" <then>
destdir="${out-classes}" <echo>Compiling RenderScript files into Java classes and RenderScript bytecode...</echo>
includeantruntime="false" <renderscript executable="${renderscript}"
bootclasspathref="android.target.classpath"> framework="${android.rs}"
<src path="${source-folder}" /> genFolder="${gen.absolute.dir}"
<src path="${gen-folder}" /> resFolder="${resource.absolute.dir}/raw">
<classpath> <source path="${source.absolute.dir}"/>
<fileset dir="${external-libs-folder}" includes="*.jar"/> <source refid="project.libraries.src"/>
<pathelement path="${main-out-classes}"/> </renderscript>
</classpath> </then>
</javac> <else>
<echo>hasCode = false. Skipping...</echo>
</else>
</if>
</target> </target>
<!-- Convert this project's .class files into .dex files. --> <!-- empty default pre-compile target. Create a similar target in
<!-- I2P add hackcleanup --> your build.xml and it'll be called instead of this one. -->
<target name="dex" depends="compile, hackcleanup"> <!-- I2P add depends -->
<echo>Converting compiled files and external libraries into ${out-folder}/${dex-file}...</echo> <target name="-pre-compile" depends="buildrouter" />
<apply executable="${dx}" failonerror="true" parallel="true">
<!-- I2P this is a bad sign that we need this --> <!-- Compiles this project's .java files into .class files. -->
<arg value="-JXmx256m" /> <target name="compile" depends="-pre-build, -aidl, -renderscript, -resource-src, -pre-compile"
<arg value="--dex" /> description="Compiles project's .java files into .class files">
<arg value="--output=${intermediate-dex-location}" /> <if condition="${manifest.hasCode}">
<arg path="${out-classes-location}" /> <then>
<fileset dir="${external-libs-folder}" includes="*.jar"/> <!-- If android rules are used for a test project, its classpath should include
</apply> tested project's location -->
<condition property="extensible.classpath"
value="${tested.project.absolute.dir}/bin/classes"
else=".">
<isset property="tested.project.absolute.dir" />
</condition>
<condition property="extensible.libs.classpath"
value="${tested.project.absolute.dir}/libs"
else="${jar.libs.dir}">
<isset property="tested.project.absolute.dir" />
</condition>
<javac encoding="${java.encoding}"
source="${java.source}" target="${java.target}"
debug="true" extdirs=""
destdir="${out.classes.absolute.dir}"
bootclasspathref="android.target.classpath"
verbose="${verbose}"
classpath="${extensible.classpath}"
classpathref="jar.libs.ref">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<src refid="project.libraries.src" />
<classpath>
<fileset dir="${extensible.libs.classpath}" includes="*.jar" />
</classpath>
</javac>
</then>
<else>
<echo>hasCode = false. Skipping...</echo>
</else>
</if>
</target> </target>
<!-- Put the project's resources into the output package file <!-- empty default post-compile target. Create a similar target in
your build.xml and it'll be called instead of this one. -->
<!-- I2P add depends -->
<target name="-post-compile" depends="hackcleanup" />
<!-- Obfuscate target
This is only active in release builds when proguard.config is defined
in default.properties.
To replace Proguard with a different obfuscation engine:
Override the following targets in your build.xml, before the call to <setup>
-release-obfuscation-check
Check whether obfuscation should happen, and put the result in a property.
-debug-obfuscation-check
Obfuscation should not happen. Set the same property to false.
-obfuscate
** Make sure unless="do.not.compile" is used in the target definition **
check if the property set in -debug/release-obfuscation-check is set to true.
If true:
Perform obfuscation
Set property out.dex.input.absolute.dir to be the output of the obfuscation
-->
<target name="-obfuscate" unless="do.not.compile">
<if condition="${proguard.enabled}">
<then>
<property name="obfuscate.absolute.dir" location="${out.absolute.dir}/proguard" />
<property name="preobfuscate.jar.file" value="${obfuscate.absolute.dir}/original.jar" />
<property name="obfuscated.jar.file" value="${obfuscate.absolute.dir}/obfuscated.jar" />
<!-- input for dex will be proguard's output -->
<property name="out.dex.input.absolute.dir" value="${obfuscated.jar.file}" />
<!-- Add Proguard Tasks -->
<property name="proguard.jar" location="${android.tools.dir}/proguard/lib/proguard.jar" />
<taskdef name="proguard" classname="proguard.ant.ProGuardTask" classpath="${proguard.jar}" />
<!-- Set the android classpath Path object into a single property. It'll be
all the jar files separated by a platform path-separator.
-->
<property name="android.libraryjars" refid="android.target.classpath"/>
<!-- Build a path object with all the jar files that must be obfuscated.
This include the project compiled source code and any 3rd party jar
files. -->
<path id="project.jars.ref">
<pathelement location="${preobfuscate.jar.file}" />
<path refid="jar.libs.ref" />
</path>
<!-- Set the project jar files Path object into a single property. It'll be
all the jar files separated by a platform path-separator.
-->
<property name="project.jars" refid="project.jars.ref" />
<mkdir dir="${obfuscate.absolute.dir}" />
<delete file="${preobfuscate.jar.file}"/>
<delete file="${obfuscated.jar.file}"/>
<jar basedir="${out.classes.dir}" destfile="${preobfuscate.jar.file}" />
<proguard>
@${proguard.config}
-injars ${project.jars}
-outjars ${obfuscated.jar.file}
-libraryjars ${android.libraryjars}
-dump ${obfuscate.absolute.dir}/dump.txt
-printseeds ${obfuscate.absolute.dir}/seeds.txt
-printusage ${obfuscate.absolute.dir}/usage.txt
-printmapping ${obfuscate.absolute.dir}/mapping.txt
</proguard>
</then>
</if>
</target>
<!-- Converts this project's .class files into .dex files -->
<target name="-dex" depends="compile, -post-compile, -obfuscate"
unless="do.not.compile">
<if condition="${manifest.hasCode}">
<then>
<dex-helper />
</then>
<else>
<echo>hasCode = false. Skipping...</echo>
</else>
</if>
</target>
<!-- Puts the project's resources into the output package file
This actually can create multiple resource package in case This actually can create multiple resource package in case
Some custom apk with specific configuration have been Some custom apk with specific configuration have been
declared in default.properties. declared in default.properties.
--> -->
<target name="package-resources"> <target name="-package-resources">
<echo>Packaging resources</echo> <echo>Packaging resources</echo>
<aaptexec executable="${aapt}" <aapt executable="${aapt}"
command="package" command="package"
versioncode="${version.code}"
debug="${build.packaging.debug}"
manifest="AndroidManifest.xml" manifest="AndroidManifest.xml"
resources="${resource-folder}" assets="${asset.absolute.dir}"
assets="${asset-folder}" androidjar="${android.jar}"
androidjar="${android-jar}" apkfolder="${out.absolute.dir}"
outfolder="${out-folder}" resourcefilename="${resource.package.file.name}"
basename="${ant.project.name}" /> resourcefilter="${aapt.resource.filter}">
<res path="${resource.absolute.dir}" />
<!-- <nocompress /> forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</target> </target>
<!-- Package the application and sign it with a debug key. <!-- Packages the application and sign it with a debug key. -->
This is the default target when building. It is used for debug. --> <target name="-package-debug-sign" depends="-dex, -package-resources">
<!-- <package-helper
I2P when this fails 365 days later because the key expired, delete ~/.android/debug.keystore output.filepath="${out.debug.unaligned.file}" />
Then do 'ant uninstall' (since the new key doesn't match the old key)
Then do 'ant install'
See http://developer.android.com/guide/publishing/app-signing.html for more info
-->
<target name="debug" depends="dex, package-resources">
<apkbuilder
outfolder="${out-folder}"
basename="${ant.project.name}"
signed="true"
verbose="false">
<file path="${intermediate-dex}" />
<sourcefolder path="${source-folder}" />
<jarfolder path="${external-libs-folder}" />
<nativefolder path="${native-libs-folder}" />
</apkbuilder>
</target> </target>
<!-- Package the application without signing it. <!-- Packages the application without signing it. -->
This allows for the application to be signed later with an official publishing key. --> <target name="-package-release" depends="-dex, -package-resources">
<target name="release" depends="dex, package-resources"> <package-helper
<apkbuilder output.filepath="${out.unsigned.file}"/>
outfolder="${out-folder}"
basename="${ant.project.name}"
signed="false"
verbose="false">
<file path="${intermediate-dex}" />
<sourcefolder path="${source-folder}" />
<jarfolder path="${external-libs-folder}" />
<nativefolder path="${native-libs-folder}" />
</apkbuilder>
<echo>All generated packages need to be signed with jarsigner before they are published.</echo>
</target> </target>
<!-- Install the package on the default emulator --> <target name="-compile-tested-if-test" if="tested.project.dir" unless="do.not.compile.again">
<target name="install" depends="debug"> <subant target="compile">
<echo>Installing ${out-debug-package} onto default emulator...</echo> <fileset dir="${tested.project.absolute.dir}" includes="build.xml" />
<exec executable="${adb}" failonerror="true"> </subant>
<arg value="install" /> </target>
<arg path="${out-debug-package}" />
</exec> <target name="-debug-obfuscation-check">
</target> <!-- proguard is never enabled in debug mode -->
<property name="proguard.enabled" value="false"/>
<target name="reinstall" depends="debug"> </target>
<echo>Installing ${out-debug-package} onto default emulator...</echo>
<exec executable="${adb}" failonerror="true"> <target name="-set-debug-mode" depends="-debug-obfuscation-check">
<arg value="install" /> <!-- property only set in debug mode.
<arg value="-r" /> Useful for if/unless attributes in target node
<arg path="${out-debug-package}" /> when using Ant before 1.8 -->
</exec> <property name="build.mode.debug" value="true"/>
</target>
<!-- whether the build is a debug build. always set. -->
<!-- Uninstall the package from the default emulator --> <property name="build.packaging.debug" value="true" />
<target name="uninstall">
<echo>Uninstalling ${application-package} from the default emulator...</echo> <!-- signing mode: debug -->
<property name="build.signing.debug" value="true" />
</target>
<!-- Builds debug output package, provided all the necessary files are already dexed -->
<target name="debug" depends="-set-debug-mode, -compile-tested-if-test, -package-debug-sign"
description="Builds the application and signs it with a debug key.">
<zipalign-helper in.package="${out.debug.unaligned.file}"
out.package="${out.debug.file}" />
<echo>Debug Package: ${out.debug.file}</echo>
</target>
<!-- called through target 'release'. Only executed if the keystore and
key alias are known but not their password. -->
<target name="-release-prompt-for-password" if="has.keystore" unless="has.password">
<!-- Gets passwords -->
<input
message="Please enter keystore password (store:${key.store}):"
addproperty="key.store.password" />
<input
message="Please enter password for alias '${key.alias}':"
addproperty="key.alias.password" />
</target>
<!-- called through target 'release'. Only executed if there's no
keystore/key alias set -->
<target name="-release-nosign" unless="has.keystore">
<echo>No key.store and key.alias properties found in build.properties.</echo>
<echo>Please sign ${out.unsigned.file} manually</echo>
<echo>and run zipalign from the Android SDK tools.</echo>
</target>
<target name="-release-obfuscation-check">
<condition property="proguard.enabled" value="true" else="false">
<and>
<isset property="build.mode.release" />
<isset property="proguard.config" />
</and>
</condition>
<if condition="${proguard.enabled}">
<then>
<!-- Secondary dx input (jar files) is empty since all the
jar files will be in the obfuscated jar -->
<path id="out.dex.jar.input.ref" />
</then>
</if>
</target>
<target name="-set-release-mode">
<!-- release mode is only valid if the manifest does not explicitly
set debuggable to true. default is false.
We actually store build.packaging.debug, not build.release -->
<xpath input="AndroidManifest.xml" expression="/manifest/application/@android:debuggable"
output="build.packaging.debug" default="false"/>
<!-- signing mode: release -->
<property name="build.signing.debug" value="false" />
<if condition="${build.packaging.debug}">
<then>
<echo>*************************************************</echo>
<echo>**** Android Manifest has debuggable=true ****</echo>
<echo>**** Doing DEBUG packaging with RELEASE keys ****</echo>
<echo>*************************************************</echo>
</then>
<else>
<!-- property only set in release mode.
Useful for if/unless attributes in target node
when using Ant before 1.8 -->
<property name="build.mode.release" value="true"/>
</else>
</if>
</target>
<!-- This runs -package-release and -release-nosign first and then runs
only if release-sign is true (set in -release-check,
called by -release-no-sign)-->
<target name="release"
depends="-set-release-mode, -release-obfuscation-check, -package-release, -release-prompt-for-password, -release-nosign"
if="has.keystore"
description="Builds the application. The generated apk file must be signed before
it is published.">
<!-- Signs the APK -->
<echo>Signing final apk...</echo>
<signjar
jar="${out.unsigned.file}"
signedjar="${out.unaligned.file}"
keystore="${key.store}"
storepass="${key.store.password}"
alias="${key.alias}"
keypass="${key.alias.password}"
verbose="${verbose}" />
<!-- Zip aligns the APK -->
<zipalign-helper in.package="${out.unaligned.file}"
out.package="${out.release.file}" />
<echo>Release Package: ${out.release.file}</echo>
</target>
<target name="install" depends="debug"
description="Installs/reinstalls the debug package onto a running
emulator or device. If the application was previously installed,
the signatures must match." >
<install-helper />
</target>
<target name="-uninstall-check">
<condition property="uninstall.run">
<isset property="manifest.package" />
</condition>
</target>
<target name="-uninstall-error" depends="-uninstall-check" unless="uninstall.run">
<echo>Unable to run 'ant uninstall', manifest.package property is not defined.
</echo>
</target>
<!-- Uninstalls the package from the default emulator/device -->
<target name="uninstall" depends="-uninstall-error" if="uninstall.run"
description="Uninstalls the application from a running emulator or device.">
<echo>Uninstalling ${manifest.package} from the default emulator or device...</echo>
<exec executable="${adb}" failonerror="true"> <exec executable="${adb}" failonerror="true">
<arg line="${adb.device.arg}" />
<arg value="uninstall" /> <arg value="uninstall" />
<arg value="${application-package}" /> <arg value="${manifest.package}" />
</exec> </exec>
</target> </target>
<target name="clean" description="Removes output files created by other targets.">
<delete dir="${out.absolute.dir}" verbose="${verbose}" />
<delete dir="${gen.absolute.dir}" verbose="${verbose}" />
</target>
<!-- Targets for code-coverage measurement purposes, invoked from external file -->
<!-- Emma-instruments tested project classes (compiles the tested project if necessary)
and writes instrumented classes to ${instrumentation.absolute.dir}/classes -->
<target name="-emma-instrument" depends="compile">
<echo>Instrumenting classes from ${out.absolute.dir}/classes...</echo>
<!-- It only instruments class files, not any external libs -->
<emma enabled="true">
<instr verbosity="${verbosity}"
mode="overwrite"
instrpath="${out.absolute.dir}/classes"
outdir="${out.absolute.dir}/classes">
</instr>
<!-- TODO: exclusion filters on R*.class and allowing custom exclusion from
user defined file -->
</emma>
</target>
<target name="-dex-instrumented" depends="-emma-instrument">
<dex-helper>
<extra-parameters>
<arg value="--no-locals" />
</extra-parameters>
<external-libs>
<fileset file="${emma.dir}/emma_device.jar" />
</external-libs>
</dex-helper>
</target>
<!-- Invoked from external files for code coverage purposes -->
<target name="-package-with-emma" depends="-dex-instrumented, -package-resources">
<package-helper
output.filepath="${out.debug.unaligned.file}">
<extra-jars>
<!-- Injected from external file -->
<jarfile path="${emma.dir}/emma_device.jar" />
</extra-jars>
</package-helper>
</target>
<target name="-debug-with-emma" depends="-set-debug-mode, -package-with-emma">
<zipalign-helper in.package="${out.debug.unaligned.file}"
out.package="${out.debug.file}" />
</target>
<target name="-install-with-emma" depends="-debug-with-emma">
<install-helper />
</target>
<!-- End of targets for code-coverage measurement purposes -->
<target name="help"> <target name="help">
<!-- displays starts at col 13 <!-- displays starts at col 13
|13 80| --> |13 80| -->
<echo>Android Ant Build. Available targets:</echo> <echo>Android Ant Build. Available targets:</echo>
<echo> help: Displays this help.</echo> <echo> help: Displays this help.</echo>
<echo> debug: Builds the application and sign it with a debug key.</echo> <echo> clean: Removes output files created by other targets.</echo>
<echo> compile: Compiles project's .java files into .class files.</echo>
<echo> debug: Builds the application and signs it with a debug key.</echo>
<echo> release: Builds the application. The generated apk file must be</echo> <echo> release: Builds the application. The generated apk file must be</echo>
<echo> signed before it is published.</echo> <echo> signed before it is published.</echo>
<echo> install: Installs the debug package onto a running emulator or</echo> <echo> install: Installs/reinstalls the debug package onto a running</echo>
<echo> device. This can only be used if the application has </echo> <echo> emulator or device.</echo>
<echo> not yet been installed.</echo> <echo> If the application was previously installed, the</echo>
<echo> reinstall: Installs the debug package on a running emulator or</echo> <echo> signatures must match.</echo>
<echo> device that already has the application.</echo> <echo> uninstall: Uninstalls the application from a running emulator or</echo>
<echo> The signatures must match.</echo>
<echo> uninstall: uninstall the application from a running emulator or</echo>
<echo> device.</echo> <echo> device.</echo>
</target> </target>
</project> </project>

View File

@@ -1,3 +1,6 @@
logger.defaultLevel=INFO logger.defaultLevel=INFO
logger.record.net.i2p.util.LogWriter=WARN
logger.record.net.i2p.router.peerManager.ProfileOrganizer=WARN
logger.record.net.i2p.router.transport=WARN
logger.record.net.i2p.router.transport.FIFOBandwidthRefiller=ERROR logger.record.net.i2p.router.transport.FIFOBandwidthRefiller=ERROR
logger.record.net.i2p.stat.Rate=ERROR logger.record.net.i2p.stat.Rate=ERROR