Skip to content

Commit

Permalink
ejected files
Browse files Browse the repository at this point in the history
  • Loading branch information
jjohannes committed Jan 20, 2024
1 parent 07d8b6b commit 5b6f0ad
Show file tree
Hide file tree
Showing 35 changed files with 375 additions and 31 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
2 changes: 1 addition & 1 deletion .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
2 changes: 1 addition & 1 deletion .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
2 changes: 1 addition & 1 deletion .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
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
2 changes: 1 addition & 1 deletion .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 Down
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.ooxml", "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,32 @@
import org.gradlex.javaecosystem.capabilities.customrules.*

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

dependencies.components {
all<ComponentStatusRule>()
withModule<BomComponentMetadataRule>("org.apache.poi:poi") { params(listOf("org.apache.poi:poi-excelant", "org.apache.poi:poi-ooxml", "org.apache.poi:poi-scratchpad")) }
withModule<BomComponentMetadataRule>("org.slf4j:slf4j-parent") { params(listOf("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")) }
withModule<BomMemberComponentMetadataRule>("org.apache.poi:poi-excelant") { params("org.apache.poi:poi") }
withModule<BomMemberComponentMetadataRule>("org.apache.poi:poi-ooxml") { params("org.apache.poi:poi") }
withModule<BomMemberComponentMetadataRule>("org.apache.poi:poi-scratchpad") { params("org.apache.poi:poi") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-api") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-simple") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-nop") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-jdk14") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-log4j12") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-reload4j") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-jcl") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-android") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:slf4j-ext") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:jcl-over-slf4j") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:log4j-over-slf4j") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:jul-to-slf4j") { params("org.slf4j:slf4j-parent") }
withModule<BomMemberComponentMetadataRule>("org.slf4j:osgi-over-slf4j") { params("org.slf4j:slf4j-parent") }
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<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"))) }
}

configurations.all {
}
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()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
id("java-platform")
id("org.gradlex.java-module-versions")
id("org.example.gradlebuild.java-base")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
id("com.autonomousapps.dependency-analysis")
}

defaultTasks("tasks")
Loading

0 comments on commit 5b6f0ad

Please sign in to comment.