build 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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-r17b/* .
  16. rm -fR android-ndk-r17b
  17. # The architectures we support
  18. ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_armv7") %] --arch arm --install-dir=./arm
  19. ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_aarch64") %] --arch arm64 --install-dir=./arm64
  20. ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_x86") %] --arch x86 --install-dir=./x86
  21. ./build/tools/make_standalone_toolchain.py --api [% c("var/android_min_api_x86_64") %] --arch x86_64 --install-dir=./x86_64
  22. # Tool Archives
  23. cd $SDK_HOME
  24. unzip -qq $HOME/[% c("input_files_by_name/build_tools") %] -d $SDK_HOME
  25. mkdir -p build-tools/27.0.3
  26. mv android-8.1.0/* build-tools/27.0.3
  27. unzip -qq $HOME/[% c("input_files_by_name/platform") %] -d $SDK_HOME
  28. mkdir -p platforms/android-28
  29. mv android-9/* platforms/android-28
  30. unzip -qq $HOME/[% c("input_files_by_name/platform_tools") %] -d $SDK_HOME
  31. # Cleanup
  32. rm -fR android-8.1.0
  33. rm -fR android-9
  34. # Archive dist directory
  35. cd /var/tmp/dist
  36. [% c('tar', {
  37. tar_src => [ project ],
  38. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  39. }) %]