-
Notifications
You must be signed in to change notification settings - Fork 17
/
publishing.gradle
116 lines (101 loc) · 3.7 KB
/
publishing.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
apply plugin: "com.jfrog.bintray"
afterEvaluate { project ->
apply plugin: "maven-publish"
apply plugin: "com.github.dcendents.android-maven"
def versionName = android.defaultConfig.versionName
task androidJavadocs(type: Javadoc) {
failOnError = false
source = android.sourceSets.main.java.source
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = "javadoc"
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = "sources"
from android.sourceSets.main.java.source
}
bintray {
dryRun = false
publish = true
override = true
user = project.property("bintray.user")
key = project.property("bintray.apikey")
publications("release")
pkg {
publish = true
repo = "icon-dialog"
name = publishGroupId + ":" + publishArtifactId
desc = publishDescription
websiteUrl = publishRepoUrl
issueTrackerUrl = publishRepoIssues
vcsUrl = publishRepoUrl
githubRepo = publishGithubRepo
githubReleaseNotesFile = publishGithubReadme
publicDownloadNumbers = true
licenses = [publishLicense]
version {
name = versionName
vcsTag = versionName
released = new Date()
gpg {
sign = true
}
mavenCentralSync {
sync = true
user = project.property("ossrhUsername")
password = project.property("ossrhPassword")
close = "1"
}
}
}
}
def pomConfig = {
licenses {
license {
name publishLicenseName
url publishLicenseUrl
}
}
developers {
developer {
id publishDeveloperId
}
}
scm {
url publishRepoUrl
connection publishRepoConnection
developerConnection publishRepoConnection
}
}
publishing {
publications {
release(MavenPublication) {
groupId publishGroupId
artifactId publishArtifactId
version versionName
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
artifact androidSourcesJar
artifact androidJavadocsJar
pom.withXml {
asNode().appendNode("name", publishName)
asNode().appendNode("description", publishDescription)
asNode().appendNode("url", publishRepoUrl)
def dependenciesNode = asNode().appendNode("dependencies")
configurations.implementation.allDependencies.each {
// Ensure dependencies such as fileTree are not included.
if (it.name != "unspecified" && it.version != "unspecified") {
def dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
dependencyNode.appendNode("version", it.version)
dependencyNode.appendNode("scope", "compile")
}
}
asNode().children().last() + pomConfig
}
}
}
}
}