• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Artifactory
3// ./gradlew artifactoryPublish (upload snapshot to jfrog)
4// ./gradlew bintrayUpload (upload release to JCenter)
5//
6
7apply plugin: 'com.jfrog.bintray'
8apply plugin: 'com.jfrog.artifactory'
9
10Properties properties = new Properties()
11try {
12    properties.load(project.rootProject.file('local.properties').newDataInputStream())
13} catch (FileNotFoundException ignore) {}
14
15group = 'org.testng'
16
17bintray {
18    user = properties.getProperty("bintray.user")
19    key = properties.getProperty("bintray.apikey")
20    publications = ['mavenCustom']
21    // Without this, javadocs don't get uploaded
22    configurations = ['archives']
23    pkg {
24        repo = 'maven'
25        name = 'testng'
26        desc = 'Testing framework for Java'
27        licenses = ['Apache-2.0']
28        labels = ['testng']
29
30        version {
31            name = project.version //Bintray logical version name
32            gpg {
33                // Without this, .asc files don't get generated
34                sign = true
35            }
36
37        }
38    }
39}
40
41artifactory {
42    def a_user = hasProperty('artifactory_user') ? artifactory_user : System.getenv('artifactory_user')
43    def a_password = hasProperty('artifactory_password') ? artifactory_password : System.getenv('artifactory_password')
44    def a_contextUrl = hasProperty('artifactory_contextUrl') ? artifactory_password : System.getenv('artifactory_contextUrl')
45
46    contextUrl = "${a_contextUrl}"
47    //The base Artifactory URL if not overridden by the publisher/resolver
48    publish {
49        repository {
50            repoKey = 'oss-snapshot-local'
51            username = "${a_user}"
52            password = "${a_password}"
53            maven = true
54
55        }
56        defaults {
57            publications('mavenCustom')
58        }
59
60    }
61    resolve {
62        repository {
63            repoKey = 'libs-snapshot'
64            username = "${a_user}"
65            password = "${a_password}"
66            maven = true
67
68        }
69    }
70}
71