Compare commits
6 Commits
android-0.
...
android-0.
Author | SHA1 | Date | |
---|---|---|---|
163bc2ce58 | |||
97f52f8139 | |||
0094cc5637 | |||
01c994e7b2 | |||
b60ae00fd7 | |||
a91261f5ca |
@ -60,7 +60,7 @@ Instructions:
|
||||
|
||||
# Create the android 4.4 (API 19) virtual device
|
||||
# (don't make a custom hardware profile)
|
||||
../android-sdk-linux/tools/android create avd --name i2p --target 19
|
||||
../android-sdk-linux/tools/android create avd --name i2p --target android-19
|
||||
|
||||
# then run the emulator:
|
||||
# This may take a LONG time the first time (half an hour or more)...
|
||||
|
@ -364,17 +364,6 @@
|
||||
<property name="version.name" value="${my.version.name}" />
|
||||
<echo message="version.code '${version.code}', 'version.name '${version.name}', '${my.version.name}'" />
|
||||
|
||||
<!-- If we are missing any jars, we _MUST_ make them ahead of time so
|
||||
the build does not fail! _HOWEVER_ we must only do this if we are
|
||||
_BUILDING_! Apache Ant does not allow us to know what target we are
|
||||
about to run, because the authors believe it is 'evil' and other
|
||||
nonsense. So for now (so sorry!) we force build it ahead of time
|
||||
always, no matter what target was selected, until some better way
|
||||
of resolving this issue apears.
|
||||
-->
|
||||
<ant dir="routerjars" inheritall="false" useNativeBasedir="true" >
|
||||
<target name="buildrouter" />
|
||||
</ant>
|
||||
<!--
|
||||
================================================================================
|
||||
New I2P rules
|
||||
@ -394,12 +383,9 @@
|
||||
<!-- overrides of those in main_rules.xml -->
|
||||
|
||||
<target name="-pre-build" depends="copy-i2p-resources" >
|
||||
<!-- aapt messes up when resources are added or deleted, just build every time
|
||||
<delete dir="${gen.absolute.dir}/net" verbose="${verbose}" />
|
||||
-->
|
||||
<!-- screw it, do the classes too, until I add the depend class
|
||||
<delete dir="${out.absolute.dir}/classes/net" verbose="${verbose}" />
|
||||
-->
|
||||
<ant dir="routerjars" inheritall="false" useNativeBasedir="true" >
|
||||
<target name="buildrouter" />
|
||||
</ant>
|
||||
</target>
|
||||
|
||||
<!--
|
||||
@ -423,17 +409,8 @@
|
||||
<copy file="LICENSE.txt" tofile="res/raw/license_app_txt" />
|
||||
<copy file="licenses/LICENSE-Apache2.0.txt" tofile="res/raw/license_apache20_txt" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" />
|
||||
<!--
|
||||
|
||||
No, no, no. Wrong, wrong, wrong. Static web sources should be in
|
||||
the assets directory.
|
||||
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/outbound.png" todir="res/drawable/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/inbound.png" todir="res/drawable/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/light/images/header.png" todir="res/drawable/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/light/console.css" tofile="res/drawable/console_css" />
|
||||
-->
|
||||
|
||||
|
||||
<!-- Static web sources should be in the assets directory. -->
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/i2plogo.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/outbound.png" todir="assets/themes/console/images/" />
|
||||
<copy file="${i2pbase}/installer/resources/themes/console/images/inbound.png" todir="assets/themes/console/images/" />
|
||||
@ -493,13 +470,14 @@
|
||||
<delete file="res/raw/license_gplv2_txt" />
|
||||
<delete file="res/raw/license_gplv3_txt" />
|
||||
<delete file="res/raw/license_lgplv3_txt" />
|
||||
<delete file="res/raw/license_fatcowicons_txt" />
|
||||
<delete file="res/raw/certificates_zip" />
|
||||
</target>
|
||||
|
||||
<target name="distclean" depends="clean">
|
||||
<ant dir="routerjars" inheritall="false" useNativeBasedir="true" >
|
||||
<target name="distclean" />
|
||||
</ant>
|
||||
<ant dir="routerjars" inheritall="false" useNativeBasedir="true" >
|
||||
<target name="distclean" />
|
||||
</ant>
|
||||
<delete file="scripts/build.number" verbose="${verbose}" />
|
||||
<delete file="scripts/version.properties" verbose="${verbose}" />
|
||||
<delete file="AndroidManifest.xml" verbose="${verbose}" />
|
||||
|
@ -38,14 +38,28 @@
|
||||
|
||||
<!-- new rules -->
|
||||
|
||||
<target name="buildrouter" depends="-dirs" >
|
||||
<!-- build router and core -->
|
||||
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" >
|
||||
<target name="buildRouter" />
|
||||
<target name="buildI2PTunnelJar" />
|
||||
<target name="buildAddressbook" />
|
||||
<target name="buildBOB" />
|
||||
</ant>
|
||||
|
||||
<available property="have.router" file="${i2pbase}/build/router.jar" />
|
||||
<available property="have.bob" file="${i2pbase}/apps/BOB/dist/BOB.jar" />
|
||||
<available property="have.i2ptunnel" file="${i2pbase}/apps/i2ptunnel/java/build/i2ptunnel.jar" />
|
||||
<available property="have.addressbook" file="${i2pbase}/apps/addressbook/build" />
|
||||
|
||||
<target name="buildRouter" unless="have.router">
|
||||
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildRouter" />
|
||||
</target>
|
||||
|
||||
<target name="buildI2PTunnelJar" unless="have.i2ptunnel">
|
||||
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildI2PTunnelJar" />
|
||||
</target>
|
||||
<target name="buildAddressbook" unless="have.addressbook">
|
||||
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildAddressbook" />
|
||||
</target>
|
||||
|
||||
<target name="buildBOB" unless="have.bob">
|
||||
<ant dir="${i2pbase}" inheritall="false" useNativeBasedir="true" target="buildBOB" />
|
||||
</target>
|
||||
|
||||
<target name="buildrouter" depends="-dirs, buildRouter, buildI2PTunnelJar, buildAddressbook, buildBOB">
|
||||
|
||||
<!-- router -->
|
||||
<copy file="${i2pbase}/build/router.jar" todir="${jar.libs.dir}" />
|
||||
@ -61,7 +75,7 @@
|
||||
<exclude name="net/i2p/util/SecureDirectory.class" />
|
||||
<exclude name="net/i2p/util/SecureFile.class" />
|
||||
<exclude name="net/i2p/util/SecureFileOutputStream.class" />
|
||||
</zipfileset >
|
||||
</zipfileset>
|
||||
</jar>
|
||||
|
||||
<!-- i2ptunnel -->
|
||||
@ -70,7 +84,7 @@
|
||||
<jar destfile="${jar.libs.dir}/i2ptunnel.jar" >
|
||||
<zipfileset src="${i2pbase}/apps/i2ptunnel/java/build/i2ptunnel.jar" >
|
||||
<exclude name="net/i2p/i2ptunnel/I2PTunnelGUI.class" />
|
||||
</zipfileset >
|
||||
</zipfileset>
|
||||
</jar>
|
||||
|
||||
<!-- addressbook - make a jar, it's a war in the i2p distro -->
|
||||
@ -91,7 +105,8 @@
|
||||
<target name="distclean" depends="clean">
|
||||
<delete dir="${jar.libs.dir}" verbose="${verbose}" />
|
||||
<delete dir="jni/build/" verbose="${verbose}" />
|
||||
<delete file="AndroidManifest.xml" verbose="${verbose}" />
|
||||
<delete file="AndroidManifest.xml" verbose="${verbose}" />
|
||||
<ant dir="${i2pbase}" target="distclean" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
@ -2,6 +2,8 @@
|
||||
#
|
||||
# build GMP and libjbigi.so using the Android tools directly
|
||||
#
|
||||
# TODO: Get more settings from environment variables set in ../custom-rules.xml
|
||||
#
|
||||
|
||||
# uncomment to skip
|
||||
# exit 0
|
||||
@ -31,28 +33,56 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
I2PBASE=${1:-../../../i2p.i2p}
|
||||
I2PBASE=${1:-$THISDIR/../../../i2p.i2p}
|
||||
#
|
||||
# Wrong again. We want to be able to not have to update this script
|
||||
# We want to be able to not have to update this script
|
||||
# every time a new NDK comes out. We solve this by using readlink with
|
||||
# a wild card, deglobbing automatically sorts to get the highest revision.
|
||||
# the dot at the end ensures that it is a directory, and not a file.
|
||||
#
|
||||
#export NDK=$(realpath ../../android-ndk-r5b/)
|
||||
|
||||
## Simple fix for osx development
|
||||
if [ `uname -s` = "Darwin" ]; then
|
||||
export NDK="/Developer/android/ndk/"
|
||||
else
|
||||
export NDK="`readlink -n -e $(for last in ../../android-ndk-r*/.; do true; done ; echo $last)`"
|
||||
NDK_GLOB=$THISDIR/'../../../android-ndk-r*/.'
|
||||
export NDK="`readlink -n -e $(for last in $NDK_GLOB; do true; done ; echo $last)`"
|
||||
fi
|
||||
|
||||
if [ "$NDK" == "" ]; then
|
||||
echo "Cannot find NDK in $NDK_GLOB, install it or adjust NDK_GLOB in script"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d "$NDK" ]; then
|
||||
echo "Cannot find NDK in $NDK, install it"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# API level, must match that in ../AndroidManifest.xml
|
||||
#
|
||||
LEVEL=8
|
||||
ARCH="arm"
|
||||
export SYSROOT="$NDK/platforms/android-$LEVEL/arch-$ARCH/"
|
||||
export AABI="arm-linux-androideabi-4.4.3"
|
||||
if [ ! -d "$SYSROOT" ]; then
|
||||
echo "Cannot find $SYSROOT in NDK, check for support of level: $LEVEL arch: $ARCH or adjust LEVEL and ARCH in script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# 4.6 is the GCC version. GCC 4.4.3 support was removed in NDK r9b.
|
||||
# Available in r9b:
|
||||
# arm-linux-androideabi-4.6
|
||||
# arm-linux-androideabi-4.8
|
||||
# arm-linux-androideabi-clang3.3
|
||||
# llvm-3.3
|
||||
# mipsel-linux-android-4.6
|
||||
# mipsel-linux-android-4.8
|
||||
# mipsel-linux-android-clang3.3
|
||||
# x86-4.6
|
||||
# x86-4.8
|
||||
# x86-clang3.3
|
||||
export AABI="arm-linux-androideabi-4.6"
|
||||
if [ `uname -s` = "Darwin" ]; then
|
||||
export SYSTEM="darwin-x86"
|
||||
elif [ `uname -m` = "x86_64" ]; then
|
||||
@ -60,8 +90,14 @@ elif [ `uname -m` = "x86_64" ]; then
|
||||
else
|
||||
export SYSTEM="linux-x86"
|
||||
fi
|
||||
|
||||
export BINPREFIX="arm-linux-androideabi-"
|
||||
export CC="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}gcc --sysroot=$SYSROOT"
|
||||
COMPILER="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}gcc"
|
||||
if [ ! -f "$COMPILER" ]; then
|
||||
echo "Cannot find compiler $COMPILER in NDK, check for support of system: $SYSTEM ABI: $AABI or adjust AABI and SYSTEM in script"
|
||||
exit 1
|
||||
fi
|
||||
export CC="$COMPILER --sysroot=$SYSROOT"
|
||||
# worked without this on 4.3.2, but 5.0.2 couldn't find it
|
||||
export NM="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}nm"
|
||||
STRIP="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}strip"
|
||||
@ -109,9 +145,7 @@ make || exit 1
|
||||
if [ `uname -s` = "Darwin" ]; then
|
||||
export JAVA_HOME=$(/usr/libexec/java_home)
|
||||
else
|
||||
# FIXME This will not work everywhere (e.g. BSD). Could borrow my
|
||||
# 'find-java-home' script for this
|
||||
export JAVA_HOME="$(dirname $(dirname $(realpath $(which javac))))"
|
||||
[ -z $JAVA_HOME ] && . $I2PBASE/core/c/find-java-home
|
||||
fi
|
||||
if [ ! -f "$JAVA_HOME/include/jni.h" ]; then
|
||||
echo "Cannot find jni.h! Looked in '$JAVA_HOME/include/jni.h'"
|
||||
|
Reference in New Issue
Block a user