Skip to content

Commit

Permalink
chore: bump to v14 snapshot
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
  • Loading branch information
gabizou committed Dec 24, 2024
2 parents 07fb930 + 707b3f1 commit 92131ae
Show file tree
Hide file tree
Showing 22 changed files with 495 additions and 289 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Build #
#########
MANIFEST.MF
dependency-reduced-pom.xml

# Compiled #
Expand Down
2 changes: 1 addition & 1 deletion SpongeAPI
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,16 @@ public void copyModulesExcludingProvided(final Configuration source, final Confi
}
}

public void applyNamedDependencyOnOutput(final Project originProject, final SourceSet sourceAdding, final SourceSet targetSource, final Project implProject, final String dependencyConfigName) {
implProject.getLogger().lifecycle(
"[{}] Adding {}({}) to {}({}).{}",
implProject.getName(),
originProject.getPath(),
sourceAdding.getName(),
implProject.getPath(),
targetSource.getName(),
dependencyConfigName
);

implProject.getDependencies().add(dependencyConfigName, sourceAdding.getOutput());
public void addDependencyToRuntimeOnly(final SourceSet source, final SourceSet target) {
this.addDependencyTo(source, target.getRuntimeOnlyConfigurationName());
}

public void addDependencyToImplementation(final SourceSet source, final SourceSet target) {
this.addDependencyTo(source, target.getImplementationConfigurationName());
}

public void addDependencyTo(final SourceSet source, final String targetConfig) {
this.project.getDependencies().add(targetConfig, source.getOutput());
}

public String generateImplementationVersionString(final String apiVersion, final String minecraftVersion, final String implRecommendedVersion) {
Expand Down
45 changes: 17 additions & 28 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,33 @@ val mixinsConfig by configurations.register("mixins") {
val main by sourceSets

val applaunch by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, this, main, project, main.implementationConfigurationName)
spongeImpl.addDependencyToImplementation(this, main)

configurations.named(implementationConfigurationName) {
extendsFrom(applaunchConfig)
}
}
val launch by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, applaunch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, this, main, project, main.implementationConfigurationName)
spongeImpl.addDependencyToImplementation(applaunch.get(), this)
spongeImpl.addDependencyToImplementation(this, main)

configurations.named(implementationConfigurationName) {
extendsFrom(launchConfig)
}
}
val accessors by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, launch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, this, main, project, main.implementationConfigurationName)
spongeImpl.addDependencyToImplementation(launch.get(), this)
spongeImpl.addDependencyToImplementation(this, main)

configurations.named(implementationConfigurationName) {
extendsFrom(accessorsConfig)
}
}
val mixins by sourceSets.registering {
spongeImpl.applyNamedDependencyOnOutput(project, launch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, applaunch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, accessors.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, main, this, project, this.implementationConfigurationName)
spongeImpl.addDependencyToImplementation(launch.get(), this)
spongeImpl.addDependencyToImplementation(applaunch.get(), this)
spongeImpl.addDependencyToImplementation(accessors.get(), this)
spongeImpl.addDependencyToImplementation(main, this)

configurations.named(implementationConfigurationName) {
extendsFrom(mixinsConfig)
Expand Down Expand Up @@ -176,25 +176,6 @@ dependencies {
}
}

indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.txt"))

property("name", "Sponge")
property("organization", organization)
property("url", projectUrl)
}

idea {
if (project != null) {
(project as ExtensionAware).extensions["settings"].run {
(this as ExtensionAware).extensions.getByType(org.jetbrains.gradle.ext.TaskTriggersConfig::class).run {
afterSync(":modlauncher-transformers:build")
afterSync(":library-manager:build")
}
}
}
}

allprojects {
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
Expand Down Expand Up @@ -285,6 +266,14 @@ allprojects {
}
}

indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.txt"))

property("name", "Sponge")
property("organization", organization)
property("url", projectUrl)
}

val spongeSnapshotRepo: String? by project
val spongeReleaseRepo: String? by project
tasks {
Expand Down
91 changes: 37 additions & 54 deletions forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ val apiVersion: String by project
val minecraftVersion: String by project
val forgeVersion: String by project
val recommendedVersion: String by project
val organization: String by project
val projectUrl: String by project

description = "The SpongeAPI implementation for MinecraftForge"
Expand Down Expand Up @@ -80,63 +79,67 @@ val mixins: NamedDomainObjectProvider<SourceSet> = commonProject.sourceSets.name
val main: NamedDomainObjectProvider<SourceSet> = commonProject.sourceSets.named("main")

// SpongeForge source sets
val forgeMain by sourceSets.named("main") {
// implementation (compile) dependencies
spongeImpl.applyNamedDependencyOnOutput(commonProject, accessors.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, launch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, applaunch.get(), this, project, this.implementationConfigurationName)
// Service layer
val forgeAppLaunch by sourceSets.register("applaunch") {
spongeImpl.addDependencyToImplementation(applaunch.get(), this)

configurations.named(implementationConfigurationName) {
extendsFrom(gameLayerConfig.get())
extendsFrom(serviceLayerConfig.get())
}
}

// Lang layer
val forgeLang by sourceSets.register("lang") {
configurations.named(implementationConfigurationName) {
extendsFrom(langLayerConfig.get())
}
}

// Game layer
val forgeLaunch by sourceSets.register("launch") {
// implementation (compile) dependencies
spongeImpl.applyNamedDependencyOnOutput(commonProject, launch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, applaunch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, main.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, this, forgeMain, project, forgeMain.implementationConfigurationName)
spongeImpl.addDependencyToImplementation(applaunch.get(), this)
spongeImpl.addDependencyToImplementation(launch.get(), this)
spongeImpl.addDependencyToImplementation(main.get(), this)
spongeImpl.addDependencyToImplementation(forgeAppLaunch, this)

configurations.named(implementationConfigurationName) {
extendsFrom(gameLayerConfig.get())
}
}
val forgeAccessors by sourceSets.register("accessors") {
spongeImpl.applyNamedDependencyOnOutput(commonProject, mixins.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, accessors.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, this, forgeLaunch, project, forgeLaunch.implementationConfigurationName)
spongeImpl.addDependencyToImplementation(accessors.get(), this)

configurations.named(implementationConfigurationName) {
extendsFrom(gameLayerConfig.get())
}
}
val forgeMixins by sourceSets.register("mixins") {
// implementation (compile) dependencies
spongeImpl.applyNamedDependencyOnOutput(commonProject, mixins.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, accessors.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, launch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, applaunch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(commonProject, main.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, forgeMain, this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, forgeAccessors, this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, forgeLaunch, this, project, this.implementationConfigurationName)
spongeImpl.addDependencyToImplementation(applaunch.get(), this)
spongeImpl.addDependencyToImplementation(launch.get(), this)
spongeImpl.addDependencyToImplementation(accessors.get(), this)
spongeImpl.addDependencyToImplementation(mixins.get(), this)
spongeImpl.addDependencyToImplementation(main.get(), this)
spongeImpl.addDependencyToImplementation(forgeAppLaunch, this)
spongeImpl.addDependencyToImplementation(forgeLaunch, this)
spongeImpl.addDependencyToImplementation(forgeAccessors, this)

configurations.named(implementationConfigurationName) {
extendsFrom(gameLayerConfig.get())
}
}
val forgeLang by sourceSets.register("lang") {
configurations.named(implementationConfigurationName) {
extendsFrom(langLayerConfig.get())
}
}
val forgeAppLaunch by sourceSets.register("applaunch") {
// implementation (compile) dependencies
spongeImpl.applyNamedDependencyOnOutput(commonProject, applaunch.get(), this, project, this.implementationConfigurationName)
spongeImpl.applyNamedDependencyOnOutput(project, this, forgeLaunch, project, forgeLaunch.implementationConfigurationName)
val forgeMain by sourceSets.named("main") {
spongeImpl.addDependencyToImplementation(applaunch.get(), this)
spongeImpl.addDependencyToImplementation(launch.get(), this)
spongeImpl.addDependencyToImplementation(accessors.get(), this)
spongeImpl.addDependencyToImplementation(main.get(), this)
spongeImpl.addDependencyToImplementation(forgeAppLaunch, this)
spongeImpl.addDependencyToImplementation(forgeLaunch, this)
spongeImpl.addDependencyToImplementation(forgeAccessors, this)

spongeImpl.addDependencyToImplementation(this, forgeMixins)

configurations.named(implementationConfigurationName) {
extendsFrom(serviceLayerConfig.get())
extendsFrom(gameLayerConfig.get())
}
}

Expand Down Expand Up @@ -195,18 +198,6 @@ dependencies {
}
})

api(project(":", configuration = "launch")) {
exclude(group = "org.spongepowered", module = "mixin")
}
implementation(project(":", configuration = "accessors")) {
exclude(group = "org.spongepowered", module = "mixin")
}
implementation(project(commonProject.path)) {
exclude(group = "org.spongepowered", module = "mixin")
}

forgeMixins.implementationConfigurationName(project(commonProject.path))

val service = serviceLibrariesConfig.name
service(apiLibs.pluginSpi)
service(project(transformersProject.path)) {
Expand Down Expand Up @@ -441,14 +432,6 @@ sourceSets {
}
}

indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.txt"))

property("name", "Sponge")
property("organization", organization)
property("url", projectUrl)
}

publishing {
publications {
register("sponge", MavenPublication::class) {
Expand Down
12 changes: 0 additions & 12 deletions generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ plugins {
id("org.spongepowered.gradle.vanilla")
}

val apiVersion: String by project
val organization: String by project
val projectUrl: String by project

description = "Code generator for automatically producing API catalog classes based off of Vanilla MC data"

minecraft {
Expand All @@ -30,14 +26,6 @@ dependencies {
runtimeOnly(libs.tinylog.slf4j)
}

indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.txt"))

property("name", "Sponge")
property("organization", organization)
property("url", projectUrl)
}

val apiBase = rootProject.file("SpongeAPI/src/main/java/")
val temporaryLicenseHeader = project.layout.buildDirectory.file("api-gen-license-header.txt")
tasks.register("generateApiData", JavaExec::class) {
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4
log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" }
log4j-jpl = { module = "org.apache.logging.log4j:log4j-jpl", version.ref = "log4j" }
log4j-slf4j2 = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "log4j" }
bootstrap-api = { module = "net.minecraftforge:bootstrap-api", version.ref = "bootstrap" }
bootstrap = { module = "net.minecraftforge:bootstrap", version.ref = "bootstrap" }
modlauncher = { module = "net.minecraftforge:modlauncher", version.ref = "modlauncher" }
neo-modlauncher = { module = "cpw.mods:modlauncher", version.ref = "neo-modlauncher" }
Expand Down
11 changes: 0 additions & 11 deletions library-manager/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
val organization: String by project
val projectUrl: String by project

indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.txt"))

property("name", "Sponge")
property("organization", organization)
property("url", projectUrl)
}

dependencies {
implementation(apiLibs.gson)
}
29 changes: 8 additions & 21 deletions modlauncher-transformers/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
plugins {
eclipse
idea
}
// Make sure jar is present for other projects
eclipse {
synchronizationTasks(tasks.jar)
}

val organization: String by project
val projectUrl: String by project

indraSpotlessLicenser {
licenseHeaderFile(rootProject.file("HEADER.txt"))

property("name", "Sponge")
property("organization", organization)
property("url", projectUrl)
}


dependencies {
// AccessWidener transformer
implementation(libs.accessWidener) {
Expand Down Expand Up @@ -48,3 +27,11 @@ dependencies {
// And finally, compile only annotations
compileOnly(apiLibs.checkerQual)
}

tasks {
jar {
manifest {
attributes("Automatic-Module-Name" to "sponge.modlauncher.transformers")
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Automatic-Module-Name: sponge.modlauncher.transformers
Loading

0 comments on commit 92131ae

Please sign in to comment.