Commit 10c58d9a authored by sisbell's avatar sisbell Committed by Georg Koppen
Browse files

Bug 26697: Add Android toolchain

parent 6803d9a8
#!/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'),
}) %]
# 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment