-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
39 lines (35 loc) · 1.52 KB
/
build.gradle
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
plugins {
id 'maven-publish'
id 'com.jfrog.artifactory' version '5.2.5'
// For JShell support
// https://gitlab.com/barfuin/gradle-taskinfo
id 'org.barfuin.gradle.taskinfo' version '2.2.0'
id 'com.github.mrsarm.jshell.plugin' version '1.2.1'
}
def artifactory_repo_key = System.getenv("ARTIFACTORY_REPO_KEY") != null ? System.getenv("ARTIFACTORY_REPO_KEY") : 'libs-snapshot-local'
def artifactory_username = System.getenv('ARTIFACTORY_USERNAME')
def artifactory_password = System.getenv('ARTIFACTORY_PASSWORD')
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(artifactoryPublish) &&
(artifactory_username == null || artifactory_password == null)) {
throw new GradleException("Set env vars ARTIFACTORY_USERNAME and ARTIFACTORY_PASSWORD to publish")
}
}
artifactory {
publish {
contextUrl = "https://broadinstitute.jfrog.io/broadinstitute/"
repository {
repoKey = "${artifactory_repo_key}"
// The Artifactory repository key to publish to
username = "${artifactory_username}" // The publisher user name
password = "${artifactory_password}" // The publisher password
}
defaults {
// This is how we tell the Artifactory Plugin which artifacts should be published to Artifactory.
// Reference to Gradle publications defined in the build script.
publications("workspaceManagerClientLibrary")
publishArtifacts = true
publishPom = true
}
}
}