Skip to content

Commit

Permalink
ejected files
Browse files Browse the repository at this point in the history
  • Loading branch information
jjohannes committed Jan 22, 2024
1 parent 07d8b6b commit 09f57cf
Show file tree
Hide file tree
Showing 37 changed files with 377 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .oj/jdk-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.0.6
17.0.6
5 changes: 3 additions & 2 deletions .oj/modules.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://onepiece.software/j/modules
# https://onepiece.software/j/#modules

# jakarta.activation=com.sun.activation:jakarta.activation
jakarta.activation=com.sun.activation:jakarta.activation
jakarta.mail=com.sun.mail:jakarta.mail
7 changes: 3 additions & 4 deletions .oj/patch/boms.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# https://onepiece.software/j/patch/boms
# https://onepiece.software/j#boms.properties

# org.openjfx\:javafx=javafx-base,javafx-graphics,javafx-controls,javafx-fxml,javafx-media,javafx-swing,javafx-web%
org.apache.poi\:poi=org.apache.poi:poi-excelant,org.apache.poi:poi-ooxml,org.apache.poi:poi-scratchpad
org.slf4j\:slf4j-parent=org.slf4j:slf4j-api,org.slf4j:slf4j-simple,org.slf4j:slf4j-nop,org.slf4j:slf4j-jdk14,org.slf4j:slf4j-log4j12,org.slf4j:slf4j-reload4j,org.slf4j:slf4j-jcl,org.slf4j:slf4j-android,org.slf4j:slf4j-ext,org.slf4j:jcl-over-slf4j,org.slf4j:log4j-over-slf4j,org.slf4j:jul-to-slf4j,org.slf4j:osgi-over-slf4j
poi=org.apache.poi:poi,org.apache.poi:poi-excelant,org.apache.poi:poi-ooxml,org.apache.poi:poi-scratchpad
slf4j=org.slf4j:slf4j-parent,org.slf4j:slf4j-api,org.slf4j:slf4j-simple,org.slf4j:slf4j-nop,org.slf4j:slf4j-jdk14,org.slf4j:slf4j-log4j12,org.slf4j:slf4j-reload4j,org.slf4j:slf4j-jcl,org.slf4j:slf4j-android,org.slf4j:slf4j-ext,org.slf4j:jcl-over-slf4j,org.slf4j:log4j-over-slf4j,org.slf4j:jul-to-slf4j,org.slf4j:osgi-over-slf4j
4 changes: 2 additions & 2 deletions .oj/patch/conflicts.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://onepiece.software/j/patch/conflicts
# https://onepiece.software/j/#conflicts.properties

# com.sun.activation\:jakarta.activation=jakarta.activation:jakarta.activation-api,com.sun.activation:jakarta.activation
com.sun.activation\:jakarta.activation=jakarta.activation:jakarta.activation-api,com.sun.activation:jakarta.activation
4 changes: 2 additions & 2 deletions .oj/patch/dependencies-add.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://onepiece.software/j/patch/dependencies-add
# https://onepiece.software/j/#dependencies.add.properties

# io.netty\:netty-common=io.projectreactor.tools:blockhound:1.0.8.RELEASE
io.netty\:netty-common=io.projectreactor.tools:blockhound:1.0.8.RELEASE
4 changes: 2 additions & 2 deletions .oj/patch/features.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://onepiece.software/j/patch/features
# https://onepiece.software/j/#features.properties

# io.netty\:netty-transport-native-epoll=linux-x86_64,linux-aarch_64
io.netty\:netty-transport-native-epoll=linux-x86_64,linux-aarch_64
9 changes: 4 additions & 5 deletions .oj/patch/non-modules.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# https://onepiece.software/j/patch/non-modules

# com.google.common=com.google.guava:guava
org.apache.commons.collections4=org.apache.commons:commons-collections4
org.apache.commons.codec=commons-codec:commons-codec
commons.math3=org.apache.commons:commons-math3
SparseBitSet=com.zaxxer:SparseBitSet
com.github.virtuald.curvesapi=com.github.virtuald:curvesapi
com.google.common=com.google.guava:guava
commons.math3=org.apache.commons:commons-math3
javax.annotations.jsr305=com.google.code.findbugs:jsr305
org.apache.commons.codec=commons-codec:commons-codec
org.apache.commons.collections4=org.apache.commons:commons-collections4
org.apache.commons.lang3=org.apache.commons:commons-lang3
velocity.engine.core=org.apache.velocity:velocity-engine-core
org.apache.commons.lang3=org.apache.commons:commons-lang3
4 changes: 2 additions & 2 deletions .oj/patch/targets.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://onepiece.software/j/patch/targets
# https://onepiece.software/j/#targets.properties

# org.openjfx\:javafx-base=[none|none],mac[macos|x86-64],mac-aarch64[macos|aarch64],win[windows|x86-64],linux-aarch64[linux|x86-64]
org.openjfx\:javafx-base=[none|none],mac[macos|x86-64],mac-aarch64[macos|aarch64],win[windows|x86-64],linux-aarch64[linux|x86-64]
2 changes: 1 addition & 1 deletion .oj/publishing.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://onepiece.software/j/publishing

# example=https://example.org/publishing-repository
local=/tmp/my-repo
3 changes: 2 additions & 1 deletion .oj/repositories.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://onepiece.software/j/repositories
# https://onepiece.software/j/#repositories.properties

mavenCentral=https://repo1.maven.org/maven2
foojayJavaToolchains=https://api.foojay.io/disco
2 changes: 1 addition & 1 deletion .oj/tweak/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
test.lifecycle=check
javac.jvm.options=
javac.options=
test.jvm.options=
test.jvm.options=-Xmx1g
test.parallelism=8
4 changes: 2 additions & 2 deletions .oj/versions.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://onepiece.software/j/versions

com.fasterxml.jackson.core=2.16.1
com.fasterxml.jackson.databind=2.16.1
com.google.common=33.0.0-jre
jakarta.activation=1.2.2
jakarta.mail=1.6.7
Expand All @@ -9,7 +9,7 @@ java.inject=1.0.5
javax.annotations.jsr305=3.0.2
org.apache.commons.compress=1.25.0
org.apache.commons.io=2.15.1
org.apache.poi.ooxml=5.2.2
org.apache.poi.poi=5.2.2
org.assertj.core=3.25.1
org.junit.jupiter.api=5.10.1
org.slf4j=2.0.10
Expand Down
1 change: 1 addition & 0 deletions corellia/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

requires org.apache.commons.io;
requires org.apache.poi.ooxml;
requires transitive org.apache.poi.poi;
}
1 change: 1 addition & 0 deletions gradle/jdk-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17.0.6
4 changes: 4 additions & 0 deletions gradle/modules.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://onepiece.software/j/#modules

jakarta.activation=com.sun.activation:jakarta.activation
jakarta.mail=com.sun.mail:jakarta.mail
28 changes: 14 additions & 14 deletions gradle/platform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ plugins {
}

moduleInfo {
version("jakarta.mail", "1.6.7")
version("org.slf4j", "2.0.10")
version("org.assertj.core", "3.25.1")
version("jakarta.activation", "1.2.2")
version("javax.annotations.jsr305", "3.0.2")
version("com.fasterxml.jackson.core", "2.16.1")
version("org.apache.commons.io", "2.15.1")
version("com.google.common", "33.0.0-jre")
version("java.inject", "1.0.5")
version("jakarta.servlet", "6.0.0")
version("org.junit.jupiter.api", "5.10.1")
version("velocity.engine.core", "2.3")
version("org.apache.commons.compress", "1.25.0")
version("org.apache.poi.ooxml", "5.2.2")
version("com.fasterxml.jackson.databind", "2.16.1") { reject("[3.0.0,)") }
version("com.google.common", "33.0.0-jre") { reject("[34.0.0,)") }
version("jakarta.activation", "1.2.2") { reject("[2.0.0,)") }
version("jakarta.mail", "1.6.7") { reject("[2.0.0,)") }
version("jakarta.servlet", "6.0.0") { reject("[7.0.0,)") }
version("java.inject", "1.0.5") { reject("[2.0.0,)") }
version("javax.annotations.jsr305", "3.0.2") { reject("[4.0.0,)") }
version("org.apache.commons.compress", "1.25.0") { reject("[2.0.0,)") }
version("org.apache.commons.io", "2.15.1") { reject("[3.0.0,)") }
version("org.apache.poi.poi", "5.2.2") { reject("[6.0.0,)") }
version("org.assertj.core", "3.25.1") { reject("[4.0.0,)") }
version("org.junit.jupiter.api", "5.10.1") { reject("[6.0.0,)") }
version("org.slf4j", "2.0.10") { reject("[3.0.0,)") }
version("velocity.engine.core", "2.3") { reject("[3.0.0,)") }
}
16 changes: 16 additions & 0 deletions gradle/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins { `kotlin-dsl`}

repositories.maven("https://plugins.gradle.org/m2")
repositories.maven("https://gradle.onepiece.software:1443/releases")

dependencies {
implementation("com.autonomousapps:dependency-analysis-gradle-plugin:1.28.0")
implementation("com.gradle:gradle-enterprise-gradle-plugin:3.16.1")
implementation("io.fuchs.gradle.classpath-collision-detector:classpath-collision-detector:0.3")
implementation("org.gradle.toolchains:foojay-resolver:0.7.0")
implementation("org.gradlex:extra-java-module-info:1.7")
implementation("org.gradlex:java-ecosystem-capabilities:1.4")
implementation("org.gradlex:java-module-dependencies:1.5.1")
implementation("org.gradlex:java-module-packaging:0.0.2")
implementation("org.gradlex:java-module-testing:1.3.1")
}
1 change: 1 addition & 0 deletions gradle/plugins/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
includeBuild("../../../../plugins/onepiece-j")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
id("java")
}

tasks.compileJava {
options.forkOptions.jvmArgs = listOf()
options.compilerArgs = listOf()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
id("java")
}

val mockApi = sourceSets.create("mockApi")
java.registerFeature(mockApi.name) { usingSourceSet(mockApi) }

tasks.named<JavaCompile>("compileMockApiJava") {
options.forkOptions.jvmArgs = listOf()
options.compilerArgs = listOf()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
id("java-test-fixtures")
}

tasks.compileTestFixturesJava {
options.forkOptions.jvmArgs = listOf()
options.compilerArgs = listOf()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
id("application")
id("io.fuchs.gradle.classpath-collision-detector")
id("org.example.gradlebuild.java-base")
id("org.example.gradlebuild.java-module-building")
id("org.example.gradlebuild.java-module-testing")
}

javaModulePackaging {
applicationName = "Gradle Project Setup HowTo"
applicationDescription = "How to structure a growing Gradle project with smart dependency management?"
vendor = "Jendrik Johannes (onepiece.Software)"
copyright = "Copyright 2024, Jendrik Johannes"
}

application {
applicationDefaultJvmArgs = listOf()
}

tasks.withType<JavaExec>().configureEach { args() }
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id("org.example.gradlebuild.patch-metadata")
id("org.example.gradlebuild.patch-non-modules")
}

group = "org.example"
version = providers.fileContents(rootProject.layout.projectDirectory.file("gradle/version.txt")).asText.getOrElse("")
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id("java-library")
id("org.example.gradlebuild.java-base")
id("org.example.gradlebuild.java-module-building")
id("org.example.gradlebuild.java-module-testing")
id("org.example.gradlebuild.java-module-publishing")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
plugins {
id("java")
id("org.gradlex.java-module-dependencies")
id("org.gradlex.java-module-packaging")
id("org.example.gradlebuild.feature-main")
id("org.example.gradlebuild.test-suite-test")
}

javaModulePackaging {
target("macos") {
operatingSystem = "macos"
architecture = "x86-64"
}
target("ubuntu") {
operatingSystem = "linux"
architecture = "x86-64"
}
target("windows") {
operatingSystem = "windows"
architecture = "x86-64"
}
}

val fullJavaVersion = providers.fileContents(rootProject.layout.projectDirectory.file("gradle/jdk-version.txt")).asText.get()
val majorJavaVersion = fullJavaVersion.substring(0, fullJavaVersion.indexOf("."))
java.toolchain.languageVersion = JavaLanguageVersion.of(majorJavaVersion)

javaModuleDependencies.versionsFromPlatformAndConsistentResolution(":platform", rootProject.subprojects.map { it.path }.filter { it != ":platform" })

tasks.withType<JavaCompile>().configureEach {
inputs.property("fullJavaVersion", fullJavaVersion)
options.isFork = true
options.encoding = "UTF-8"
options.javaModuleVersion = project.version as String
doFirst {
this as JavaCompile
val trackedVersion = inputs.properties["fullJavaVersion"] as String
val usedVersion = javaCompiler.get().metadata.javaRuntimeVersion
if (!usedVersion.startsWith(trackedVersion)) {
throw RuntimeException("Selected JDK version $usedVersion does not fit defined JDK version $trackedVersion")
}
}
}

tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
fileMode = 436 // 0664
dirMode = 509 // 0775
}

tasks.withType<Javadoc>().configureEach {
options.encoding = "UTF-8"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
plugins {
id("java")
id("maven-publish")
}

java.withSourcesJar()

java.withJavadocJar()

publishing.publications.create<MavenPublication>("module") {
from(components["java"])
versionMapping {
allVariants { fromResolutionResult() }
}
}

publishing.repositories {
maven {
name = "local"
url = uri("/tmp/my-repo")
if (providers.gradleProperty("localUsername").isPresent()) { credentials(PasswordCredentials::class) }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
id("java")
id("org.gradlex.java-module-testing")
}

tasks.check {
dependsOn(tasks.withType<io.fuchs.gradle.collisiondetector.DetectCollisionsTask>())
dependsOn(tasks.withType<org.gradlex.javamodule.dependencies.tasks.ModuleDirectivesOrderingCheck>())
dependsOn(tasks.withType<org.gradlex.javamodule.dependencies.tasks.ModuleDirectivesScopeCheck>())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import org.gradlex.javaecosystem.capabilities.customrules.*

plugins {
id("org.gradlex.java-ecosystem-capabilities")
}

dependencies.components {
val slf4j = listOf("org.slf4j:slf4j-parent", "org.slf4j:slf4j-api", "org.slf4j:slf4j-simple", "org.slf4j:slf4j-nop", "org.slf4j:slf4j-jdk14", "org.slf4j:slf4j-log4j12", "org.slf4j:slf4j-reload4j", "org.slf4j:slf4j-jcl", "org.slf4j:slf4j-android", "org.slf4j:slf4j-ext", "org.slf4j:jcl-over-slf4j", "org.slf4j:log4j-over-slf4j", "org.slf4j:jul-to-slf4j", "org.slf4j:osgi-over-slf4j")
slf4j.forEach {
withModule<AddAlignmentConstraintsMetadataRule>(it) { params(slf4j) }
}
val poi = listOf("org.apache.poi:poi", "org.apache.poi:poi-excelant", "org.apache.poi:poi-ooxml", "org.apache.poi:poi-scratchpad")
poi.forEach {
withModule<AddAlignmentConstraintsMetadataRule>(it) { params(poi) }
}
withModule<AddDependenciesMetadataRule>("io.netty:netty-common") { params(listOf("io.projectreactor.tools:blockhound:1.0.8.RELEASE")) }
withModule<RemoveDependenciesMetadataRule>("com.google.guava:guava") { params(listOf("com.google.guava:failureaccess", "com.google.guava:listenablefuture", "com.google.code.findbugs:jsr305", "org.checkerframework:checker-qual", "com.google.errorprone:error_prone_annotations", "com.google.j2objc:j2objc-annotations")) }
withModule<AddFeaturesMetadataRule>("io.netty:netty-transport-native-epoll") { params(listOf("linux-x86_64", "linux-aarch_64")) }
withModule<AddTargetPlatformVariantsMetadataRule>("org.openjfx:javafx-base") { params(listOf(Target("", "none", "none"), Target("mac", "macos", "x86-64"), Target("mac-aarch64", "macos", "aarch64"), Target("win", "windows", "x86-64"), Target("linux-aarch64", "linux", "x86-64"))) }
withModule<AddCapabilityMetadataRule>("jakarta.activation:jakarta.activation-api") { params("com.sun.activation:jakarta.activation") }
withModule<AddCapabilityMetadataRule>("com.sun.activation:jakarta.activation") { params("com.sun.activation:jakarta.activation") }
}

configurations.all {
resolutionStrategy.capabilitiesResolution.withCapability("jakarta.activation:jakarta.activation-api") { select("com.sun.activation:jakarta.activation:0") }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
id("org.gradlex.extra-java-module-info")
}

extraJavaModuleInfo {
failOnAutomaticModules = true
module("com.zaxxer:SparseBitSet", "SparseBitSet") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("com.github.virtuald:curvesapi", "com.github.virtuald.curvesapi") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("com.google.guava:guava", "com.google.common") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("org.apache.commons:commons-math3", "commons.math3") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("com.google.code.findbugs:jsr305", "javax.annotations.jsr305") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("commons-codec:commons-codec", "org.apache.commons.codec") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("org.apache.commons:commons-collections4", "org.apache.commons.collections4") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("org.apache.commons:commons-lang3", "org.apache.commons.lang3") {
exportAllPackages()
requireAllDefinedDependencies()
}
module("org.apache.velocity:velocity-engine-core", "velocity.engine.core") {
exportAllPackages()
requireAllDefinedDependencies()
}
}
Loading

0 comments on commit 09f57cf

Please sign in to comment.