build 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. export PROJECT_PATH=/var/tmp/dist/[% project %]
  4. export SDK_HOME=$PROJECT_PATH/android-sdk-linux
  5. export NDK_HOME=$PROJECT_PATH/android-ndk
  6. export GRADLE_HOME=$PROJECT_PATH/gradle
  7. #Make directories
  8. mkdir -p $NDK_HOME $SDK_HOME $GRADLE_HOME
  9. # Compiler Archives
  10. unzip -qq [% c("input_files_by_name/android_sdk_tools") %] -d $SDK_HOME
  11. unzip -qq [% c("input_files_by_name/android_ndk_compiler")%] -d $NDK_HOME
  12. unzip -qq [% c("input_files_by_name/gradle_bin") %] -d $GRADLE_HOME
  13. # NDK Archive
  14. cd $NDK_HOME
  15. mv android-ndk-r15c/* .
  16. rm -fR android-ndk-r15c
  17. ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_armv7") %] --arch arm --install-dir=./arm
  18. ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_x86") %] --arch x86 --install-dir=./x86
  19. ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_aarch64") %] --arch arm64 --install-dir=./arm64
  20. # Tool Archives
  21. cd $SDK_HOME
  22. unzip -qq $HOME/[% c("input_files_by_name/build_tools_26") %] -d $SDK_HOME
  23. mkdir -p build-tools/26.0.2
  24. mv android-8.1.0/* build-tools/26.0.2
  25. unzip -qq $HOME/[% c("input_files_by_name/platform_26") %] -d $SDK_HOME
  26. mkdir -p platforms/android-26
  27. mv android-8.0.0/* platforms/android-26
  28. unzip -qq $HOME/[% c("input_files_by_name/platform_tools_26") %] -d $SDK_HOME
  29. # Cleanup
  30. rm -fR android-8.1.0
  31. rm -fR android-8.0.0
  32. # Archive dist directory
  33. cd /var/tmp/dist
  34. [% c('tar', {
  35. tar_src => [ project ],
  36. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  37. }) %]