build 1.2 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. output_dir=[% dest_dir %]/[% c('filename') %]
  4. gradle_repo=$rootdir/[% c('input_files_by_name/gradle-dependencies') %]
  5. export GRADLE_MAVEN_REPO="file://$gradle_repo"
  6. # The download script assumes artifact package name is the complete URL path.
  7. # In some cases this is incorrect, so copy those artifacts to correct location
  8. cp -r $gradle_repo/guardianproject/gpmaven/master/* $gradle_repo
  9. cp -r $gradle_repo/dl/android/maven2/* $gradle_repo
  10. cp -r $gradle_repo/maven2/* $gradle_repo
  11. cp -r $gradle_repo/plugins-release/* $gradle_repo
  12. mkdir -p /var/tmp/build $output_dir
  13. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  14. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  15. # Patch projects
  16. cd /var/tmp/build/[% project %]-[% c('version') %]
  17. patch -p1 < $rootdir/maven-repo.patch
  18. patch -p1 < $rootdir/add_socks_port_flags.patch
  19. patch -p1 < $rootdir/30284.patch
  20. # Build Android Libraries and Apps
  21. $GRADLE_HOME/gradle-4.1/bin/gradle --offline -P androidplugin=3.0.1 assembleRelease -x lint
  22. # Package
  23. cp universal/build/libs/* android/build/outputs/aar/* $output_dir