-
Notifications
You must be signed in to change notification settings - Fork 3
/
bintray.gradle
56 lines (48 loc) · 1.74 KB
/
bintray.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply from: rootProject.file('dependencies.gradle')
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set("sources")
}
publishing {
publications {
MyPublication(MavenPublication) {
groupId versions.groupId
artifactId versions.artifactId
version versions.versionName
pom.withXml {
def dependenciesNode = asNode().getAt('dependencies')[0] ?: asNode().appendNode('dependencies')
configurations.implementation.allDependencies.each {
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
artifact(sourceJar)
artifact("$buildDir/outputs/aar/$versions.artifactId-release.aar")
}
}
}
Properties properties = new Properties()
properties.load(project.rootProject.file('bintray.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintrayUser")
key = properties.getProperty("bintrayApiKey")
publications = ['MyPublication']
pkg {
repo = "maven"
name = "$versions.groupId:$versions.artifactId"
desc = versions.desc
licenses = ['Apache-2.0']
vcsUrl = versions.vsc
version {
name = versions.versionName
vcsTag = versions.versionName
released = new Date()
}
}
}