build 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. # The architectures we support
  18. archs="arm x86"
  19. for arch in $archs; do
  20. # API 16 is the minimum we currently support for Tor Browser on Android for
  21. # 32bit.
  22. ./build/tools/make_standalone_toolchain.py --api 16 --arch $arch --install-dir=./$arch
  23. done
  24. # Tool Archives
  25. cd $SDK_HOME
  26. unzip -qq $HOME/[% c("input_files_by_name/build_tools_26") %] -d $SDK_HOME
  27. mkdir -p build-tools/26.0.2
  28. mv android-8.1.0/* build-tools/26.0.2
  29. unzip -qq $HOME/[% c("input_files_by_name/platform_26") %] -d $SDK_HOME
  30. mkdir -p platforms/android-26
  31. mv android-8.0.0/* platforms/android-26
  32. unzip -qq $HOME/[% c("input_files_by_name/platform_tools_26") %] -d $SDK_HOME
  33. # Cleanup
  34. rm -fR android-8.1.0
  35. rm -fR android-8.0.0
  36. # Archive dist directory
  37. cd /var/tmp/dist
  38. [% c('tar', {
  39. tar_src => [ project ],
  40. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  41. }) %]