From ca0dc74c9d4ed2a3bd8c1f0fa0013c66c917ff2a Mon Sep 17 00:00:00 2001 From: Cervator Date: Sat, 30 Oct 2021 23:37:48 -0500 Subject: [PATCH] Make Jenkinsfile Android sub-checkout dynamic --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 984e86eec..5e8ac3b0a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,16 @@ node ("android") { stage('Build Android') { sh 'echo sdk.dir=/opt/android-sdk > local.properties' dir('android') { - checkout scm: [$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/MovingBlocks/DestSolAndroid.git']]] + // Allow varying from the default Android repo path for easier development. Assume same Android branch as engine branch. + def androidGitPath = "https://github.com/MovingBlocks/DestSolAndroid.git" + if (env.PUBLISH_ORG) { + androidGitPath = androidGitPath.replace("MovingBlocks", env.PUBLISH_ORG) + println "Updated target Android Git path to: " + androidGitPath + println "And going to use branch " + env.BRANCH_NAME + } else { + println "Not varying the Android path from default " + androidGitPath + } + checkout scm: [$class: 'GitSCM', branches: [[name: env.BRANCH_NAME]], extensions: [], userRemoteConfigs: [[url: androidGitPath]]] } sh './gradlew --console=plain :android:assembleDebug' archiveArtifacts 'android/build/outputs/apk/debug/android-debug.apk'