Insanity ball

- Publish jarjar artifact as default.
- Publish slim artifact without any fancy stuff.
- Update mods.toml
  - Switch rubidium to embeddium.
  - Set displayURL to modrinth.
  - Change version related stuff to $ variables
- Add processResources step to build.gradle to populate mods.toml.
This commit is contained in:
Jozufozu 2024-01-15 17:41:17 -08:00
parent 60b3d99a43
commit e582379ab5
3 changed files with 49 additions and 14 deletions

View File

@ -150,26 +150,56 @@ compileJava {
options.compilerArgs = ['-Xdiags:verbose']
}
tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
forge_version : forge_version,
forge_version_range : forge_version_range,
loader_version_range : loader_version_range,
mod_version : mod_version,
embeddium_version_range: embeddium_version_range
]
inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
}
void addLicense(jarTask) {
jarTask.from('LICENSE.md') {
rename '(.*)\\.(.*)', '$1_' + archivesBaseName + '.$2'
}
}
tasks.named('jar', Jar).configure {
manifest {
void addManifest(jarTask) {
jarTask.manifest {
attributes([
'Specification-Title': 'flywheel',
'Specification-Title' : 'flywheel',
// 'Specification-Vendor': 'flywheel authors',
'Specification-Version': '1', // We are version 1 of ourselves
'Implementation-Title': project.jar.archiveBaseName,
'Implementation-Version': project.jar.archiveVersion,
'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.jar.archiveBaseName,
'Implementation-Version' : project.jar.archiveVersion,
// 'Implementation-Vendor': 'flywheel authors',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}
}
tasks.named('jar', Jar).configure {
archiveClassifier = 'slim'
finalizedBy 'reobfJar'
addManifest(it)
addLicense(it)
}
tasks.named('jarJar', Jar).configure {
archiveClassifier = ''
finalizedBy 'reobfJarJar'
addManifest(it)
addLicense(it)
}

View File

@ -5,7 +5,12 @@ org.gradle.daemon = false
mod_version = 1.0.0-alpha
artifact_minecraft_version = 1.20.1
minecraft_version = 1.20.1
forge_version = 47.2.6
forge_version=47.2.19
# Version ranges for the mods.toml
minecraft_version_range=[1.20.1,1.20.3)
forge_version_range=[47,)
loader_version_range=[47,)
embeddium_version_range=[0.2.10,0.3)
# build dependency versions
forgegradle_version = [6.0.16,6.2)

View File

@ -1,15 +1,15 @@
modLoader = "javafml"
loaderVersion = "[47,)"
loaderVersion = "${loader_version_range}"
issueTrackerURL = "https://github.com/Jozufozu/Flywheel/issues"
license = "MIT"
[[mods]]
modId = "flywheel"
# The Implementation-Version property in the jar's MANIFEST.MF file will be used as the mod version at runtime
version = "${file.jarVersion}"
version = "${mod_version}"
displayName = "Flywheel"
logoFile = "logo.png"
displayURL = "https://www.curseforge.com/minecraft/mc-mods/flywheel"
displayURL = "https://modrinth.com/mod/flywheel"
updateJSONURL = "https://api.modrinth.com/updates/flywheel/forge_updates.json"
authors = "Jozufozu, PepperCode1"
description = '''
@ -18,20 +18,20 @@ A modern engine for modded minecraft.'''
[[dependencies.flywheel]]
modId = "forge"
mandatory = true
versionRange = "[47.0.0,)"
versionRange = "${forge_version_range}"
ordering = "NONE"
side = "CLIENT"
[[dependencies.flywheel]]
modId = "minecraft"
mandatory = true
versionRange = "[1.20.1,)"
versionRange = "${minecraft_version_range}"
ordering = "NONE"
side = "CLIENT"
[[dependencies.flywheel]]
modId = "rubidium"
modId = "embeddium"
mandatory = false
versionRange = "[0.7.0,)"
versionRange = "${embeddium_version_range}"
ordering = "NONE"
side = "CLIENT"