11plugins {
22 alias(libs. plugins. android. library)
33 alias(libs. plugins. androidx. room)
4+ alias(libs. plugins. jetbrains. dokka)
45 alias(libs. plugins. maven. publish)
5- // id("io.syslogic .gpr.maintenance" )
6+ alias(libs . plugins . gpr. maintenance)
67}
78
89group = " io.syslogic"
@@ -58,6 +59,13 @@ android {
5859 abortOnError = false
5960 showAll = false
6061 }
62+
63+ publishing {
64+ singleVariant(" library" ) {
65+ withSourcesJar()
66+ withJavadocJar()
67+ }
68+ }
6169}
6270
6371dependencies {
@@ -108,16 +116,15 @@ tasks.register("javadoc", Javadoc) {
108116 classpath + = fileTree(dir : project. file(" build/tmp/aarsToJars/" ). absolutePath)
109117 classpath + = implCls
110118 exclude(" **/BuildConfig.java" , " **/R.java" , " **/*.kt" )
111- exclude(" androidx.sqlite.db.SupportSQLiteDatabase" )
112119 failOnError = false
113120
114121 // options.verbose()
115122 // javadoc: warning - The code being documented uses modules but the packages
116123 // defined in https://developer.android.com/reference/ are in the unnamed module.
117124 options. links " https://docs.oracle.com/en/java/javase/17/docs/api/"
118125 options. linksOffline " https://developer.android.com/reference" , " ${ android.sdkDirectory} /docs/reference"
119- options. linkSource true
120- options. author true
126+ options. linkSource = true
127+ options. author = true
121128
122129 onlyIf {
123130 project. file(" build/intermediates/aar_main_jar" ). exists()
@@ -130,19 +137,19 @@ tasks.register("javadoc", Javadoc) {
130137 .filter { it. name. endsWith(" .aar" ) }
131138 .each { aar ->
132139 copy {
133- from zipTree(aar)
134- include " **/classes.jar"
135- into project. file(" build/tmp/aarsToJars/${ aar.name.replace(".aar", "")} /" )
140+ from( zipTree(aar) )
141+ include( " **/classes.jar" )
142+ into( project. file(" build/tmp/aarsToJars/${ aar.name.replace(".aar", "")} /" ) )
136143 }
137144 }
138145
139146 // provide JAR, which contains the generated data-binding classes
140- def aar_main = project. file(" build/intermediates/aar_main_jar" )
141- if (aar_main . exists()) {
147+ def aarMain = project. file(" build/intermediates/aar_main_jar" )
148+ if (aarMain . exists()) {
142149 copy {
143- from aar_main
144- include " **/classes.jar"
145- into project. file(" build/tmp/aarsToJars/aar_main_jar/" )
150+ from(aarMain)
151+ include( " **/classes.jar" )
152+ into( project. file(" build/tmp/aarsToJars/aar_main_jar/" ) )
146153 }
147154 }
148155 }
@@ -163,16 +170,32 @@ tasks.register('sourcesJar', Jar) {
163170 archiveClassifier. set(' sources' )
164171}
165172
166- artifacts {
167- archives(javadocJar)
168- archives(sourcesJar)
169- }
170-
171173afterEvaluate {
172174 publishing {
173-
175+ publications {
176+ register(MavenPublication ) {
177+ from components[" release" ]
178+ groupId = " ${ group_id} "
179+ artifactId = " ${ artifact_id} "
180+ version = libs. versions. app. version. name. get()
181+ artifacts {
182+ archives(javadocJar)
183+ archives(sourcesJar)
184+ }
185+ pom {
186+ name = " ${ plugin_name} "
187+ description = " ${ plugin_desc} "
188+ url = " https://github.com/${ github_handle} /${ artifact_id} "
189+ scm {
190+ connection = " scm:git:git://github.com/${ github_handle} /${ artifact_id} .git"
191+ developerConnection = " scm:git:ssh://github.com/${ github_handle} /${ artifact_id} .git"
192+ url = " https://github.com/${ github_handle} /${ artifact_id} /"
193+ }
194+ }
195+ }
196+ }
174197 repositories {
175- maven {
198+ maven {
176199 name = " GitHubPackages"
177200 url = uri(" https://maven.pkg.github.com/${ project.ext.get("github_handle")} /${ project.ext.get("artifact_id")} " )
178201 if (System . getenv(" GITHUB_ACTOR" ) != null && System . getenv(" GITHUB_ACTOR" ) != null ) {
@@ -183,25 +206,6 @@ afterEvaluate {
183206 }
184207 }
185208 }
186-
187- publications {
188- Default (MavenPublication ) {
189- from(components. getByName(" release" ))
190- groupId = " ${ project.ext.get("group_id")} "
191- artifactId = " ${ project.ext.get("artifact_id")} "
192- version = libs. versions. app. version. name. get()
193- pom {
194- name = " ${ project.ext.get("plugin_name")} "
195- description = " ${ project.ext.get("plugin_desc")} "
196- url = " https://github.com/${ project.ext.get("github_handle")} /${ project.ext.get("artifact_id")} "
197- scm {
198- connection = " scm:git:git://github.com/${ project.ext.get("github_handle")} /${ project.ext.get("artifact_id")} .git"
199- developerConnection = " scm:git:ssh://github.com/${ project.ext.get("github_handle")} /${ project.ext.get("artifact_id")} .git"
200- url = " https://github.com/${ project.ext.get("github_handle")} /${ project.ext.get("artifact_id")} /"
201- }
202- }
203- }
204- }
205209 }
206210}
207211
@@ -210,7 +214,7 @@ if (pluginManager.hasPlugin("io.syslogic.gpr.maintenance")) {
210214 gpr {
211215 groupId = project. ext. get(" group_id" ) // group
212216 packageName = project. ext. get(" artifact_id" ) // repo
213- listPackagesAfterPublish = true
217+ listPackagesAfterPublish = false
214218 deleteLastVersion = true
215219 }
216- }
220+ }
0 commit comments