From 84419904ad07082b7e583cfc902e4531b239a669 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Tue, 7 Jun 2011 14:45:02 +0000
Subject: [PATCH] update paths in scripts and readme

---
 README.txt            | 24 +++++++++++++-----------
 build.xml             | 16 +++++++++-------
 jni/build.sh          |  5 +++--
 scripts/setversion.sh |  5 +++--
 4 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/README.txt b/README.txt
index ff5b1f2d6..6c1e22f17 100644
--- a/README.txt
+++ b/README.txt
@@ -1,15 +1,17 @@
-These instructions are for a recent Android SDK (1.6 or later)..
-Should also still work with a 1.5 SDK.
-The build file is not compatible with the 1.1 SDK any more.
+These instructions are for a recent Android SDK (1.6 or later).
 These instructions were last updated for SDK Tools Version 11 with
 SDK Platform-tools Version 5, June 2011.
 
+The i2p source must be installed in ../i2p.i2p
+
+=====================
+
 #Download the SDK from http://developer.android.com/sdk/index.html
-#Unzip the android SDK in ../../
-#So then the android tools will be in ../../android-sdk-linux_86/tools/
+#Unzip the android SDK in ../
+#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 &
+../android-sdk-linux_86/tools/android &
 
 # now go to the available packages tab, check the box and click refresh,
 # and download an SDK Platform
@@ -31,10 +33,10 @@ SDK Platform-tools Version 5, June 2011.
 # Create the android 1.5 (API 3) virtual device
 # (don't make a custom hardware profile)
 # A AVD created with the 1.5 SDK will not work with the newer tools
-../../android-sdk-linux_86/tools/android create avd --name i2p --target 3
+../android-sdk-linux_86/tools/android create avd --name i2p --target 3
 
 #then run the emulator:
-../../android-sdk-linux_86/tools/emulator -avd i2p &
+../android-sdk-linux_86/tools/emulator -avd i2p &
 
 # or to talk to a real phone in debug mode:
 adb kill-server
@@ -46,7 +48,7 @@ adb devices
 ant install
 
 #then run the debugger
-../../android-sdk-linux_86/tools/ddms &
+../android-sdk-linux_86/tools/ddms &
 
 #to rebuild and reinstall to emulator or phone:
 ant reinstall
@@ -54,5 +56,5 @@ ant reinstall
 # Now click on the I2P icon on your phone!
 
 #other helpful commands
-../../android-sdk-linux_86/platform-tools/adb shell
-../../android-sdk-linux_86/platform-tools/adb pull /some/file/on/emulator some-local-dir/
+../android-sdk-linux_86/platform-tools/adb shell
+../android-sdk-linux_86/platform-tools/adb pull /some/file/on/emulator some-local-dir/
diff --git a/build.xml b/build.xml
index 37b241ea8..63f3d8684 100644
--- a/build.xml
+++ b/build.xml
@@ -4,7 +4,7 @@
   -  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
+  -  See licenses/LICENSE-Apache2.0.txt
  -->
 
 <project name="I2PAndroid" default="help">
@@ -86,12 +86,14 @@
 
     <!-- new rules -->
 
+    <property name="i2pbase" value="../i2p.i2p"/>
+
     <target name="buildrouter" depends="-dirs" >
         <!-- build router and core -->
-        <ant dir=".." target="buildrouter" />
+        <ant dir="${i2pbase}" target="buildrouter" />
 
         <!-- router -->
-        <copy file="../build/router.jar" todir="${jar.libs.dir}" />
+        <copy file="${i2pbase}/build/router.jar" todir="${jar.libs.dir}" />
 
         <!-- core -->
 
@@ -99,7 +101,7 @@
              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" >
-            <zipfileset src="../build/i2p.jar" >
+            <zipfileset src="${i2pbase}/build/i2p.jar" >
                 <include name="org/bouncycastle/crypto/Digest.class" />
                 <include name="org/bouncycastle/crypto/Mac.class" />
                 <include name="org/bouncycastle/crypto/digests/GeneralDigest.class" />
@@ -109,7 +111,7 @@
 
         <!-- lots of unneeded stuff could be deleted here -->
         <jar destfile="${jar.libs.dir}/i2p.jar" >
-            <zipfileset src="../build/i2p.jar" >
+            <zipfileset src="${i2pbase}/build/i2p.jar" >
                 <exclude name="net/i2p/util/LogWriter.class" />
                 <exclude name="net/i2p/util/SecureDirectory.class" />
                 <exclude name="net/i2p/util/SecureFile.class" />
@@ -124,8 +126,8 @@
 
     <!-- some resources -->
     <target name="copy-i2p-resources" depends="-dirs" >
-        <copy file="../installer/resources/themes/console/images/i2plogo.png" todir="res/drawable/" />
-        <copy file="../installer/resources/blocklist.txt" tofile="res/raw/blocklist_txt" />
+        <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>
 
     <target name="hackcleanup">
diff --git a/jni/build.sh b/jni/build.sh
index af5d17220..28637a80c 100755
--- a/jni/build.sh
+++ b/jni/build.sh
@@ -7,7 +7,8 @@
 
 THISDIR=$(realpath $(dirname $(which $0)))
 cd $THISDIR
-export NDK=$(realpath ../../../android-ndk-r5b/)
+I2PBASE=../../i2p.i2p
+export NDK=$(realpath ../../android-ndk-r5b/)
 
 #
 # API level, must match that in ../AndroidManifest.xml
@@ -22,7 +23,7 @@ export CC="$NDK/toolchains/$AABI/prebuilt/$SYSTEM/bin/${BINPREFIX}gcc --sysroot=
 
 #echo "CC is $CC"
 
-JBIGI=$(realpath ../../core/c/jbigi)
+JBIGI=$(realpath $I2PBASE/core/c/jbigi)
 GMPVER=4.3.2
 GMP=$JBIGI/gmp-$GMPVER
 
diff --git a/scripts/setversion.sh b/scripts/setversion.sh
index bf4e6b9d8..da24d62c8 100755
--- a/scripts/setversion.sh
+++ b/scripts/setversion.sh
@@ -6,15 +6,16 @@ THISDIR=$(realpath $(dirname $(which $0)))
 cd $THISDIR
 MANIFEST=../AndroidManifest.xml
 TMP=AndroidManifest.xml.tmp
+I2PBASE=../../i2p.i2p
 
-CORE=`grep 'public final static String VERSION' ../../core/java/src/net/i2p/CoreVersion.java | \
+CORE=`grep 'public final static String VERSION' $I2PBASE/core/java/src/net/i2p/CoreVersion.java | \
          cut -d '"' -f 2`
 
 MAJOR=`echo $CORE | cut -d '.' -f 1`
 MINOR=`echo $CORE | cut -d '.' -f 2`
 RELEASE=`echo $CORE | cut -d '.' -f 3`
 
-ROUTERBUILD=$((`grep 'public final static long BUILD' ../../router/java/src/net/i2p/router/RouterVersion.java | \
+ROUTERBUILD=$((`grep 'public final static long BUILD' $I2PBASE/router/java/src/net/i2p/router/RouterVersion.java | \
          cut -d '=' -f 2 | \
          cut -d ';' -f 1`))
 
-- 
GitLab