diff --git a/build.gradle b/build.gradle index ac19ee2..cf48672 100644 --- a/build.gradle +++ b/build.gradle @@ -25,16 +25,14 @@ logger.lifecycle("Building ViaFabric: $version") def getBranch() { def ENV = System.getenv() + def branch = "unknown" + if (ENV.GITHUB_REF) { - def branch = ENV.GITHUB_REF - return branch.substring(branch.lastIndexOf("/") + 1) + branch = ENV.GITHUB_REF + } else if (grgit != null) { + branch = grgit.branch.current().name } - if (grgit == null) { - return "unknown" - } - - def branch = grgit.branch.current().name return branch.substring(branch.lastIndexOf("/") + 1) } @@ -87,7 +85,7 @@ allprojects { subprojects { dependencies { - implementation (rootProject) { + implementation(rootProject) { exclude group: "net.fabricmc", module: "fabric-loader" // prevent duplicate fabric-loader on run } } @@ -161,8 +159,9 @@ processResources { } } -List mcReleases = new ArrayList<>( - Arrays.asList("1.18.2", "1.17.1", "1.16.5", "1.15.2", "1.14.4", "1.8.9")) +List mcReleases = Arrays.stream(rootProject.publish_mc_versions.toString().split(",")) + .map({ it -> it.trim() }) + .collect(Collectors.toList()) List javaVersions = IntStream.rangeClosed(8, 18) .mapToObj { n -> (String) "Java $n" } .collect(Collectors.toList()) @@ -214,7 +213,7 @@ modrinth { uploadFile.set(remapJar) List mcs = new ArrayList<>(mcReleases) - if (!rootProject.modrinth_mc_snapshot.isEmpty()) mcs.add(rootProject.modrinth_mc_snapshot) + if (!rootProject.modrinth_mc_snapshot.isEmpty()) mcs.add(rootProject.modrinth_mc_snapshot.toString()) gameVersions.set(mcs) loaders.set(["fabric"]) diff --git a/gradle.properties b/gradle.properties index 91a2b67..c05f544 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,11 @@ org.gradle.jvmargs=-Xms32M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication loader_version=0.14.14 -viaver_version=4.6.0-1.19.4-rc2-SNAPSHOT +viaver_version=4.6.0 yaml_version=1.33 +publish_mc_versions=1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.8.9 # example: 1.19.1-rc2 -modrinth_mc_snapshot=1.19.4-rc2 +modrinth_mc_snapshot= # example: 1.19-Snapshot -curseforge_mc_snapshot=1.19-Snapshot +curseforge_mc_snapshot=