mirror of
https://github.com/FabricMC/fabric.git
synced 2025-05-30 23:14:00 -04:00
parent
7d3548462e
commit
129968e9e6
2 changed files with 15 additions and 18 deletions
|
@ -26,5 +26,8 @@
|
|||
"environment": "client",
|
||||
"config": "fabric-model-loading-api-v1.mixins.json"
|
||||
}
|
||||
]
|
||||
],
|
||||
"custom": {
|
||||
"fabric-api:module-lifecycle": "stable"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,8 @@ subprojects {
|
|||
}
|
||||
|
||||
// Create the task
|
||||
tasks.register("validateModules", ValidateModuleTask)
|
||||
def validateModules = tasks.register("validateModules", ValidateModuleTask)
|
||||
tasks.check.dependsOn(validateModules)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,13 +29,8 @@ subprojects {
|
|||
*/
|
||||
abstract class ValidateModuleTask extends DefaultTask {
|
||||
@InputFile
|
||||
@Optional
|
||||
abstract RegularFileProperty getFmj()
|
||||
|
||||
@InputFile
|
||||
@Optional
|
||||
abstract RegularFileProperty getClientFmj()
|
||||
|
||||
@Input
|
||||
abstract Property<String> getProjectName()
|
||||
|
||||
|
@ -47,11 +43,16 @@ abstract class ValidateModuleTask extends DefaultTask {
|
|||
ValidateModuleTask() {
|
||||
group = "verification"
|
||||
|
||||
// Hook up validation to check task
|
||||
project.tasks.check.dependsOn(this)
|
||||
// No outputs
|
||||
outputs.upToDateWhen { true }
|
||||
|
||||
fmj.set(project.file("src/main/resources/fabric.mod.json"))
|
||||
clientFmj.set(project.file("src/client/resources/fabric.mod.json"))
|
||||
def file = project.file("src/main/resources/fabric.mod.json")
|
||||
|
||||
if (!file.exists()) {
|
||||
file = project.file("src/client/resources/fabric.mod.json")
|
||||
}
|
||||
|
||||
fmj.set(file)
|
||||
|
||||
projectName.set(project.name)
|
||||
projectPath.set(project.path)
|
||||
|
@ -60,15 +61,8 @@ abstract class ValidateModuleTask extends DefaultTask {
|
|||
|
||||
@TaskAction
|
||||
void validate() {
|
||||
def clientOnlyMod = false
|
||||
|
||||
def file = fmj.get().asFile
|
||||
|
||||
if (!file.exists()) {
|
||||
file = clientFmj.get().asFile
|
||||
clientOnlyMod = true
|
||||
}
|
||||
|
||||
def json = new JsonSlurper().parse(file)
|
||||
|
||||
if (json.custom == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue