Skip to content

Commit

Permalink
Test for Forge reobfuscation task.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed May 26, 2024
1 parent 976af06 commit 874fcb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
27 changes: 18 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id "org.sonarqube" version "4.4.1.3373"
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
id "com.hypherionmc.modutils.modpublisher" version "2.1.4" apply false
id "fabric-loom" version "1.5-SNAPSHOT" apply false
}

sonar {
Expand All @@ -22,9 +21,6 @@ subprojects { subproject ->
apply plugin: "java-library"
apply plugin: "com.hypherionmc.modutils.modpublisher"
apply plugin: "maven-publish"
if (subproject.name == "fabric") {
apply plugin: "fabric-loom"
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.withSourcesJar()
Expand Down Expand Up @@ -118,21 +114,34 @@ subprojects { subproject ->
def changelog_body = "See [Changelog](https://github.com/${github_user}/${mod_id_kebab}/blob/master/CHANGELOG.md#${minecraft_version.replaceAll('\\.', '')}-${mod_version.replaceAll('\\.', '')}---${new Date().format("yyyyMMdd")})."
def version_type = mod_version.replaceFirst("([0-9]+\\.?)+-?", "") ?: "release"
def loader = "Common"
def artifact = jar
switch (subproject.name) {
case "fabric":
loader = "Fabric"
artifact = remapJar
break
case "forge":
loader = "Forge"
artifact = jarJar
break
case "neoforge":
loader = "NeoForge"
break
}

tasks.register("artifact", Jar) {
group = "build"
description = "Assembles the artifact specific for ${loader}"
switch (loader) {
case "Fabric":
dependsOn "remapJar"
break
case "Forge":
dependsOn "jarJar"
break
default:
dependsOn "jar"
break
}
}

publishing {
repositories {
maven {
Expand All @@ -149,8 +158,8 @@ subprojects { subproject ->
groupId = project.group
artifactId = "${mod_id_kebab}-${subproject.name}"
version = project.version
artifact subproject.artifact
from components.java
artifact artifact
pom {
name = "[${loader} - ${minecraft_version}] ${mod_title} v${mod_version}"
description = "${description}"
Expand Down Expand Up @@ -188,7 +197,7 @@ subprojects { subproject ->
setVersion(project.version)
setChangelog(changelog_body)
setVersionType(version_type)
setArtifact(artifact)
setArtifact(subproject.artifact)
setDisableMalwareScanner(true) // Disable the built in Fractureizer scanner.
setDisableEmptyJarCheck(true) // Disable check for valid mod metadata entry in artifact, which could possibly mean that the jar is empty.
setModrinthID(mod_id_kebab)
Expand Down
4 changes: 3 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
plugins {}
plugins {
id "fabric-loom" version "1.5-SNAPSHOT"
}

dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
Expand Down

0 comments on commit 874fcb3

Please sign in to comment.