Skip to content

Commit

Permalink
Attempt to fix FMJ file not found bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Jun 17, 2024
1 parent c055723 commit 2929fe8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/ffapi.neo-entrypoint.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ val sourceSets = extensions.getByType<SourceSetContainer>()
val masterSourceSets = listOf("main", "testmod").mapNotNull(sourceSets::findByName).filter { it.java.srcDirs.any(File::exists) || it.resources.srcDirs.any(File::exists) }

masterSourceSets.forEach { sourceSet ->
val modMetadataJson = sourceSet.java.srcDirs.map { it.parentFile.resolve("resources/fabric.mod.json") }.firstOrNull(File::exists) ?: return@forEach
val baseTaskName = "ForgeModEntrypoint"
val taskName = sourceSet.getTaskName("generate", baseTaskName)
val targetDir = project.file("src/generated/${sourceSet.name}/java")
Expand All @@ -23,7 +24,7 @@ masterSourceSets.forEach { sourceSet ->
// sources to the source set.
sourceRoots.from(sourceSet.java.srcDirs)
outputDir.set(targetDir)
fabricModJson.set(sourceSet.java.srcDirs.map { it.parentFile.resolve("resources/fabric.mod.json") }.first(File::exists))
fabricModJson.set(modMetadataJson)
testEnvironment = sourceSet.name == "testmod"
}
sourceSet.java.srcDir(task)
Expand Down

0 comments on commit 2929fe8

Please sign in to comment.