Skip to content

Commit

Permalink
thanks gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Bawnorton committed Sep 10, 2024
1 parent 7b35660 commit 22b732e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.0.3
- Fix build using dev names (thanks gradle)

# 1.0.2
- Bring down version req to 1.21

# 1.0.1
- Prevent config screen generator from init'ing on the server
- Add "description" to description translation key
Expand Down
24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@file:Suppress("UnstableApiUsage")

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.fabricmc.loom.task.RemapJarTask

plugins {
`maven-publish`
Expand All @@ -21,10 +22,6 @@ version = "${mod.version}-$loader-${mod.mappings}+$minecraftVersion"
group = mod.group
base.archivesName.set(mod.name)

stonecutter {
debug = true
}

repositories {
mavenCentral()
maven("https://maven.neoforged.net/releases/")
Expand Down Expand Up @@ -54,6 +51,12 @@ tasks {
options.release = 21
}

withType<RemapJarTask> {
dependsOn("shadowJar")
inputFile.set(shadowJar.get().archiveFile.get())
addNestedDependencies = true
}

withType<ShadowJar> {
from(sourceSets.main.get().output)
relocate("com.google.gson", "com.bawnorton.configurable.libs.gson")
Expand All @@ -74,10 +77,7 @@ tasks {
"pack.png",
"version.json"
)

mergeServiceFiles()

archiveClassifier = null
}
}

Expand All @@ -90,9 +90,9 @@ java {

val buildAndCollect = tasks.register<Copy>("buildAndCollect") {
group = "build"
from(tasks.shadowJar.get().archiveFile)
from(tasks.remapJar.get().archiveFile)
into(rootProject.layout.buildDirectory.file("libs/${mod.version}"))
dependsOn("remapJar", "shadowJar")
dependsOn("remapJar")
}

if (stonecutter.current.isActive) {
Expand Down Expand Up @@ -178,7 +178,7 @@ extensions.configure<PublishingExtension> {
}

publishMods {
file = tasks.shadowJar.get().archiveFile
file = tasks.remapJar.get().archiveFile
val tag = "$loader-${mod.mappings}-${mod.version}+$minecraftVersion"
val branch = "main"
changelog = "[Changelog](https://github.com/Bawnorton/${mod.name}/blob/$branch/CHANGELOG.md)"
Expand All @@ -196,12 +196,12 @@ publishMods {
modrinth {
accessToken = providers.gradleProperty("MODRINTH_TOKEN")
projectId = mod.modrinthProjId
minecraftVersions.addAll(mod.supportedVersions)
minecraftVersions.addAll(mod.supportedVersions.split(", "))
}

curseforge {
accessToken = providers.gradleProperty("CURSEFORGE_TOKEN")
projectId = mod.curseforgeProjId
minecraftVersions.addAll(mod.supportedVersions)
minecraftVersions.addAll(mod.supportedVersions.split(", "))
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx4G
fabric_versions=1.21.1
neoforge_versions=1.21.1

mod_version=1.0.1
mod_version=1.0.3
mod_group=com.bawnorton
mod_id=configurable
mod_name=Configurable
Expand Down
4 changes: 2 additions & 2 deletions versions/1.21.1-fabric-mojmap/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mappings=mojmap

yarn_build=3
fabric_loader=0.16.2
minecraft_dependency=>=1.21.1
supported_versions=1.21.1
minecraft_dependency=>=1.21
supported_versions=1.21, 1.21.1

modmenu=11.0.2
4 changes: 2 additions & 2 deletions versions/1.21.1-fabric-yarn/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mappings=yarn

yarn_build=3
fabric_loader=0.16.2
minecraft_dependency=>=1.21.1
supported_versions=1.21.1
minecraft_dependency=>=1.21
supported_versions=1.21, 1.21.1

modmenu=11.0.2
4 changes: 2 additions & 2 deletions versions/1.21.1-neoforge-mojmap/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ mappings=mojmap

yarn_build=3
neoforge_loader=21.1.31
minecraft_dependency=>=1.21.1
supported_versions=1.21.1
minecraft_dependency=>=1.21
supported_versions=1.21, 1.21.1
4 changes: 2 additions & 2 deletions versions/1.21.1-neoforge-yarn/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ mappings=yarn

yarn_build=3
neoforge_loader=21.1.31
minecraft_dependency=>=1.21.1
supported_versions=1.21.1
minecraft_dependency=>=1.21
supported_versions=1.21, 1.21.1

0 comments on commit 22b732e

Please sign in to comment.