From 9593126d6ec9be99799ed7312c6914e876506b9c Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sat, 25 May 2024 12:06:11 -0700 Subject: [PATCH] Build sources are engine room too - Update buildSrc to use engine_room package - Publish artifacts under engine_room - Specify group in gradle.properties --- README.md | 5 +++-- buildSrc/build.gradle.kts | 4 ++-- .../gradle/jarset/JarSetExtension.kt | 2 +- .../engine_room}/gradle/jarset/JarTaskSet.kt | 2 +- .../nullability/GeneratePackageInfosTask.kt | 2 +- .../nullability/PackageInfosExtension.kt | 2 +- .../gradle/platform/PlatformExtension.kt | 4 ++-- .../gradle/platform/PlatformPlugin.kt | 2 +- .../gradle/subproject/SubprojectPlugin.kt | 20 ++++++++++--------- .../TransitiveSourceSetConfigurator.kt | 2 +- .../TransitiveSourceSetsExtension.kt | 2 +- gradle.properties | 1 + 12 files changed, 26 insertions(+), 22 deletions(-) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/jarset/JarSetExtension.kt (96%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/jarset/JarTaskSet.kt (99%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/nullability/GeneratePackageInfosTask.kt (98%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/nullability/PackageInfosExtension.kt (97%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/platform/PlatformExtension.kt (98%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/platform/PlatformPlugin.kt (85%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/subproject/SubprojectPlugin.kt (90%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/transitive/TransitiveSourceSetConfigurator.kt (96%) rename buildSrc/src/main/kotlin/{com/jozufozu => dev/engine_room}/gradle/transitive/TransitiveSourceSetsExtension.kt (98%) diff --git a/README.md b/README.md index 82d4ede4b..4860df732 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,12 @@ repositories { } dependencies { - compileOnly fg.deobf("com.jozufozu.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}") - runtimeOnly fg.deobf("com.jozufozu.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}") + compileOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-api-${minecraft_version}:${flywheel_version}") + runtimeOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}") } ``` `${flywheel_version}` gets replaced by the version of Flywheel you want to use, eg. `1.0.0-beta` + `${minecraft_version}` gets replaced by the version of Minecraft you're on, eg. `1.20.1` For a list of available Flywheel versions, you can check [the maven](https://maven.tterrag.com/com/jozufozu/flywheel/Flywheel-Forge/). diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 312a2b4a3..4853b6a15 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -21,11 +21,11 @@ gradlePlugin { plugins { create("platformPlugin") { id = "flywheel.platform" - implementationClass = "com.jozufozu.gradle.platform.PlatformPlugin" + implementationClass = "dev.engine_room.gradle.platform.PlatformPlugin" } create("subprojectPlugin") { id = "flywheel.subproject" - implementationClass = "com.jozufozu.gradle.subproject.SubprojectPlugin" + implementationClass = "dev.engine_room.gradle.subproject.SubprojectPlugin" } } } diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarSetExtension.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarSetExtension.kt similarity index 96% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarSetExtension.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarSetExtension.kt index 0acac776d..7f7eb2f7f 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarSetExtension.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarSetExtension.kt @@ -1,4 +1,4 @@ -package com.jozufozu.gradle.jarset +package dev.engine_room.gradle.jarset import net.fabricmc.loom.task.RemapJarTask import net.fabricmc.loom.task.RemapSourcesJarTask diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarTaskSet.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarTaskSet.kt similarity index 99% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarTaskSet.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarTaskSet.kt index b6cbb50f2..7ef0b7fc7 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarTaskSet.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarTaskSet.kt @@ -1,4 +1,4 @@ -package com.jozufozu.gradle.jarset +package dev.engine_room.gradle.jarset import net.fabricmc.loom.task.AbstractRemapJarTask import net.fabricmc.loom.task.RemapJarTask diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/nullability/GeneratePackageInfosTask.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/nullability/GeneratePackageInfosTask.kt similarity index 98% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/nullability/GeneratePackageInfosTask.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/nullability/GeneratePackageInfosTask.kt index fbe7698cb..c8787fedd 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/nullability/GeneratePackageInfosTask.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/nullability/GeneratePackageInfosTask.kt @@ -1,4 +1,4 @@ -package com.jozufozu.gradle.nullability +package dev.engine_room.gradle.nullability import org.apache.groovy.nio.extensions.NioExtensions import org.codehaus.groovy.runtime.StringGroovyMethods diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/nullability/PackageInfosExtension.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/nullability/PackageInfosExtension.kt similarity index 97% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/nullability/PackageInfosExtension.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/nullability/PackageInfosExtension.kt index 8a45da808..f604e477c 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/nullability/PackageInfosExtension.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/nullability/PackageInfosExtension.kt @@ -1,4 +1,4 @@ -package com.jozufozu.gradle.nullability +package dev.engine_room.gradle.nullability import org.gradle.api.Project import org.gradle.api.tasks.Delete diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformExtension.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/platform/PlatformExtension.kt similarity index 98% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformExtension.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/platform/PlatformExtension.kt index dec97abf7..fc5df1a45 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformExtension.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/platform/PlatformExtension.kt @@ -1,6 +1,6 @@ -package com.jozufozu.gradle.platform +package dev.engine_room.gradle.platform -import com.jozufozu.gradle.jarset.JarTaskSet +import dev.engine_room.gradle.jarset.JarTaskSet import net.fabricmc.loom.api.LoomGradleExtensionAPI import org.gradle.api.Project import org.gradle.api.tasks.SourceSet diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformPlugin.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/platform/PlatformPlugin.kt similarity index 85% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformPlugin.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/platform/PlatformPlugin.kt index 652a51121..f10f0319f 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformPlugin.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/platform/PlatformPlugin.kt @@ -1,4 +1,4 @@ -package com.jozufozu.gradle.platform +package dev.engine_room.gradle.platform import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/subproject/SubprojectPlugin.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectPlugin.kt similarity index 90% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/subproject/SubprojectPlugin.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectPlugin.kt index d39d0d9b4..8dd2dbd9d 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/subproject/SubprojectPlugin.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectPlugin.kt @@ -1,8 +1,8 @@ -package com.jozufozu.gradle.subproject +package dev.engine_room.gradle.subproject -import com.jozufozu.gradle.jarset.JarSetExtension -import com.jozufozu.gradle.nullability.PackageInfosExtension -import com.jozufozu.gradle.transitive.TransitiveSourceSetsExtension +import dev.engine_room.gradle.jarset.JarSetExtension +import dev.engine_room.gradle.nullability.PackageInfosExtension +import dev.engine_room.gradle.transitive.TransitiveSourceSetsExtension import net.fabricmc.loom.api.LoomGradleExtensionAPI import org.gradle.api.JavaVersion import org.gradle.api.Plugin @@ -38,12 +38,14 @@ class SubprojectPlugin: Plugin { val dev = System.getenv("RELEASE")?.contentEquals("false", true) ?: true val buildNumber = System.getenv("BUILD_NUMBER") - val mod_version: String by project - project.group = "com.jozufozu.flywheel" - project.version = mod_version + if (dev && buildNumber != null) "-${buildNumber}" else "" + val versionSuffix = if (dev && buildNumber != null) "-${buildNumber}" else "" - val artifact_minecraft_version: String by project - project.the().archivesName = "flywheel-${project.name}-${artifact_minecraft_version}" + project.group = project.property("group") as String + project.version = "${project.property("mod_version")}${versionSuffix}" + + project.the().apply { + archivesName = "flywheel-${project.name}-${project.property("artifact_minecraft_version")}" + } } @Suppress("UnstableApiUsage") diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/transitive/TransitiveSourceSetConfigurator.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/transitive/TransitiveSourceSetConfigurator.kt similarity index 96% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/transitive/TransitiveSourceSetConfigurator.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/transitive/TransitiveSourceSetConfigurator.kt index f91dc56a4..c2c69f2ce 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/transitive/TransitiveSourceSetConfigurator.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/transitive/TransitiveSourceSetConfigurator.kt @@ -1,4 +1,4 @@ -package com.jozufozu.gradle.transitive +package dev.engine_room.gradle.transitive import org.gradle.api.tasks.SourceSet diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/transitive/TransitiveSourceSetsExtension.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/transitive/TransitiveSourceSetsExtension.kt similarity index 98% rename from buildSrc/src/main/kotlin/com/jozufozu/gradle/transitive/TransitiveSourceSetsExtension.kt rename to buildSrc/src/main/kotlin/dev/engine_room/gradle/transitive/TransitiveSourceSetsExtension.kt index 9ebbe2dab..c259546df 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/transitive/TransitiveSourceSetsExtension.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/transitive/TransitiveSourceSetsExtension.kt @@ -1,4 +1,4 @@ -package com.jozufozu.gradle.transitive +package dev.engine_room.gradle.transitive import org.gradle.api.Action import org.gradle.api.Project diff --git a/gradle.properties b/gradle.properties index 3b9b3881f..431fbe0d6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,4 +36,5 @@ embeddium_version = 0.3.9+mc1.20.1 oculus_version = 1.20.1-1.6.15a # Publication info +group = dev.engine_room.flywheel artifact_minecraft_version = 1.20.1