@@ -18,38 +18,17 @@ if (signingFile.exists()) {
18
18
}
19
19
}
20
20
21
- task androidJavadocs (type : Javadoc ) {
22
- source = android. sourceSets. main. java. srcDirs
23
- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
24
- android. libraryVariants. all { variant ->
25
- if (variant. name == ' release' ) {
26
- owner. classpath + = variant. getCompileClasspath()
27
- }
28
- }
29
- exclude ' **/R.html' , ' **/R.*.html' , ' **/index.html'
30
- }
31
-
32
- task androidJavadocsJar (type : Jar , dependsOn : androidJavadocs) {
33
- archiveClassifier. set(" javadoc" )
34
- from androidJavadocs. destinationDir
35
- }
36
-
37
- task androidSourcesJar (type : Jar ) {
38
- archiveClassifier. set(" sources" )
39
- from android. sourceSets. main. java. srcDirs
40
- }
41
-
42
21
publishing {
43
22
publications {
44
- HMSSDK (MavenPublication ) {
23
+ release (MavenPublication ) {
45
24
46
25
groupId mavenGroupId
47
26
artifactId mavenArtifact
48
27
version android. defaultConfig. versionName
49
28
50
- artifact " $b uildDir /outputs/aar/hms-plugin-release.aar "
51
- artifact androidJavadocsJar
52
- artifact androidSourcesJar
29
+ afterEvaluate {
30
+ from components . release
31
+ }
53
32
54
33
pom {
55
34
name = " Batch.com Android HMS SDK"
@@ -88,37 +67,6 @@ publishing {
88
67
url = " https://batch.com"
89
68
}
90
69
}
91
-
92
- pom. withXml {
93
- final dependenciesNode = asNode(). appendNode(' dependencies' )
94
- ext. addDependency = { Dependency dep , String scope ->
95
- if (dep. group == null || dep. version == null || dep. name == null || dep. name == " unspecified" )
96
- return // ignore invalid dependencies
97
-
98
- final dependencyNode = dependenciesNode. appendNode(' dependency' )
99
- dependencyNode. appendNode(' groupId' , dep. group)
100
- dependencyNode. appendNode(' artifactId' , dep. name)
101
- dependencyNode. appendNode(' version' , dep. version)
102
- dependencyNode. appendNode(' scope' , scope)
103
-
104
- if (! dep. transitive) {
105
- // If this dependency is transitive, we should force exclude all its dependencies them from the POM
106
- final exclusionNode = dependencyNode. appendNode(' exclusions' ). appendNode(' exclusion' )
107
- exclusionNode. appendNode(' groupId' , ' *' )
108
- exclusionNode. appendNode(' artifactId' , ' *' )
109
- } else if (! dep. properties. excludeRules. empty) {
110
- // Otherwise add specified exclude rules
111
- final exclusionNode = dependencyNode. appendNode(' exclusions' ). appendNode(' exclusion' )
112
- dep. properties. excludeRules. each { ExcludeRule rule ->
113
- exclusionNode. appendNode(' groupId' , rule. group ?: ' *' )
114
- exclusionNode. appendNode(' artifactId' , rule. module ?: ' *' )
115
- }
116
- }
117
- }
118
-
119
- configurations. api. getDependencies(). each { dep -> addDependency(dep, " compile" ) }
120
- configurations. implementation. getDependencies(). each { dep -> addDependency(dep, " runtime" ) }
121
- }
122
70
}
123
71
}
124
72
@@ -140,7 +88,7 @@ publishing {
140
88
}
141
89
142
90
signing {
143
- sign publishing. publications. HMSSDK
91
+ sign publishing. publications. release
144
92
}
145
93
146
94
// Do not sign if we run the publishToMavenLocal task, useful for dev
0 commit comments