mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-12-01 20:08:05 +00:00
Move datagen to its own source set
MC 1.21.4 means we have to move more data generation code into the client source set. Given all this code movement, it probably makes sense to put data generation in a separate source set instead. 1.21.4 also has split data generators for client and server, but neither mod loader recommends this. This means we can/should merge DataProviders and ClientDataProviders into a single class. Data generators are no longer bundled with the jar, which does reduce file size, but by a tiny amount (~70KiB).
This commit is contained in:
@@ -109,14 +109,13 @@ abstract class CCTweakedExtension(
|
||||
val otherJava = otherProject.extensions.getByType(JavaPluginExtension::class.java)
|
||||
val main = otherJava.sourceSets.getByName("main")
|
||||
val client = otherJava.sourceSets.getByName("client")
|
||||
val testMod = otherJava.sourceSets.findByName("testMod")
|
||||
val testFixtures = otherJava.sourceSets.findByName("testFixtures")
|
||||
|
||||
// Pull in sources from the other project.
|
||||
extendSourceSet(otherProject, main)
|
||||
extendSourceSet(otherProject, client)
|
||||
if (testMod != null) extendSourceSet(otherProject, testMod)
|
||||
if (testFixtures != null) extendSourceSet(otherProject, testFixtures)
|
||||
for (sourceSet in listOf("datagen", "testMod", "testFixtures")) {
|
||||
otherJava.sourceSets.findByName(sourceSet)?.let { extendSourceSet(otherProject, it) }
|
||||
}
|
||||
|
||||
// The extra source-processing tasks should include these files too.
|
||||
project.tasks.named(main.javadocTaskName, Javadoc::class.java) { source(main.allJava, client.allJava) }
|
||||
|
||||
Reference in New Issue
Block a user