Skip to content

Commit 1bfc5e8

Browse files
committed
Fix artifactory configuration.
1 parent 410adb7 commit 1bfc5e8

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

gradle/publish.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,25 @@ artifactoryPublish { task ->
7676
}
7777

7878
artifactory {
79+
gradle.taskGraph.whenReady { taskGraph ->
80+
if (taskGraph.hasTask(artifactoryPublish)) {
81+
// trigger error if missing
82+
bintrayUser
83+
bintrayApiKey
84+
}
85+
}
86+
7987
publish {
8088
contextUrl = forceLocal ? 'http://localhost:8080/artifactory' : 'https://oss.jfrog.org'
8189
repository {
8290
if (forceLocal)
8391
repoKey = isSnapshot ? 'libs-snapshot-local' : 'libs-release-local'
8492
else
8593
repoKey = isSnapshot ? 'oss-snapshot-local' : 'oss-release-local'
86-
gradle.taskGraph.whenReady { taskGraph ->
87-
artifactoryPublish { task ->
88-
if (taskGraph.hasTask(task)) {
89-
username = bintrayUser
90-
password = bintrayApiKey
91-
}
92-
}
94+
95+
if (project.hasProperty("bintrayUser") && project.hasProperty("bintrayApiKey")) {
96+
username = bintrayUser
97+
password = bintrayApiKey
9398
}
9499
}
95100
defaults {

0 commit comments

Comments
 (0)