mirror of
https://github.com/barkeser2002/Not-Enough-Crashes.git
synced 2026-09-25 02:20:04 +03:00
* Update Forge test mod to 1.19.2 * Update Gradle + swap to version toml * Add test mods to root project * Update versions according to upstream * Remove test gradle dirs
128 lines
3.0 KiB
Groovy
128 lines
3.0 KiB
Groovy
import com.modrinth.minotaur.TaskModrinthUpload
|
|
import org.gradle.api.tasks.Copy
|
|
|
|
plugins {
|
|
alias libs.plugins.shadow
|
|
alias libs.plugins.task.tree
|
|
}
|
|
|
|
configurations {
|
|
shadowCommon
|
|
}
|
|
|
|
architectury {
|
|
platformSetupLoomIde()
|
|
forge()
|
|
}
|
|
|
|
loom {
|
|
forge {
|
|
mixinConfigs = ["notenoughcrashes.mixins.json", "notenoughcrashes.forge.mixins.json"]
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
forge "net.minecraftforge:forge:${libs.versions.minecraft.get()}-${libs.versions.forge.get()}"
|
|
|
|
// Uncomment to add the test mod at runtime
|
|
// runtimeOnly project(path: ":TestForgeMod", configuration: "namedElements")
|
|
|
|
compileOnly(project(path: ":common", configuration: "dev")) {
|
|
transitive = false
|
|
}
|
|
developmentForge(project(path: ":common", configuration: "dev")) {
|
|
transitive = false
|
|
}
|
|
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) {
|
|
transitive = false
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "version", project.version
|
|
|
|
filesMatching("META-INF/mods.toml") {
|
|
expand "version": project.version
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
exclude "fabric.mod.json"
|
|
|
|
configurations = [project.configurations.shadowCommon]
|
|
classifier "dev-shadow"
|
|
}
|
|
|
|
remapJar {
|
|
input.set shadowJar.archiveFile
|
|
dependsOn shadowJar
|
|
classifier "forge"
|
|
}
|
|
jar {
|
|
manifest {
|
|
attributes([
|
|
"MixinConfigs": "notenoughcrashes.mixins.json"
|
|
])
|
|
}
|
|
classifier "dev"
|
|
}
|
|
|
|
|
|
java {
|
|
withSourcesJar()
|
|
}
|
|
|
|
|
|
|
|
curseforge {
|
|
apiKey = project.hasProperty("curseforge_api_key") ? project.curseforge_api_key : ""
|
|
project {
|
|
id = curseforge_id
|
|
releaseType = 'release'
|
|
addGameVersion "Forge"
|
|
addGameVersion curseforge_mc_version
|
|
changelogType = "markdown"
|
|
changelog = rootProject.file("changelog.md")
|
|
|
|
mainArtifact(remapJar) {
|
|
displayName = "$mod_name $total_version Forge"
|
|
}
|
|
}
|
|
|
|
options {
|
|
forgeGradleIntegration = false
|
|
}
|
|
}
|
|
|
|
modrinth {
|
|
group = "upload"
|
|
token = project.hasProperty("modrinth_api_key") ? project.modrinth_api_key : ""
|
|
projectId = 'yM94ont6'
|
|
versionNumber = total_version + "-forge" // Will fail if Modrinth has this version already
|
|
versionName = "$mod_name $total_version Forge"
|
|
uploadFile = remapJar
|
|
gameVersions = [modrinth_mc_version]
|
|
loaders = ["forge"]
|
|
changelog = rootProject.file("changelog.md").text
|
|
versionType = "release"
|
|
}
|
|
|
|
// Asset files will otherwise be missing when debugging
|
|
task copyAssetFilesForDebugging(type: Copy) {
|
|
def inAssets = rootProject.file("common/src/main/resources/assets/notenoughcrashes")
|
|
def outAssets = new File("${project.buildDir}/resources/main/assets/notenoughcrashes")
|
|
from inAssets
|
|
into outAssets
|
|
dependsOn rootProject.processResources
|
|
}
|
|
|
|
classes.dependsOn(copyAssetFilesForDebugging)
|
|
|
|
task publishForge {
|
|
group = "publishing"
|
|
afterEvaluate {
|
|
dependsOn(curseforge442354)
|
|
dependsOn(tasks.modrinth)
|
|
}
|
|
}
|