-
Notifications
You must be signed in to change notification settings - Fork 2
/
jenkins-release.groovy
53 lines (42 loc) · 2.46 KB
/
jenkins-release.groovy
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
48
49
50
51
52
53
@Library('pipeline-library') _
abis = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
// Sets up the environment to build Android projects.
node("android-build-jdk8") {
stage('Checkout SCM') { checkout scm }
stage('Compile Library') {
sh './gradlew :library:assembleRelease'
archiveArtifacts '**/*.aar'
}
stage('Compile Application') {
withCredentials([
file(credentialsId: 'keystoreFileAndroid', variable: 'KEYSTORE_FILE'),
string(credentialsId: 'keystorePasswordAndroid', variable: 'KEYSTORE_PASSWORD'),
string(credentialsId: 'keystoreAliasSample', variable: 'KEYSTORE_ALIAS'),
string(credentialsId: 'aliasPasswordSample', variable: 'ALIAS_PASSWORD'),
string(credentialsId: 'fastDownwardFirebaseProjectID', variable: 'fastDownwardFirebaseProjectID'),
string(credentialsId: 'fastDownwardFirebaseGoogleAppID', variable: 'fastDownwardFirebaseGoogleAppID'),
string(credentialsId: 'fastDownwardFirebaseWebClientID', variable: 'fastDownwardFirebaseWebClientID'),
string(credentialsId: 'fastDownwardFirebaseGCMSenderID', variable: 'fastDownwardFirebaseGCMSenderID'),
string(credentialsId: 'fastDownwardFirebaseGoogleAPIKey', variable: 'fastDownwardFirebaseGoogleAPIKey'),
string(credentialsId: 'fastDownwardFirebaseCrashlyticsAPIKey', variable: 'fastDownwardFirebaseCrashlyticsAPIKey'),
]) {
for (abi in abis) {
echo "Compiling split APK for $abi..."
sh "./gradlew :app:assembleRelease -PABIS=$abi"
// KLUDGE: by building it twice, we make sure the asset python-modules.zip is found
echo "Recompiling split APK for $abi..."
sh "./gradlew :app:assembleRelease -PABIS=$abi"
echo "Archiving split APK for $abi..."
archiveArtifacts "**/*-$abi-*.apk"
}
// Also build the universal APK
echo "Compiling universal APK for $abis..."
sh "./gradlew :app:assembleRelease -PABIS=\"${abis.join(';')}\""
// KLUDGE: by building it twice, we make sure the asset python-modules.zip is found
echo "Recompiling universal APK for $abis..."
sh "./gradlew :app:assembleRelease -PABIS=\"${abis.join(';')}\""
echo "Archiving universal APK for $abis..."
archiveArtifacts "**/*.apk"
}
}
}