aboutsummaryrefslogtreecommitdiff
path: root/artifactory.gradle
blob: c6c99645d4b50d55c5b62e301f843431e65ff060 (plain)
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
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'

publishing {
    publications {
        mavenJava(MavenPublication) {
            groupId ddGroup
            artifactId ddArtifactId
            version ddVersion
            artifact "${project.buildDir}/outputs/aar/${project.name}-release.aar"
            artifact sourcesJar
            artifact javadocJar

            pom.withXml { xmlProvider ->
                // Create string from project.ext.pomXml
                def pomString = new StringWriter()
                pomXml.writeTo(pomString)
                pomString = pomString.toString()

                // Replace default xml with pomXml
                def xmlStringBuilder = xmlProvider.asString()
                xmlStringBuilder.setLength(0)
                xmlStringBuilder.append(pomString)
            }
        }
    }
}

artifactory {
    contextUrl = 'http://oss.jfrog.org/artifactory'
    publish {
        repository {
            repoKey = 'oss-snapshot-local'
            username = bintrayUser
            password = bintrayKey
            maven = true
        }
        defaults {
            publications('mavenJava')
        }
    }
}