Skip to content

Commit 406e25f

Browse files
authored
Respect CI's Desired Build Output Location (#68)
* Have alternate build directory for CI runs * Try using file function instead of object constructor
1 parent 5178e17 commit 406e25f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

notification-hubs-sdk/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ def VERSION = '1.0.0-preview1'
55
def PUBLISH_ARTIFACT_ID = 'notification-hubs-android-sdk'
66
def GROUP_ID = 'com.microsoft.azure'
77

8+
def IS_CI = project.hasProperty('isCI') ? Boolean.valueOf(isCI) : false
9+
def REPO_URL = IS_CI ? "file://" + "$System.env.BUILD_ARTIFACTSTAGINGDIRECTORY" : "$buildDir/repo"
10+
811
android {
912
compileSdkVersion rootProject.ext.compileSdkVersion
1013

@@ -68,7 +71,7 @@ task clearJar(type: Delete) {
6871

6972
task writeVersionFile {
7073
doLast {
71-
File versionFileHandle = new File("$buildDir/repo/com/microsoft/azure/notification-hubs-android-sdk/version.txt")
74+
File versionFileHandle = file(REPO_URL + "/com/microsoft/azure/notification-hubs-android-sdk/version.txt")
7275
versionFileHandle.write VERSION
7376
}
7477
}
@@ -97,7 +100,7 @@ afterEvaluate {
97100
repositories {
98101
maven {
99102
name = 'BuildDir'
100-
url = "file://$buildDir/repo"
103+
url = REPO_URL
101104
}
102105
}
103106
}

0 commit comments

Comments
 (0)