@@ -6,6 +6,7 @@ plugins {
66}
77
88project.ext.set(" github_handle" , " syslogic" )
9+ project.ext.set(" group_id" , " io.syslogic" )
910project.ext.set(" plugin_display_name" , " AppGallery Connect Publishing Plugin" )
1011project.ext.set(" plugin_description" , " It uploads Android APK/ABB artifacts with AppGallery Connect Publishing API." )
1112project.ext.set(" plugin_identifier" , " agconnect-publishing-gradle-plugin" )
@@ -41,21 +42,27 @@ gradlePlugin {
4142 }
4243}
4344
45+
46+ tasks.withType<Test >().configureEach {
47+ useJUnitPlatform()
48+ }
49+
4450tasks.withType<Jar >().configureEach {
4551 archiveBaseName.set(" ${project.ext.get(" plugin_identifier" )} " )
4652 archiveVersion.set(" ${project.ext.get(" plugin_version" )} " )
4753}
4854
49- tasks.withType<Test >().configureEach {
50- useJUnitPlatform()
55+ // Gradle 9.0 deprecation fix
56+ val implCls: Configuration by configurations.creating {
57+ extendsFrom(configurations.getByName(" implementation" ))
58+ isCanBeResolved = true
5159}
5260
53- tasks.register<Javadoc >(" javadocs" ) {
54- setDestinationDir(project.file(" /build/outputs/javadoc" ))
61+ val javadocs by tasks.registering(Javadoc ::class ) {
5562 title = " ${project.ext.get(" plugin_display_name" )} ${project.ext.get(" plugin_version" )} API"
56- source = sourceSets.getByName( " main " ).java
57- classpath = files( File ( System .getProperty( " java.home " ) + File .separator + " lib " + File .separator + " rt.jar " ))
58- classpath + = configurations.getByName( " implementation " )
63+ classpath + = implCls.asFileTree.filter {it.extension == " jar " }
64+ setDestinationDir(project.file( " /build/outputs/javadoc " ))
65+ source = sourceSets.main.get().allJava
5966 // options.links = "https://docs.oracle.com/en/java/javase/17/docs/api/"
6067 // options.linkSource = true
6168 // options.author = true
@@ -65,15 +72,15 @@ tasks.register<Javadoc>("javadocs") {
6572val javadocJar by tasks.registering(Jar ::class ) {
6673 archiveClassifier.set(" javadoc" )
6774 from(project.file(" /build/outputs/javadoc" ))
68- dependsOn(" javadocs" )
75+ dependsOn(javadocs)
6976}
7077
7178val sourcesJar by tasks.registering(Jar ::class ) {
7279 archiveClassifier.set(" sources" )
73- from(sourceSets.getByName( " main" ).java.srcDirs)
80+ from(sourceSets.main.get( ).java.srcDirs)
7481}
7582
76- group = " io.syslogic "
83+ group = " ${project.ext.get( " group_id " )} "
7784version = " ${project.ext.get(" plugin_version" )} "
7885artifacts {
7986 archives(javadocJar)
@@ -85,7 +92,7 @@ afterEvaluate {
8592 publications {
8693 create<MavenPublication >(" release" ) {
8794 from(components.getByName(" java" ))
88- groupId = " io.syslogic "
95+ groupId = " ${project.ext.get( " group_id " )} "
8996 artifactId = " ${project.ext.get(" plugin_identifier" )} "
9097 version = " ${project.ext.get(" plugin_version" )} "
9198 pom {
0 commit comments