@@ -32,9 +32,11 @@ buildscript {
32
32
33
33
plugins {
34
34
id " org.jetbrains.dokka" version " 1.9.10"
35
+ id " com.vanniktech.maven.publish" version " 0.34.0" apply false
35
36
}
36
37
37
38
39
+
38
40
ext. projectArtifactId = { project ->
39
41
if (project. name == ' places-ktx' ) {
40
42
return project. name
@@ -43,9 +45,6 @@ ext.projectArtifactId = { project ->
43
45
}
44
46
}
45
47
46
- /**
47
- * Shared configs across subprojects
48
- */
49
48
allprojects {
50
49
group = ' com.google.maps.android'
51
50
version = ' 3.3.1'
@@ -60,19 +59,15 @@ allprojects {
60
59
}
61
60
}
62
61
63
- /**
64
- * Publishing and signing info
65
- */
66
62
subprojects { project ->
67
63
if (project. ext. artifactId == null ) return
68
64
69
65
plugins. apply(libs. plugins. androidLibrary. get(). pluginId)
70
66
plugins. apply(libs. plugins. mavenPublish. get(). pluginId)
71
67
plugins. apply(libs. plugins. dokka. get(). pluginId)
72
68
plugins. apply(libs. plugins. jacocoAndroid. get(). pluginId)
73
- plugins. apply(libs. plugins. signing . get(). pluginId)
69
+ plugins. apply(libs. plugins. vanniktech . get(). pluginId)
74
70
75
- // Code coverage
76
71
jacoco {
77
72
toolVersion = " 0.8.7"
78
73
}
@@ -82,90 +77,44 @@ subprojects { project ->
82
77
jacoco. excludes = [' jdk.internal.*' ]
83
78
}
84
79
85
- tasks. register(' sourcesJar' , Jar ) {
86
- from android. sourceSets. main. java. source
87
- archiveClassifier = " sources"
88
- }
80
+ mavenPublishing {
81
+ publishToMavenCentral()
82
+ signAllPublications()
89
83
90
- tasks. register(' javadocJar' , Jar ) {
91
- dependsOn(tasks. named(" dokkaHtml" ))
92
- dependsOn(tasks. named(" dokkaJavadoc" ))
93
- archiveClassifier. set(" javadoc" )
94
- from new File (buildDir, " dokka/javadoc" )
95
- }
84
+ pom {
85
+ name = project. name
86
+ description = " Kotlin extensions (KTX) for Places SDK for Android"
87
+ url = " https://github.com/googlemaps/android-places-ktx"
96
88
97
- publishing {
98
- publications {
99
- aar(MavenPublication ) {
100
- groupId project. group
101
- artifactId project. ext. artifactId
102
- version project. version
103
-
104
- pom {
105
- name = project. name
106
- description = " Kotlin extensions (KTX) for Places SDK for Android"
107
- url = " https://github.com/googlemaps/android-places-ktx"
108
- scm {
109
- connection = ' scm:git@github.com:googlemaps/android-places-ktx.git'
110
- developerConnection = ' scm:git@github.com:googlemaps/android-places-ktx.git'
111
- url = ' https://github.com/googlemaps/android-places-ktx'
112
- }
113
-
114
- licenses {
115
- license {
116
- name = ' The Apache Software License, Version 2.0'
117
- url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
118
- distribution = ' repo'
119
- }
120
- }
121
-
122
- organization {
123
- name = ' Google Inc'
124
- url = ' http://developers.google.com/maps'
125
- }
126
-
127
- developers {
128
- developer {
129
- name = ' Google Inc.'
130
- }
131
- }
89
+ licenses {
90
+ license {
91
+ name = " The Apache Software License, Version 2.0"
92
+ url = " http://www.apache.org/licenses/LICENSE-2.0.txt"
93
+ distribution = " repo"
132
94
}
95
+ }
133
96
134
- pom. withXml {
135
- def dependenciesNode = asNode(). appendNode(' dependencies' )
136
- project. configurations. api. allDependencies. each { dependency ->
137
- def dependencyNode = dependenciesNode. appendNode(' dependency' )
138
- dependencyNode. appendNode(' groupId' , dependency. group)
139
- dependencyNode. appendNode(' artifactId' , dependency. name)
140
- dependencyNode. appendNode(' version' , dependency. version)
141
- }
142
- }
97
+ scm {
98
+ connection = " scm:git@github.com:googlemaps/android-places-ktx.git"
99
+ developerConnection = " scm:git@github.com:googlemaps/android-places-ktx.git"
100
+ url = " https://github.com/googlemaps/android-places-ktx"
101
+ }
143
102
144
- afterEvaluate {
145
- artifact " $buildDir /outputs/aar/$project . name -release.aar"
146
- artifact javadocJar
147
- artifact sourcesJar
148
- }
103
+ organization {
104
+ name = " Google Inc"
105
+ url = " http://developers.google.com/maps"
149
106
}
150
- }
151
107
152
- repositories {
153
- maven {
154
- name = " mavencentral"
155
- url = " https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
156
- credentials {
157
- username sonatypeToken
158
- password sonatypeTokenPassword
108
+ developers {
109
+ developer {
110
+ id = " google"
111
+ name = " Google Inc."
159
112
}
160
113
}
161
114
}
162
115
}
163
-
164
- signing {
165
- sign publishing. publications. aar
166
- }
167
116
}
168
117
169
- tasks. register(' clean' , Delete ) {
118
+ tasks. register(" clean" , Delete ) {
170
119
delete rootProject. layout. buildDirectory
171
120
}
0 commit comments