Bassebombecraft

Bassebombecraft

18.5k Downloads

Add automatic versioning of mods.toml

Closed this issue ยท 1 comments

commented

Solution:

The value of version field in the mods.toml file is generated as part of the build:

version="${version}" #mandatory

The version is generated by the build.gradle file:

// Process resources on build: set the version in the mods.toml
processResources {
	// This will ensure that this task is redone when the versions change.
	inputs.property 'version', project.version

	// Replace stuff in mods.toml, nothing else
	from(sourceSets.main.resources.srcDirs) {
		include 'META-INF/mods.toml'
		// Replace version
		expand 'version': project.version
	}

	// Copy everything else except the mods.toml
	from(sourceSets.main.resources.srcDirs) {
		exclude 'META-INF/mods.toml'
	}
}

commented

Resolved with commit 126c323.