From 5590737496786defe890751b90f988bf4b8f90a5 Mon Sep 17 00:00:00 2001 From: TwilightFlower Date: Mon, 10 Jun 2024 18:10:27 -0400 Subject: [PATCH] fix curseforge and change maven group --- addon.gradle | 15 +++++------ build.gradle | 67 ++++++++++++++++++++++++++--------------------- gradle.properties | 2 ++ 3 files changed, 46 insertions(+), 38 deletions(-) diff --git a/addon.gradle b/addon.gradle index d65bc06..488e76d 100644 --- a/addon.gradle +++ b/addon.gradle @@ -269,14 +269,13 @@ afterEvaluate { pluginManager.withPlugin("net.darkhax.curseforgegradle") { tasks.curseforge { - doFirst { - dependsOn(forgePatchesJar) - def mainArtifact = uploadArtifacts[0] - mainArtifact.withAdditionalFile(forgePatchesJar.get().archiveFile.get().asFile) - mainArtifact.additionalArtifacts.forEach { additionalArtifact -> - additionalArtifact.changelogType = mainArtifact.changelogType - additionalArtifact.changelog = mainArtifact.changelog - } + dependsOn(forgePatchesJar) + def mainArtifact = uploadArtifacts[0] + mainArtifact.withAdditionalFile(forgePatchesJar.get().archiveFile.get().asFile) + mainArtifact.additionalArtifacts.forEach { additionalArtifact -> + additionalArtifact.changelogType = mainArtifact.changelogType + additionalArtifact.changelog = mainArtifact.changelog + } } } diff --git a/build.gradle b/build.gradle index 6ecfcbd..5e998e0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,4 @@ +// Breaking the auto updater because I need to change some curseforge stuff //version: 1707682661 /* * DO NOT CHANGE THIS FILE! @@ -945,43 +946,49 @@ if (cfApiKey.isPresent() || deploymentDebug.toBoolean()) { debugMode = deploymentDebug.toBoolean() apiToken = cfApiKey.getOrElse('debug_token') + def mainFile = upload(curseForgeProjectId, reobfJar) + + mainFile.displayName = versionDisplayFormat.replace('$MOD_NAME', modName).replace('$VERSION', modVersion) + mainFile.releaseType = getReleaseType() + mainFile.changelogType = 'markdown' + mainFile.addModLoader 'Forge' + mainFile.addJavaVersion "Java 8" + mainFile.addGameVersion minecraftVersion + + if (curseForgeRelations.size() != 0) { + String[] deps = curseForgeRelations.split(';') + deps.each { dep -> + if (dep.size() == 0) { + return + } + String[] parts = dep.split(':') + String type = parts[0], slug = parts[1] + def types = [ + 'req' : 'requiredDependency', 'required': 'requiredDependency', + 'opt' : 'optionalDependency', 'optional': 'optionalDependency', + 'embed' : 'embeddedLibrary', 'embedded': 'embeddedLibrary', + 'incomp': 'incompatible', 'fail' : 'incompatible'] + if (types.containsKey(type)) type = types[type] + if (!(type in ['requiredDependency', 'embeddedLibrary', 'optionalDependency', 'tool', 'incompatible'])) { + throw new Exception('Invalid Curseforge dependency type: ' + type) + } + mainFile.addRelation(slug, type) + } + } + + for (artifact in getSecondaryArtifacts()) { + mainFile.withAdditionalFile(artifact) + } + doFirst { - def mainFile = upload(curseForgeProjectId, reobfJar) def changelogFile = getChangelog() def changelogRaw = changelogFile.exists() ? changelogFile.getText('UTF-8') : "" - mainFile.displayName = versionDisplayFormat.replace('$MOD_NAME', modName).replace('$VERSION', modVersion) - mainFile.releaseType = getReleaseType() mainFile.changelog = changelogRaw mainFile.changelogType = 'markdown' - mainFile.addModLoader 'Forge' - mainFile.addJavaVersion "Java 8" - mainFile.addGameVersion minecraftVersion - - if (curseForgeRelations.size() != 0) { - String[] deps = curseForgeRelations.split(';') - deps.each { dep -> - if (dep.size() == 0) { - return - } - String[] parts = dep.split(':') - String type = parts[0], slug = parts[1] - def types = [ - 'req' : 'requiredDependency', 'required': 'requiredDependency', - 'opt' : 'optionalDependency', 'optional': 'optionalDependency', - 'embed' : 'embeddedLibrary', 'embedded': 'embeddedLibrary', - 'incomp': 'incompatible', 'fail' : 'incompatible'] - if (types.containsKey(type)) type = types[type] - if (!(type in ['requiredDependency', 'embeddedLibrary', 'optionalDependency', 'tool', 'incompatible'])) { - throw new Exception('Invalid Curseforge dependency type: ' + type) - } - mainFile.addRelation(slug, type) - } - } - for (artifact in getSecondaryArtifacts()) { - def additionalFile = mainFile.withAdditionalFile(artifact) - additionalFile.changelog = changelogRaw + for (artifact in mainFile.additionalArtifacts) { + artifact.changelog = changelogRaw } } } diff --git a/gradle.properties b/gradle.properties index 921849c..b9cddbd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,8 @@ modId = lwjgl3ify # Root package of the mod, used to find various classes in other properties, # mcmod.info substitution, enabling assertions in run tasks, etc. modGroup = me.eigenraven.lwjgl3ify +# don't conflict with 1.7.10 versions, change maven group +mavenArtifactGroup = io.github.twilightflower # Updates your build.gradle and settings.gradle automatically whenever an update is available. autoUpdateBuildScript = false