aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle175
-rw-r--r--gradle.properties3
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin61608 -> 43462 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties3
-rwxr-xr-xgradlew29
-rw-r--r--settings.gradle9
6 files changed, 130 insertions, 89 deletions
diff --git a/build.gradle b/build.gradle
index d90330a85c..952a3c59be 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-//version: 1689878047
+//version: 1704650211
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -28,27 +28,11 @@ import java.util.concurrent.TimeUnit
buildscript {
repositories {
- mavenCentral()
-
- maven {
- name 'forge'
- url 'https://maven.minecraftforge.net'
- }
maven {
// GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven"
- url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
- allowInsecureProtocol = true
- }
- maven {
- name 'sonatype'
- url 'https://oss.sonatype.org/content/repositories/snapshots/'
- }
- maven {
- name 'Scala CI dependencies'
- url 'https://repo1.maven.org/maven2/'
+ url "https://nexus.gtnewhorizons.com/repository/public/"
}
-
mavenLocal()
}
}
@@ -64,12 +48,12 @@ plugins {
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id 'com.palantir.git-version' version '3.0.0' apply false
- id 'de.undercouch.download' version '5.4.0'
+ id 'de.undercouch.download' version '5.5.0'
id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
- id 'com.gtnewhorizons.retrofuturagradle' version '1.3.21'
+ id 'com.gtnewhorizons.retrofuturagradle' version '1.3.27'
}
print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -89,6 +73,23 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
def projectJavaVersion = JavaLanguageVersion.of(8)
boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false
+boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false
+
+final String CHECKSTYLE_CONFIG = """
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+ "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+<module name="Checker">
+ <module name="TreeWalker">
+ <!-- Use CHECKSTYLE:OFF and CHECKSTYLE:ON comments to suppress checkstyle lints in a block -->
+ <module name="SuppressionCommentFilter"/>
+ <module name="AvoidStarImport">
+ <!-- Allow static wildcard imports for cases like Opcodes and LWJGL classes, these don't get created accidentally by the IDE -->
+ <property name="allowStaticMemberImports" value="true"/>
+ </module>
+ </module>
+</module>
+"""
checkPropertyExists("modName")
checkPropertyExists("modId")
@@ -116,7 +117,7 @@ propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("channel", "stable")
propertyDefaultIfUnset("mappingsVersion", "12")
propertyDefaultIfUnset("usesMavenPublishing", true)
-propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases")
+propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/")
propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
@@ -140,6 +141,17 @@ if (!disableSpotless) {
apply from: Blowdryer.file('spotless.gradle')
}
+if (!disableCheckstyle) {
+ apply plugin: 'checkstyle'
+ tasks.named("checkstylePatchedMc") { enabled = false }
+ tasks.named("checkstyleMcLauncher") { enabled = false }
+ tasks.named("checkstyleIdeVirtualMain") { enabled = false }
+ tasks.named("checkstyleInjectedTags") { enabled = false }
+ checkstyle {
+ config = resources.text.fromString(CHECKSTYLE_CONFIG)
+ }
+}
+
String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"
@@ -274,7 +286,7 @@ if (apiPackage) {
}
if (accessTransformersFile) {
- for (atFile in accessTransformersFile.split(",")) {
+ for (atFile in accessTransformersFile.split(" ")) {
String targetFile = "src/main/resources/META-INF/" + atFile.trim()
if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
@@ -401,9 +413,13 @@ if (identifiedVersion == versionOverride) {
group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
- archivesBaseName = customArchiveBaseName
+ base {
+ archivesName = customArchiveBaseName
+ }
} else {
- archivesBaseName = modId
+ base {
+ archivesName = modId
+ }
}
@@ -556,16 +572,15 @@ afterEvaluate {
repositories {
maven {
- name 'Overmind forge repo mirror'
- url 'https://gregtech.overminddl1.com/'
- mavenContent {
- excludeGroup("net.minecraftforge") // missing the `universal` artefact
- }
+ name = "GTNH Maven"
+ url = "https://nexus.gtnewhorizons.com/repository/public/"
+ // Links for convenience:
+ // Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/
+ // Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases
}
maven {
- name = "GTNH Maven"
- url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
- allowInsecureProtocol = true
+ name 'Overmind forge repo mirror'
+ url 'https://gregtech.overminddl1.com/'
}
maven {
name 'sonatype'
@@ -575,24 +590,34 @@ repositories {
}
}
if (includeWellKnownRepositories.toBoolean()) {
- maven {
- name "CurseMaven"
- url "https://cursemaven.com"
- content {
+ exclusiveContent {
+ forRepository {
+ maven {
+ name "CurseMaven"
+ url "https://cursemaven.com"
+ }
+ }
+ filter {
includeGroup "curse.maven"
}
}
- maven {
- name = "ic2"
- url = "https://maven.ic2.player.to/"
- metadataSources {
- mavenPom()
- artifact()
+ exclusiveContent {
+ forRepository {
+ maven {
+ name = "Modrinth"
+ url = "https://api.modrinth.com/maven"
+ }
+ }
+ filter {
+ includeGroup "maven.modrinth"
}
}
maven {
- name = "ic2-mirror"
- url = "https://maven2.ic2.player.to/"
+ name = "ic2"
+ url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/")
+ content {
+ includeGroup "net.industrial-craft"
+ }
metadataSources {
mavenPom()
artifact()
@@ -607,11 +632,13 @@ repositories {
def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins"
-def mixinProviderVersion = "0.1.7.1"
+def mixinProviderVersion = "0.1.13"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
+def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
+
dependencies {
if (usesMixins.toBoolean()) {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
@@ -623,7 +650,7 @@ dependencies {
}
}
if (usesMixins.toBoolean()) {
- implementation(modUtils.enableMixins(mixinProviderSpec))
+ implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
}
@@ -646,6 +673,8 @@ configurations.all {
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")
+
+ substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets')
}
}
@@ -676,8 +705,6 @@ if (file('dependencies.gradle.kts').exists()) {
throw new RuntimeException("Missing dependencies.gradle[.kts]")
}
-def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
-
tasks.register('generateAssets') {
group = "GTNH Buildscript"
description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed"
@@ -754,23 +781,14 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
- def lwjgl3ifyVersion = '1.4.0'
- def asmVersion = '9.4'
+ def lwjgl3ifyVersion = '1.5.7'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
- java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.19')
+ java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
}
- java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
- java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
- java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
- java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
- java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}")
- java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
- java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
- java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
}
@@ -943,8 +961,7 @@ if (usesShadowedDependencies.toBoolean()) {
configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
tasks.named("jar", Jar) {
- enabled = false
- finalizedBy(tasks.shadowJar)
+ archiveClassifier.set('dev-preshadow')
}
tasks.named("reobfJar", ReobfuscatedJar) {
inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile}))
@@ -953,11 +970,6 @@ if (usesShadowedDependencies.toBoolean()) {
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip()
}
- for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
- tasks.named(runTask).configure {
- dependsOn("shadowJar")
- }
- }
}
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
ext.publishableObfJar = tasks.reobfJar
@@ -1133,7 +1145,10 @@ tasks.named("processIdeaSettings").configure {
tasks.named("ideVirtualMainClasses").configure {
// Make IntelliJ "Build project" build the mod jars
- dependsOn("jar", "reobfJar", "spotlessCheck")
+ dependsOn("jar", "reobfJar")
+ if (!disableSpotless) {
+ dependsOn("spotlessCheck")
+ }
}
// workaround variable hiding in pom processing
@@ -1154,12 +1169,11 @@ publishing {
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
}
}
-
repositories {
- if (usesMavenPublishing.toBoolean()) {
+ if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
maven {
url = mavenPublishUrl
- allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
+ allowInsecureProtocol = mavenPublishUrl.startsWith("http://")
credentials {
username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
@@ -1278,7 +1292,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating
-def buildscriptGradleVersion = "8.2.1"
+def buildscriptGradleVersion = "8.5"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
@@ -1557,6 +1571,25 @@ def getSecondaryArtifacts() {
return secondaryArtifacts
}
+def getURL(String main, String fallback) {
+ return pingURL(main, 10000) ? main : fallback
+}
+
+// credit: https://stackoverflow.com/a/3584332
+def pingURL(String url, int timeout) {
+ url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates.
+ try {
+ HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection()
+ connection.setConnectTimeout(timeout)
+ connection.setReadTimeout(timeout)
+ connection.setRequestMethod("HEAD")
+ int responseCode = connection.getResponseCode()
+ return 200 <= responseCode && responseCode <= 399
+ } catch (IOException ignored) {
+ return false
+ }
+}
+
// For easier scripting of things that require variables defined earlier in the buildscript
if (file('addon.late.gradle.kts').exists()) {
apply from: 'addon.late.gradle.kts'
diff --git a/gradle.properties b/gradle.properties
index 691386d44a..a4e031edf9 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -141,3 +141,6 @@ curseForgeRelations =
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
+
+# TODO: Remove when you modify this repository, it's been put in for automatic buildscript updates
+disableCheckstyle = true
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index ccebba7710..d64cd49177 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 37aef8d3f0..1af9e0930b 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 79a61d421c..1aa94a4269 100755
--- a/gradlew
+++ b/gradlew
@@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
+ fi
fi
# Increase the maximum file descriptors if we can.
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC3045
+ # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC3045
+ # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
diff --git a/settings.gradle b/settings.gradle
index 01ea5f121a..8a66026e3d 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -4,10 +4,9 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
- url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
- allowInsecureProtocol = true
+ url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
- includeGroup("com.gtnewhorizons.retrofuturagradle")
+ includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
@@ -17,8 +16,8 @@ pluginManagement {
}
plugins {
- id 'com.diffplug.blowdryerSetup' version '1.6.0'
- id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
+ id 'com.diffplug.blowdryerSetup' version '1.7.1'
+ id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
}
blowdryerSetup {