Просмотр исходного кода

Updated README(somewhat) added fail guards to the build script

Eugene Fryntov 9 лет назад
Родитель
Сommit
f7f764ec81
2 измененных файлов с 17 добавлено и 5 удалено
  1. 5 5
      MobileLibrary/Android/README.md
  2. 12 0
      MobileLibrary/Android/make.bash

+ 5 - 5
MobileLibrary/Android/README.md

@@ -20,15 +20,15 @@ Note that you may need to use `sudo docker` below, depending on your OS.
   *Ensure that the command below is run from within the `AndroidLibrary` directory*
 
   ```bash
-  cd .. && \
+  cd ../.. && \
     docker run \
     --rm \
     -v $(pwd):/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core \
     psiandroid \
-    /bin/bash -c 'source /tmp/setenv-android.sh && cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/AndroidLibrary && ./make.bash' \
+    /bin/bash -c 'source /tmp/setenv-android.sh && cd /go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/MobileLibrary/Android && ./make.bash' \
   ; cd -
   ```
-When that command completes, the compiled `.aar` file (suitable for use in an Android Studio project) will be located in the current directory (it will likely be owned by root, so be sure to `chown` to an appropriate user).
+When that command completes, the compiled `.aar` files (suitable for use in an Android Studio project) will be located in the current directory (it will likely be owned by root, so be sure to `chown` to an appropriate user).
 
 ###Building without Docker (from source)
 
@@ -49,8 +49,8 @@ When that command completes, the compiled `.aar` file (suitable for use in an An
 
 ###Using the Library
 
- 1. Build `psi.aar` from via the docker container, from source, or use the [binary release](https://github.com/Psiphon-Labs/psiphon-tunnel-core/releases)
- 2. Add `psi.aar` to your Android Studio project as described in the [gomobile documentation](https://godoc.org/golang.org/x/mobile/cmd/gomobile)
+ 1. Build `ca.psiphon.aar` from via the docker container, from source, or use the [binary release](https://github.com/Psiphon-Labs/psiphon-tunnel-core/releases)
+ 2. Add `ca.psiphon..aar` to your Android Studio project as described in the [gomobile documentation](https://godoc.org/golang.org/x/mobile/cmd/gomobile)
  3. Example usage in [TunneledWebView sample app](./SampleApps/TunneledWebView/README.md)
 
 #####Limitations

+ 12 - 0
MobileLibrary/Android/make.bash

@@ -64,9 +64,21 @@ fi
 mkdir -p build-tmp/psi
 unzip -o psi.aar -d build-tmp/psi
 yes | cp -rf PsiphonTunnel/AndroidManifest.xml build-tmp/psi/AndroidManifest.xml
+
 javac -d build-tmp -bootclasspath $ANDROID_HOME/platforms/android-23/android.jar -source 1.7 -target 1.7 -classpath build-tmp/psi/classes.jar:$ANDROID_HOME/platforms/android-23/optional/org.apache.http.legacy.jar PsiphonTunnel/PsiphonTunnel.java 
+if [ $? != 0 ]; then
+  echo "..'javac' compiling PiphonTunnel failed, exiting"
+  exit $?
+fi
+
 cd build-tmp
+
 jar uf psi/classes.jar ca/psiphon/*.class
+if [ $? != 0 ]; then
+  echo "..'jar' failed to add classes, exiting"
+  exit $?
+fi
+
 cd -
 cd build-tmp/psi
 zip -r ../../ca.psiphon.aar ./