Skip to content

Commit

Permalink
clean buildscripts a lil soz troph
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Aug 28, 2024
1 parent 33c5080 commit 96a5a3b
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 37 deletions.
46 changes: 29 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ plugins {
alias libs.plugins.minotaur
}

version = "$project.baseVersion+$project.branch"
archivesBaseName = project.archivesName
version = "$baseVersion+$branch"
archivesBaseName = project.slug

repositories {
maven { url "https://maven.terraformersmc.com/releases" }
Expand All @@ -17,15 +17,17 @@ repositories {
}

dependencies {
implementation libs.kaleidoConfig
include libs.kaleidoConfig

minecraft libs.mc
mappings variantOf(libs.yarn) { classifier "v2" }
modImplementation libs.fl

modImplementation libs.fapi
modImplementation libs.spruceui
implementation libs.kaleidoConfig

modImplementation libs.spruceui
include libs.spruceui
include libs.kaleidoConfig
}

processResources {
Expand All @@ -34,19 +36,21 @@ processResources {
modId : modId,
modName : modName,
modDescription: modDescription,
homepage : homepage,
issues : issues,
sources : sources,
homepage : "https://modrinth.com/mod/${slug}",
issues : "https://github.com/${user}/${slug}/issues",
sources : "https://github.com/${user}/${slug}",
license : license,
authors : authors.split(", ").join("\",\n \""),
contributors : contributors.split(", ").join("\",\n \""),
mc : libs.versions.mc.get(),
members : "${authors}. Contributions by ${contributors}",
mc : compatibleVersions.split(", ")[0],
fl : libs.versions.fl.get(),
fapi : libs.versions.fapi.get(),
spruceui : libs.versions.spruceui.get()
]
inputs.properties meta
filesMatching("fabric.mod.json") { expand meta }
inputs.properties(meta)
filesMatching("*.mod.json") { expand(meta) }
filesMatching("META-INF/*mods.toml") { expand(meta) }
}

tasks.withType(JavaCompile).configureEach {
Expand All @@ -56,10 +60,14 @@ tasks.withType(JavaCompile).configureEach {

java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
from "LICENSE"
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
}

publishing {
Expand All @@ -71,12 +79,16 @@ publishing {
}

modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "ballotbox"
token = "$System.env.MODRINTH_TOKEN"
projectId = slug
versionNumber = project.version
uploadFile = remapJar
gameVersions = compatibleVersions.split(", ").toList()
loaders = compatibleLoaders.split(", ").toList()
changelog = "$System.env.CHANGELOG"
syncBodyFrom = "<!--DO NOT EDIT MANUALLY: synced from gh readme-->\n" + rootProject.file("README.md").text
dependencies {
required.version "fabric-api", libs.versions.fapi.get()
}
changelog = System.getenv("CHANGELOG")
syncBodyFrom = "<!--DO NOT EDIT MANUALLY: synced from gh readme-->\n" + rootProject.file("README.md").text
uploadFile = remapJar
}

13 changes: 6 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ org.gradle.caching=true
org.gradle.parallel=true
org.gradle.caching.debug=false
org.gradle.configureondemand=true

# Loom
fabric.loom.multiProjectOptimisation=true

# Mod Metadata
archivesName=ballotbox
group=net.modfest
user=ModFest
slug=ballotbox
modId=ballotbox
modName=Ballotbox
modDescription=In-game category voting!
authors=ModFest
contributors=Prospector, Sisby folk, acikek
homepage=https://modrinth.com/mod/ballotbox
issues=https://github.com/modfest/ballotbox/issues
sources=https://github.com/modfest/ballotbox
license=MIT

# Mod Version
baseVersion=0.4.2
# Branch Metadata
branch=1.21
tagBranch=1.21
compatibleVersions=1.21, 1.21.1
compatibleLoaders=fabric, quilt, neoforge
8 changes: 6 additions & 2 deletions libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@
loom = "1.7.+"
minotaur = "2.+"

kaleidoConfig = "0.3.1+1.3.1"

mc = "1.21"
fl = "0.15.11"
yarn = "1.21+build.9"
fapi = "0.100.7+1.21"

spruceui = "5.1.0+1.21"
kaleidoConfig = "0.3.1+1.3.1"

[plugins]
loom = { id = "fabric-loom", version.ref = "loom" }
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }

[libraries]
kaleidoConfig = { group = "folk.sisby", name = "kaleido-config", version.ref = "kaleidoConfig" }

mc = { group = "mojang", name = "minecraft", version.ref = "mc" }
fl = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fl" }
yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" }
fapi = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fapi" }

spruceui = { group = "dev.lambdaurora", name = "spruceui", version.ref = "spruceui" }
kaleidoConfig = { group = "folk.sisby", name = "kaleido-config", version.ref = "kaleidoConfig" }
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginManagement {
repositories {
maven { url 'https://maven.fabricmc.net/' }
maven { url "https://maven.fabricmc.net/" }
gradlePluginPortal()
}
}
Expand Down
44 changes: 44 additions & 0 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
modLoader = "javafml"
loaderVersion = "[4,)"
license = "${license}"
issueTrackerURL = "${issues}"

[[mods]]
modId = "${modId}"
version = "${version}"
displayName = "${modName}"
description = '''${modDescription}'''
authors = "${members}"
displayURL = "${homepage}"
logoFile = "assets/${modId}/icon.png"

[properties]
"connector:placeholder" = true

[[dependencies.${ modId }]]
modId = "connector"
type = "required"
versionRange = "*"
ordering = "NONE"
side = "BOTH"

[[dependencies.${ modId }]]
modId = "neoforge"
type = "required"
versionRange = "*"
ordering = "NONE"
side = "BOTH"

[[dependencies.${ modId }]]
modId = "minecraft"
type = "required"
versionRange = "[${mc},)"
ordering = "NONE"
side = "BOTH"

[[dependencies.${ modId }]]
modId = "fabric_api"
type = "required"
versionRange = "[${fapi},)"
ordering = "NONE"
side = "BOTH"
19 changes: 9 additions & 10 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@
"sources": "${sources}"
},
"license": "${license}",
"icon": "assets/ballotbox/icon.png",
"icon": "assets/${modId}/icon.png",
"mixins": [
"${modId}.mixins.json"
],
"depends": {
"minecraft": ">=${mc}",
"fabricloader": ">=${fl}",
"fabric-api": ">=${fapi}"
},
"entrypoints": {
"main": [
"net.modfest.ballotbox.BallotBox"
],
"client": [
"net.modfest.ballotbox.client.BallotBoxClient"
]
},
"mixins": [
"ballotbox.mixins.json"
],
"depends": {
"minecraft": ">=${mc}",
"fabricloader": ">=${fl}",
"fabric-api": ">=${fapi}",
"spruceui": ">=${spruceui}"
}
}

0 comments on commit 96a5a3b

Please sign in to comment.