@@ -6,6 +6,7 @@ plugins {
6
6
}
7
7
8
8
project.ext.set(" github_handle" , " syslogic" )
9
+ project.ext.set(" group_id" , " io.syslogic" )
9
10
project.ext.set(" plugin_display_name" , " AppGallery Connect Publishing Plugin" )
10
11
project.ext.set(" plugin_description" , " It uploads Android APK/ABB artifacts with AppGallery Connect Publishing API." )
11
12
project.ext.set(" plugin_identifier" , " agconnect-publishing-gradle-plugin" )
@@ -41,21 +42,23 @@ gradlePlugin {
41
42
}
42
43
}
43
44
45
+ configurations.implementation.get().isCanBeResolved = true
46
+
47
+ tasks.withType<Test >().configureEach {
48
+ useJUnitPlatform()
49
+ }
50
+
44
51
tasks.withType<Jar >().configureEach {
45
52
archiveBaseName.set(" ${project.ext.get(" plugin_identifier" )} " )
46
53
archiveVersion.set(" ${project.ext.get(" plugin_version" )} " )
47
54
}
48
55
49
- tasks.withType<Test >().configureEach {
50
- useJUnitPlatform()
51
- }
52
56
53
- tasks.register<Javadoc >(" javadocs" ) {
54
- setDestinationDir(project.file(" /build/outputs/javadoc" ))
57
+ val javadocs by tasks.registering(Javadoc ::class ) {
55
58
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 " )
59
+ classpath + = configurations.implementation.get().asFileTree.filter {it.extension == " jar " }
60
+ setDestinationDir(project.file( " /build/outputs/javadoc " ))
61
+ source = sourceSets.main.get().allJava
59
62
// options.links = "https://docs.oracle.com/en/java/javase/17/docs/api/"
60
63
// options.linkSource = true
61
64
// options.author = true
@@ -65,15 +68,15 @@ tasks.register<Javadoc>("javadocs") {
65
68
val javadocJar by tasks.registering(Jar ::class ) {
66
69
archiveClassifier.set(" javadoc" )
67
70
from(project.file(" /build/outputs/javadoc" ))
68
- dependsOn(" javadocs" )
71
+ dependsOn(javadocs)
69
72
}
70
73
71
74
val sourcesJar by tasks.registering(Jar ::class ) {
72
75
archiveClassifier.set(" sources" )
73
- from(sourceSets.getByName( " main" ).java.srcDirs)
76
+ from(sourceSets.main.get( ).java.srcDirs)
74
77
}
75
78
76
- group = " io.syslogic "
79
+ group = " ${project.ext.get( " group_id " )} "
77
80
version = " ${project.ext.get(" plugin_version" )} "
78
81
artifacts {
79
82
archives(javadocJar)
@@ -85,7 +88,7 @@ afterEvaluate {
85
88
publications {
86
89
create<MavenPublication >(" release" ) {
87
90
from(components.getByName(" java" ))
88
- groupId = " io.syslogic "
91
+ groupId = " ${project.ext.get( " group_id " )} "
89
92
artifactId = " ${project.ext.get(" plugin_identifier" )} "
90
93
version = " ${project.ext.get(" plugin_version" )} "
91
94
pom {
0 commit comments