[tbb-commits] [tor-browser-build/master] Bug 26697: Add Android toolchain
gk at torproject.org
gk at torproject.org
Thu Oct 25 10:27:58 UTC 2018
commit 10c58d9a2f9fc37f7ba3e1b7028d2b5a730b1e6f
Author: sisbell <shane.isbell at gmail.com>
Date: Thu Sep 27 20:44:56 2018 -0700
Bug 26697: Add Android toolchain
---
projects/android-toolchain/build | 43 +++++++++++++++++++++++++++++++++++++++
projects/android-toolchain/config | 36 ++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+)
diff --git a/projects/android-toolchain/build b/projects/android-toolchain/build
new file mode 100644
index 0000000..325a543
--- /dev/null
+++ b/projects/android-toolchain/build
@@ -0,0 +1,43 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+export PROJECT_PATH=/var/tmp/dist/[% project %]
+export SDK_HOME=$PROJECT_PATH/android-sdk-linux
+export NDK_HOME=$PROJECT_PATH/android-ndk
+export GRADLE_HOME=$PROJECT_PATH/gradle
+
+#Make directories
+mkdir -p $NDK_HOME $SDK_HOME $GRADLE_HOME
+
+# Compiler Archives
+unzip -qq [% c("input_files_by_name/android_sdk_tools") %] -d $SDK_HOME
+unzip -qq [% c("input_files_by_name/android_ndk_compiler")%] -d $NDK_HOME
+unzip -qq [% c("input_files_by_name/gradle_bin") %] -d $GRADLE_HOME
+
+# NDK Archive
+cd $NDK_HOME
+mv android-ndk-r15c/* .
+rm -fR android-ndk-r15c
+./build/tools/make_standalone_toolchain.py --api 26 --arch arm --install-dir=./arm
+
+# Tool Archives
+cd $SDK_HOME
+unzip -qq $HOME/[% c("input_files_by_name/build_tools_26") %] -d $SDK_HOME
+mkdir -p build-tools/26.0.2
+mv android-8.1.0/* build-tools/26.0.2
+
+unzip -qq $HOME/[% c("input_files_by_name/platform_26") %] -d $SDK_HOME
+mkdir -p platforms/android-26
+mv android-8.0.0/* platforms/android-26
+
+unzip -qq $HOME/[% c("input_files_by_name/platform_tools_26") %] -d $SDK_HOME
+
+# Cleanup
+rm -fR android-8.1.0
+rm -fR android-8.0.0
+
+# Archive dist directory
+cd /var/tmp/dist
+[% c('tar', {
+ tar_src => [ project ],
+ tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
+ }) %]
diff --git a/projects/android-toolchain/config b/projects/android-toolchain/config
new file mode 100644
index 0000000..122ae5f
--- /dev/null
+++ b/projects/android-toolchain/config
@@ -0,0 +1,36 @@
+# vim: filetype=yaml sw=2
+filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
+version: 26.0.2
+var:
+ container:
+ use_container: 1
+ deps:
+ - unzip
+ - python
+ setup: |
+ mkdir -p /var/tmp/dist
+ tar -C /var/tmp/dist -xf $rootdir/[% c("compiler_tarfile") %]
+ export ANDROID_SDK_HOME=/var/tmp/dist/[% project %]/android-sdk-linux
+ export ANDROID_NDK_HOME=/var/tmp/dist/[% project %]/android-ndk
+ export GRADLE_HOME=/var/tmp/dist/[% project %]/gradle
+ google_repo: https://dl.google.com/android/repository
+input_files:
+ - project: container-image
+ - URL: '[% c("var/google_repo") %]/build-tools_r26.0.2-linux.zip'
+ name: build_tools_26
+ sha256sum: a752849fac85c4a7f9ea165ec8f367b0ebe8bbf6a1f33fc8605342be004231ce
+ - URL: '[% c("var/google_repo") %]/platform-26_r02.zip'
+ name: platform_26
+ sha256sum: 2aafa7d19c5e9c4b643ee6ade3d85ef89dc2f79e8383efdb9baf7fddad74b52a
+ - URL: '[% c("var/google_repo") %]/platform-tools_r26.0.2-linux.zip'
+ name: platform_tools_26
+ sha256sum: 63b15a38c2b64e6ec8b54febe9f69fce5fe6c898c554c73b826b49daf7b52519
+ - URL: '[% c("var/google_repo") %]/sdk-tools-linux-4333796.zip'
+ name: android_sdk_tools
+ sha256sum: 92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9
+ - URL: '[% c("var/google_repo") %]/android-ndk-r15c-linux-x86_64.zip'
+ name: android_ndk_compiler
+ sha256sum: f01788946733bf6294a36727b99366a18369904eb068a599dde8cca2c1d2ba3c
+ - URL: http://services.gradle.org/distributions/gradle-4.1-bin.zip
+ name: gradle_bin
+ sha256sum: d55dfa9cfb5a3da86a1c9e75bb0b9507f9a8c8c100793ccec7beb6e259f9ed43
More information about the tbb-commits
mailing list