@@ -6,61 +6,61 @@ plugins {
66 `maven- publish`
77 signing
88 id(" io.github.gradle-nexus.publish-plugin" ) version " 1.1.0"
9+
10+ `java- gradle- plugin`
11+ id(" com.gradle.plugin-publish" ) version " 0.18.0"
912}
1013
11- allprojects {
12- apply {
13- plugin(" java-library" )
14- plugin(" com.github.johnrengelman.shadow" )
15- }
14+ group = " org.glavo"
15+ version = " 2.0" // + "-SNAPSHOT"
1616
17- group = " org.glavo"
18- version = " 2.0-RC1" + " -SNAPSHOT"
17+ repositories {
18+ mavenCentral()
19+ }
1920
20- repositories {
21- mavenCentral()
22- }
21+ tasks.compileJava {
22+ sourceCompatibility = " 1.8"
23+ targetCompatibility = " 1.8"
24+ }
2325
24- tasks.compileJava {
25- sourceCompatibility = " 1.8"
26- targetCompatibility = " 1.8"
27- }
28-
29- tasks.withType<Javadoc >().configureEach {
30- (options as StandardJavadocDocletOptions ).also {
31- it.encoding(" UTF-8" )
32- it.addStringOption(" link" , " https://docs.oracle.com/en/java/javase/17/docs/api/" )
33- it.addBooleanOption(" html5" , true )
34- it.addStringOption(" Xdoclint:none" , " -quiet" )
35- }
26+ tasks.withType<Javadoc >().configureEach {
27+ (options as StandardJavadocDocletOptions ).also {
28+ it.encoding(" UTF-8" )
29+ it.addStringOption(" link" , " https://docs.oracle.com/en/java/javase/17/docs/api/" )
30+ it.addBooleanOption(" html5" , true )
31+ it.addStringOption(" Xdoclint:none" , " -quiet" )
3632 }
33+ }
3734
38- java {
39- withSourcesJar()
40- withJavadocJar()
41- }
35+ java {
36+ withSourcesJar()
37+ withJavadocJar()
38+ }
4239
43- tasks.jar {
44- archiveClassifier.set(" core" )
45- }
40+ tasks.jar {
41+ // archiveClassifier.set("core")
42+ }
4643
47- tasks.shadowJar {
48- archiveClassifier.set(" " )
44+ tasks.shadowJar {
45+ // archiveClassifier.set(null as String? )
4946
50- relocate(" org.objectweb.asm" , " org.glavo.mic.asm" )
51- relocate(" com.github.javaparser" , " org.glavo.mic.javaparser" )
47+ // relocate("org.objectweb.asm", "org.glavo.mic.asm")
48+ // relocate("com.github.javaparser", "org.glavo.mic.javaparser")
5249
53- minimize()
54- }
50+ minimize()
5551}
5652
5753
5854dependencies {
55+ compileOnly(gradleApi())
56+
5957 implementation(" com.github.javaparser:javaparser-core:3.24.2" )
6058 implementation(" org.ow2.asm:asm:9.3" )
6159}
6260
63- loadMavenPublishProperties()
61+ configurations.named(JavaPlugin .API_CONFIGURATION_NAME ) {
62+ dependencies.remove(project.dependencies.gradleApi())
63+ }
6464
6565description = " Compiler for module-info.java"
6666
@@ -72,18 +72,22 @@ tasks.jar {
7272 }
7373}
7474
75+ loadMavenPublishProperties()
76+
7577configure<PublishingExtension > {
7678 publications {
7779 create<MavenPublication >(" maven" ) {
78-
7980 project.shadow.component(this )
8081
8182 groupId = project.group.toString()
8283 version = project.version.toString()
8384 artifactId = project.name
84- // artifact(tasks.shadowJar)
85- artifact(tasks[" sourcesJar" ])
86- artifact(tasks[" javadocJar" ])
85+
86+ from(components[" java" ])
87+
88+ // artifact(tasks.shadowJar)
89+ // artifact(tasks["sourcesJar"])
90+ // artifact(tasks["javadocJar"])
8791
8892 pom {
8993 name.set(project.name)
@@ -134,8 +138,23 @@ nexusPublishing {
134138 }
135139}
136140
137- tasks.withType<GenerateModuleMetadata > {
138- enabled = false
141+
142+
143+ pluginBundle {
144+ website = " https://github.com/Glavo/module-info-compiler"
145+ vcsUrl = " https://github.com/Glavo/module-info-compiler.git"
146+ tags = listOf (" java" , " modules" , " jpms" , " modularity" )
147+ }
148+
149+ gradlePlugin {
150+ plugins {
151+ create(" compileModuleInfoPlugin" ) {
152+ id = " org.glavo.compile-module-info-plugin"
153+ displayName = " Compile Module Info Plugin"
154+ description = rootProject.description
155+ implementationClass = " org.glavo.mic.CompileModuleInfoPlugin"
156+ }
157+ }
139158}
140159
141160fun loadMavenPublishProperties () {
0 commit comments