build 1.52 KB
Newer Older
sisbell's avatar
sisbell committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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
20

21
22
23
./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_armv7") %] --arch arm --install-dir=./arm
./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_x86") %] --arch x86 --install-dir=./x86
./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_aarch64") %] --arch arm64 --install-dir=./arm64
sisbell's avatar
sisbell committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

# 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'),
        }) %]