Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions mapsync-mod/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@ plugins {
alias(libs.plugins.fabricLoom)
}

private val mod_name = project.property("mod_name").toString()
version = "${project.property("mod_version")}-${libs.versions.minecraft.get()}"
// gradle.properties
private val project_name: String by project
private val project_group: String by project
private val mapsync_version: String by project
private val project_description: String by project
private val project_authors: String by project
private val project_copyright: String by project
private val project_home_url: String by project
private val project_source_url: String by project
private val project_issues_url: String by project

private val modLocalDep = configurations.create("modLocalDep")
version = "${mapsync_version}-${libs.versions.minecraft.get()}"
group = project_group

private val modLocalDep: Configuration by configurations.creating

base {
archivesName = project.property("archives_base_name").toString()
archivesName = project_name
}

loom {
Expand Down Expand Up @@ -82,30 +93,28 @@ tasks {
}
jar {
from(file("../LICENSE")) {
rename { "LICENSE_${mod_name}" }
rename { "LICENSE_${project_name}" }
}
}
processResources {
val expansions: Map<String, Any> = buildMap {
put("mod_name", mod_name)
put("mod_version", project.version)
putAll(listOf(
"mod_description",
"copyright_licence",
"mod_home_url",
"mod_source_url",
"mod_issues_url"
).associateWith { project.property(it).toString() })
put("minecraft_version", libs.versions.minecraft.get())
put("fabric_loader_version", libs.versions.fabricLoader.get())
val expansions: Map<String, Any> = buildMap expansions@{
this@expansions["mod_name"] = project_name
this@expansions["mod_version"] = project.version
this@expansions["mod_description"] = project_description
this@expansions["mod_copyright"] = project_copyright
this@expansions["mod_home_url"] = project_home_url
this@expansions["mod_source_url"] = project_source_url
this@expansions["mod_issues_url"] = project_issues_url
this@expansions["minecraft_version"] = libs.versions.minecraft.get()
this@expansions["fabric_loader_version"] = libs.versions.fabricLoader.get()
}
inputs.properties(expansions)
filesMatching("fabric.mod.json") {
expand(expansions)
filter {
it.replace(
"\"%FABRIC_AUTHORS_ARRAY%\"",
groovy.json.JsonBuilder(project.property("mod_authors").toString().split(",")).toString()
groovy.json.JsonBuilder(project_authors.split(",")).toString()
)
}
}
Expand Down
20 changes: 10 additions & 10 deletions mapsync-mod/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
org.gradle.jvmargs=-Xmx2048M

archives_base_name=MapSync
maven_group=gjum.minecraft.mapsync
mod_version=2.2.0-SNAPSHOT
mod_name=MapSync
mod_description=Real-time terrain synchronization: See exactly what your friends see, as they explore it.
mod_authors=Gjum,Protonull,okx,Huskydog9988,specificlanguage,SirAlador,klaribot,Sheepy_9
copyright_licence=GPLv3
mod_home_url=https://github.com/CivPlatform/map-sync
mod_source_url=https://github.com/CivPlatform/map-sync
mod_issues_url=https://github.com/CivPlatform/map-sync/issues
mapsync_version=2.2.0-SNAPSHOT

project_name=MapSync
project_group=gjum.minecraft.mapsync
project_description=Real-time terrain synchronization: See exactly what your friends see, as they explore it.
project_authors=Gjum,Protonull,okx,Huskydog9988,specificlanguage,SirAlador,klaribot,Sheepy_9
project_copyright=GPLv3
project_home_url=https://github.com/CivPlatform/map-sync
project_source_url=https://github.com/CivPlatform/map-sync
project_issues_url=https://github.com/CivPlatform/map-sync/issues
2 changes: 1 addition & 1 deletion mapsync-mod/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"sources": "${mod_source_url}",
"issues": "${mod_issues_url}"
},
"license": "${copyright_licence}",
"license": "${mod_copyright}",
"icon": "assets/mapsync/icon.png",
"environment": "client",
"entrypoints": {
Expand Down