From e8c22da56202616bc66d7464264cf1fad060ed6c Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 25 Jul 2024 18:17:29 +0200 Subject: [PATCH 1/2] fix: allow fabric declaration without modid --- CHANGELOG.md | 2 + .../src/main/kotlin/FabricExtension.kt | 43 ++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e7433d..d24f159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Declaring `fabric()` without a `modId` set will not create a mod or run configs. Can be used for a Fabric library module. + ## [0.16.8] - 2024-07-23 ### Fixed diff --git a/refinedarchitect-plugin/src/main/kotlin/FabricExtension.kt b/refinedarchitect-plugin/src/main/kotlin/FabricExtension.kt index 2f09c55..ab9b339 100644 --- a/refinedarchitect-plugin/src/main/kotlin/FabricExtension.kt +++ b/refinedarchitect-plugin/src/main/kotlin/FabricExtension.kt @@ -20,28 +20,30 @@ open class FabricExtension(private val project: Project) : BaseExtension(project project.dependencies.add("modImplementation", "net.fabricmc:fabric-loader:${fabricLoaderVersion}") project.dependencies.add("modImplementation", "net.fabricmc.fabric-api:fabric-api:${fabricApiVersion}") - project.extensions.getByType().apply { - val accessWidenerFile = project.file("src/main/resources/${modId!!}.accesswidener") - if (accessWidenerFile.exists()) { - accessWidenerPath.set(accessWidenerFile) - } - runs { - getByName("client") { - client() - setConfigName("Fabric Client") - ideConfigGenerated(true) - runDir("run") + if (modId != null) { + project.extensions.getByType().apply { + val accessWidenerFile = project.file("src/main/resources/${modId!!}.accesswidener") + if (accessWidenerFile.exists()) { + accessWidenerPath.set(accessWidenerFile) } - getByName("server") { - server() - setConfigName("Fabric Server") - ideConfigGenerated(true) - runDir("run") + runs { + getByName("client") { + client() + setConfigName("Fabric Client") + ideConfigGenerated(true) + runDir("run") + } + getByName("server") { + server() + setConfigName("Fabric Server") + ideConfigGenerated(true) + runDir("run") + } + } + mixin { + showMessageTypes.set(true) + messages.put("TARGET_ELEMENT_NOT_FOUND", "disabled") } - } - mixin { - showMessageTypes.set(true) - messages.put("TARGET_ELEMENT_NOT_FOUND", "disabled") } } project.tasks.withType().configureEach { @@ -55,6 +57,7 @@ open class FabricExtension(private val project: Project) : BaseExtension(project } fun compileWithProject(dependency: Project) { + project.evaluationDependsOn(":" + dependency.name) val sourceSets = dependency.extensions.getByType().sourceSets project.tasks.withType().configureEach { source(sourceSets["main"].allSource) From a8bdb53703016c710c293382ec8d5ddf9c6810b9 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Thu, 25 Jul 2024 16:18:07 +0000 Subject: [PATCH 2/2] chore: prepare release v0.16.9 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d24f159..d8f17a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.16.9] - 2024-07-25 + - Declaring `fabric()` without a `modId` set will not create a mod or run configs. Can be used for a Fabric library module. ## [0.16.8] - 2024-07-23 @@ -347,7 +349,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Gradle helpers for Fabric and Forge projects. - CI workflows. -[Unreleased]: https://github.com/refinedmods/refinedarchitect/compare/v0.16.8...HEAD +[Unreleased]: https://github.com/refinedmods/refinedarchitect/compare/v0.16.9...HEAD + +[0.16.9]: https://github.com/refinedmods/refinedarchitect/compare/v0.16.8...v0.16.9 [0.16.8]: https://github.com/refinedmods/refinedarchitect/compare/v0.16.7...v0.16.8