-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java Modules - additional plugins and rules
- Loading branch information
Showing
14 changed files
with
123 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
gradle/plugins/base-plugins/src/main/kotlin/org.example.platform.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...ndency-rules-plugins/src/main/kotlin/org.example.java-modules-dependency-rules.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
plugins { | ||
id("org.gradlex.extra-java-module-info") | ||
id("org.gradlex.java-module-dependencies") | ||
} | ||
|
||
extraJavaModuleInfo { | ||
failOnAutomaticModules.set(true) | ||
|
||
module("com.google.code.findbugs:jsr305", "javax.annotations.jsr305") { | ||
exports("javax.annotation") | ||
requireAllDefinedDependencies() | ||
} | ||
module("com.google.guava:guava", "com.google.common") { | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("com.github.virtuald:curvesapi", "com.github.virtuald.curvesapi") { // required by org.apache.poi.poi | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("com.zaxxer:SparseBitSet", "SparseBitSet") { // required by org.apache.poi.poi | ||
exports("com.zaxxer.sparsebits") | ||
requireAllDefinedDependencies() | ||
} | ||
module("commons-codec:commons-codec", "org.apache.commons.codec") { // required by org.apache.poi.poi | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("org.apache.commons:commons-collections4", "org.apache.commons.collections4") { // required by org.apache.poi.poi | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("org.apache.commons:commons-compress", "org.apache.commons.compress") { // required by org.apache.poi.poi | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("commons-io:commons-io", "org.apache.commons.io") { // required by org.apache.poi.poi | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("org.apache.commons:commons-lang3", "org.apache.commons.lang3") { // required by velocity | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("org.apache.commons:commons-math3", "commons.math3") { // required by org.apache.poi.poi | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("org.apache.velocity:velocity-engine-core", "velocity.engine.core") { | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
module("org.hamcrest:hamcrest-core", "org.hamcrest.core") { | ||
exportAllPackages() | ||
requireAllDefinedDependencies() | ||
} | ||
knownModule("org.slf4j:slf4j-api", "org.slf4j") | ||
} | ||
|
||
javaModuleDependencies { | ||
// Override because there are multiple options | ||
moduleNameToGA.put("jakarta.activation", "com.sun.activation:jakarta.activation") | ||
moduleNameToGA.put("jakarta.mail", "com.sun.mail:jakarta.mail") | ||
} |
26 changes: 26 additions & 0 deletions
26
...les-plugins/src/main/kotlin/org/example/metadatarules/fixdependencies/GuavaCleanupRule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.example.metadatarules.fixdependencies | ||
|
||
import org.gradle.api.artifacts.CacheableRule | ||
import org.gradle.api.artifacts.ComponentMetadataContext | ||
import org.gradle.api.artifacts.ComponentMetadataRule | ||
|
||
/** | ||
* Removes dependencies of Guava that we do not need and that are not Java Modules | ||
*/ | ||
@CacheableRule | ||
abstract class GuavaCleanupRule : ComponentMetadataRule { | ||
companion object { | ||
const val GUAVA_MODULE = "com.google.guava:guava" | ||
} | ||
|
||
override fun execute(context: ComponentMetadataContext) { | ||
context.details.allVariants { | ||
withDependencies { | ||
removeIf { it.name == "failureaccess" } | ||
removeIf { it.name == "j2objc-annotations" } | ||
removeIf { it.name == "checker-qual" } | ||
removeIf { it.name == "error_prone_annotations" } | ||
} | ||
} | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
...gins/src/main/kotlin/org/example/metadatarules/fixdependencies/TypesafeConfigGuiceRule.kt
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
.../src/main/kotlin/org/example/metadatarules/versionalignment/HttpComponentsPlatformRule.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
gradle/plugins/java-library-plugins/src/main/kotlin/org.example.java-library.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
plugins { | ||
id("java-library") | ||
id("org.example.java") | ||
id("org.gradlex.java-module-testing") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters