bintray.gradle 2.02 KB
Newer Older
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
apply plugin: 'com.jfrog.bintray'

def getBintrayUsername() {
    return project.hasProperty('bintrayUsername') ? property('bintrayUsername') : System.getenv('BINTRAY_USERNAME')
}

def getBintrayApiKey() {
    return project.hasProperty('bintrayApiKey') ? property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
}

def getBintrayGpgPassword() {
    return project.hasProperty('bintrayGpgPassword') ? property('bintrayGpgPassword') : System.getenv('BINTRAY_GPG_PASSWORD')
}

def getMavenCentralUsername() {
    return project.hasProperty('mavenCentralUsername') ? property('mavenCentralUsername') : System.getenv('MAVEN_CENTRAL_USERNAME')
}

def getMavenCentralPassword() {
    return project.hasProperty('mavenCentralPassword') ? property('mavenCentralPassword') : System.getenv('MAVEN_CENTRAL_PASSWORD')
}

def shouldSyncWithMavenCentral() {
    return project.hasProperty('syncWithMavenCentral') ? property('syncWithMavenCentral').toBoolean() : false
}

def dryRunOnly() {
    return project.hasProperty('dryRun') ? property('dryRun').toBoolean() : false
}

bintray {
    user = getBintrayUsername()
    key = getBintrayApiKey()
    override = false
    configurations = ['archives']
    pkg {
        repo = bintrayRepo
        userOrg = bintrayUserOrg
        name = bintrayName
        desc = bintrayDescription
        websiteUrl = projectUrl
        issueTrackerUrl = issuesUrl
        vcsUrl = scmUrl
        licenses = [ POM_LICENSE_NAME ]
        dryRun = dryRunOnly()
        override = false
        publish = true
        publicDownloadNumbers = true
        version {
            name = versionName
            desc = bintrayDescription
            gpg {
                sign = true
                passphrase = getBintrayGpgPassword()
            }
            mavenCentralSync {
                sync = shouldSyncWithMavenCentral()
                user = getMavenCentralUsername()
                password = getMavenCentralPassword()
                close = '1' // If set to 0, you have to manually click release
            }
        }
    }
}