FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
233 stars 201 forks source link

Add fabricApi.configureDataGeneration API/DSL to help with setting up datageneration. #960

Closed modmuss50 closed 10 months ago

modmuss50 commented 11 months ago

Datagen can be hard to setup for some, this PR adds a DSL to help configure a simple datagen setup. You can of course choose not to use this if you wish.

// Enable the default datagen (same as example mod)
fabricApi {
    configureDataGeneration()
}

// You can opt into configuring more advanced options, and even create a seperate sourceset for your datagen mod.
fabricApi {
    configureDataGeneration {
        createSourceSet = true // default false
        createRunConfiguration = true // default true
        modId = "example-datagen"  // default no value, required when generating a seperate sourceset.
        strictValidation = true  // default false
    }
}