build 1.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
[% c("var/set_default_env") -%]
output_dir=[% dest_dir %]/[% c('filename') %]
gradle_repo=$rootdir/[% c('input_files_by_name/gradle-dependencies') %]
export GRADLE_MAVEN_REPO="file://$gradle_repo"

# The download script assumes artifact package name is the complete URL path.
# In some cases this is incorrect, so copy those artifacts to correct location
cp -r $gradle_repo/guardianproject/gpmaven/master/* $gradle_repo
cp -r $gradle_repo/dl/android/maven2/* $gradle_repo
cp -r $gradle_repo/maven2/* $gradle_repo
12
cp -r $gradle_repo/plugins-release/* $gradle_repo
13
14
15
16
17
18
19
20
21

mkdir -p /var/tmp/build $output_dir

[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz

# Patch projects
cd /var/tmp/build/[% project %]-[% c('version') %]
patch -p1 < $rootdir/maven-repo.patch
22
patch -p1 < $rootdir/add_socks_port_flags.patch
23
patch -p1 < $rootdir/30284.patch
24
25
26
27
28
29

# Build Android Libraries and Apps
$GRADLE_HOME/gradle-4.1/bin/gradle --offline -P androidplugin=3.0.1 assembleRelease -x lint

# Package
cp universal/build/libs/* android/build/outputs/aar/* $output_dir