forked from idelgado/box-android-sdk-v2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·47 lines (40 loc) · 1.51 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -e
# This script provides some extra functionality for building the Box Android SDK
# using Gradle. It takes one optional argument - a path to a build root. A build
# root is a directory where all artifacts and intermediates will be copied to,
# making them easier to archive.
#
# Parameters:
# $1 An optional build root path.
#
# Environment Variables:
# DEBUG If set, a debug build will be installed and no artifacts
# will be uploaded.
# GRADLE_PROP An optional path to a gradle.properties file that will be
# copied into the BoxAndroidLibraryV2 directory.
build_root="$1"
if [ $DEBUG ]; then
echo "Debug build. Artifacts will not be uploaded."
fi
if [ -n "$GRADLE_PROP" ]; then
echo "Copying gradle.properties from $GRADLE_PROP."
cp "$GRADLE_PROP" BoxAndroidLibraryV2/gradle.properties
fi
if [ $DEBUG ]; then
gradle assembleDebug installArchives
else
gradle assemble uploadArchives
fi
if [ -n "$build_root" ]; then
mkdir -p "$build_root/Artifacts" &&
cp -r "BoxAndroidLibraryV2/build/libs/"* "$build_root/Artifacts" &&
cp -r "BoxSDKSample/build/apk/"* "$build_root/Artifacts" &&
cp -r "HelloWorld2/build/apk/"* "$build_root/Artifacts" &&
cp -r "SampleOAuth/build/apk/"* "$build_root/Artifacts"
mkdir -p "$build_root/Intermediates" &&
cp -r "BoxAndroidLibraryV2/build/"* "$build_root/Intermediates" &&
cp -r "BoxSDKSample/build/"* "$build_root/Intermediates" &&
cp -r "HelloWorld2/build/"* "$build_root/Intermediates" &&
cp -r "SampleOAuth/build/"* "$build_root/Intermediates"
fi