diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e7433d..6c416f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.16.9] - 2024-07-25 + +### Fixed + +- 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 @@ -345,7 +351,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 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)