summaryrefslogtreecommitdiff
path: root/build_java.sh
diff options
context:
space:
mode:
authorcos <cos>2020-03-22 19:08:12 +0100
committercos <cos>2020-03-22 19:08:12 +0100
commit5151e6766f3686a8bef475fc90aee794274ab3c9 (patch)
tree21a6abfdce2ac6035a397a3e356e39485ca4df76 /build_java.sh
downloadhello_rust_example-android-5151e6766f3686a8bef475fc90aee794274ab3c9.zip
Initial (and likely only) commitHEADmaster
Diffstat (limited to 'build_java.sh')
-rw-r--r--build_java.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/build_java.sh b/build_java.sh
new file mode 100644
index 0000000..6fa5a4a
--- /dev/null
+++ b/build_java.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -e
+
+ANDROID_PATH="/usr/lib/android-sdk/"
+BUILD_TOOLS="24.0.2"
+AAPT="${ANDROID_PATH}/build-tools/${BUILD_TOOLS}/aapt"
+PLATFORM="${ANDROID_PATH}/platforms/android-24/android.jar"
+JAVAOPTS="-d obj -classpath src -bootclasspath $PLATFORM -source 1.7 -target 1.7"
+
+echo "Generating R.java file..."
+$AAPT package -f -m -J src -M AndroidManifest.xml -S res -I $PLATFORM
+
+echo "Compiling..."
+javac $JAVAOPTS src/rs/cph/hellorust/MainActivity.java
+javac $JAVAOPTS src/rs/cph/hellorust/R.java