Skip to content

Use already existing gradle.properties instead of hardcoding versions in fabric.mod.json #1962

@Friendly-Banana

Description

@Friendly-Banana

Minecraft Development for IntelliJ plugin version

2022.3-1.6.1

Description of the feature request

When generating a Fabric project a gradle.properties file is setup containing properties like version, minecraft_version and loader_version. Only version is then used in fabric.mod.json:
"version": "${version}",

but all the other variables are hardcoded:

"depends": {
    "fabricloader": ">=0.14.17",
    "fabric": "*",
    "minecraft": "1.19.3"
  }

Why not use the properties here, too?

This would require adding these properties in the build.gradle file. Either add all properties individually

processResources {
    // do the same for each property
    inputs.property "version", project.version
    filesMatching("fabric.mod.json") {
        expand "version": project.version
    }
}

or simply expand all properties:

processResources {
    filesMatching("fabric.mod.json") {
        expand(project.properties)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions