build 1.66 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
#!/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
18
19
mv android-ndk-r17b/* .
rm -fR android-ndk-r17b
20

21
# The architectures we support
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_aarch64") %] --arch arm64 --install-dir=./arm64
24
25
./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_x86_64") %] --arch x86_64 --install-dir=./x86_64
sisbell's avatar
sisbell committed
26
27
28

# Tool Archives
cd $SDK_HOME
29
30
31
unzip -qq $HOME/[% c("input_files_by_name/build_tools") %] -d $SDK_HOME
mkdir -p build-tools/27.0.3
mv android-8.1.0/* build-tools/27.0.3
sisbell's avatar
sisbell committed
32

33
34
35
unzip -qq $HOME/[% c("input_files_by_name/platform") %] -d $SDK_HOME
mkdir -p platforms/android-28
mv android-9/* platforms/android-28
sisbell's avatar
sisbell committed
36

37
unzip -qq $HOME/[% c("input_files_by_name/platform_tools") %] -d $SDK_HOME
sisbell's avatar
sisbell committed
38
39
40

# Cleanup
rm -fR android-8.1.0
41
rm -fR android-9
sisbell's avatar
sisbell committed
42
43
44
45
46
47
48

# Archive dist directory
cd /var/tmp/dist
[% c('tar', {
        tar_src => [ project ],
        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
        }) %]