1- // version: 1723428048
1+ // version: 1777224609
22/*
33 * DO NOT CHANGE THIS FILE!
44 * Also, you may replace this file at any time if there is an update available.
@@ -50,6 +50,8 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
5050
5151
5252// Project properties
53+ loadProjectProperties()
54+
5355
5456// Required properties: we don't know how to handle these being missing gracefully
5557checkPropertyExists(" modName" )
@@ -80,6 +82,7 @@ propertyDefaultIfUnset("includeWellKnownRepositories", true)
8082propertyDefaultIfUnset(" includeCommonDevEnvMods" , true )
8183propertyDefaultIfUnset(" stripForgeRequirements" , false )
8284propertyDefaultIfUnset(" noPublishedSources" , false )
85+ propertyDefaultIfUnset(" mixinProviderSpec" , " zone.rong:mixinbooter:10.6" )
8386propertyDefaultIfUnset(" forceEnableMixins" , false )
8487propertyDefaultIfUnset(" mixinConfigRefmap" , " mixins.${ project.modId} .refmap.json" )
8588propertyDefaultIfUnsetWithEnvVar(" enableCoreModDebug" , false , " CORE_MOD_DEBUG" )
@@ -315,14 +318,6 @@ tasks.withType(ScalaCompile).configureEach {
315318}
316319
317320
318- // Allow others using this buildscript to have custom gradle code run
319- if (getFile(' addon.gradle' ). exists()) {
320- apply from : ' addon.gradle'
321- } else if (getFile(' addon.gradle.kts' ). exists()) {
322- apply from : ' addon.gradle.kts'
323- }
324-
325-
326321// Configure Minecraft
327322
328323// Try to gather mod version from git tags if version is not manually specified
@@ -369,11 +364,14 @@ minecraft {
369364
370365 // JVM arguments
371366 extraRunJvmArguments. add(" -ea:${ modGroup} " )
367+
368+ // enable JLine Terminal since idea_rt.jar is no longer added to the classpath
369+ extraRunJvmArguments. add(' -Dterminal.jline=true' )
372370 if (usesMixins. toBoolean()) {
373371 extraRunJvmArguments. addAll([
374- ' -Dmixin.hotSwap=true' ,
375- ' -Dmixin.checks.interfaces=true' ,
376- ' -Dmixin.debug.export=true'
372+ ' -Dmixin.hotSwap=true' ,
373+ ' -Dmixin.checks.interfaces=true' ,
374+ ' -Dmixin.debug.export=true'
377375 ])
378376 }
379377
@@ -518,7 +516,6 @@ configurations {
518516 testRuntimeClasspath. extendsFrom(runtimeOnlyNonPublishable)
519517}
520518
521- String mixinProviderSpec = ' zone.rong:mixinbooter:9.1'
522519dependencies {
523520 if (usesMixins. toBoolean()) {
524521 annotationProcessor ' org.ow2.asm:asm-debug-all:5.2'
@@ -624,12 +621,12 @@ test {
624621 }. get()
625622
626623 testLogging {
627- events TestLogEvent . STARTED , TestLogEvent . PASSED , TestLogEvent . FAILED
624+ events TestLogEvent . SKIPPED , TestLogEvent . PASSED , TestLogEvent . FAILED
628625 exceptionFormat TestExceptionFormat . FULL
629626 showExceptions true
630627 showStackTraces true
631628 showCauses true
632- showStandardStreams true
629+ showStandardStreams false
633630 }
634631
635632 if (enableJUnit. toBoolean()) {
@@ -870,10 +867,10 @@ if (enableJava17RunTasks.toBoolean()) {
870867
871868 dependencies {
872869 if (modId != ' lwjgl3ify' ) {
873- java17Dependencies(" io.github.twilightflower:lwjgl3ify:1.0.0 " )
874- }
875- java17PatchDependencies( " io.github.twilightflower:lwjgl3ify:1.0.0:forgePatches " ) {
876- transitive = false
870+ java17Dependencies(" io.github.twilightflower:lwjgl3ify:1.0.1 " )
871+ java17PatchDependencies( " io.github.twilightflower:lwjgl3ify:1.0.1:forgePatches " ) {
872+ transitive = false
873+ }
877874 }
878875 }
879876
@@ -1324,7 +1321,7 @@ def addModrinthDep(String scope, String type, String name) {
13241321 project. modrinth. dependencies. add(dep)
13251322}
13261323
1327- if (customMavenPublishUrl) {
1324+ /* Maven Publishing */ {
13281325 String publishedVersion = modVersion
13291326
13301327 publishing {
@@ -1345,12 +1342,18 @@ if (customMavenPublishUrl) {
13451342 }
13461343
13471344 repositories {
1348- maven {
1349- url = customMavenPublishUrl
1350- allowInsecureProtocol = ! customMavenPublishUrl. startsWith(' https' )
1351- credentials {
1352- username = providers. environmentVariable(' MAVEN_USER' ). getOrElse(' NONE' )
1353- password = providers. environmentVariable(' MAVEN_PASSWORD' ). getOrElse(' NONE' )
1345+ if (customMavenPublishUrl) {
1346+ maven {
1347+ url = customMavenPublishUrl
1348+ allowInsecureProtocol = ! customMavenPublishUrl. startsWith(' https' )
1349+ credentials {
1350+ username = providers. environmentVariable(' MAVEN_USER' ). getOrElse(' NONE' )
1351+ password = providers. environmentVariable(' MAVEN_PASSWORD' ). getOrElse(' NONE' )
1352+ }
1353+ }
1354+ } else {
1355+ maven {
1356+ mavenLocal()
13541357 }
13551358 }
13561359 }
@@ -1483,6 +1486,20 @@ tasks.register('faq') {
14831486
14841487
14851488// Helpers
1489+ def loadProjectProperties () {
1490+ def configFile = file(" gradle.properties" )
1491+ if (configFile. exists()) {
1492+ configFile. withReader {
1493+ def prop = new Properties ()
1494+ prop. load(it)
1495+ new ConfigSlurper (). parse(prop). forEach { String k , def v ->
1496+ project. ext. setProperty(k, v)
1497+ }
1498+ }
1499+ } else {
1500+ print (" Failed to read from gradle.properties, as it did not exist!" )
1501+ }
1502+ }
14861503
14871504def getDefaultArtifactGroup () {
14881505 def lastIndex = project. modGroup. lastIndexOf(' .' )
@@ -1495,7 +1512,7 @@ def getFile(String relativePath) {
14951512
14961513def checkPropertyExists (String propertyName ) {
14971514 if (! project. hasProperty(propertyName)) {
1498- throw new GradleException (" This project requires a property \" " + propertyName + " \" ! Please add it your \" gradle.properties\" . You can find all properties and their description here: https://github.com/GregTechCEu/Buildscripts/blob/main/gradle.properties" )
1515+ throw new GradleException (" This project requires a property \" " + propertyName + " \" ! Please add it your \" buildscript.properties \" or \" gradle.properties\" . You can find all properties and their description here: https://github.com/GregTechCEu/Buildscripts/blob/main/buildscript.properties and https://github.com/GregTechCEu/Buildscripts/blob/main/gradle.properties" )
14991516 }
15001517}
15011518
@@ -1533,3 +1550,11 @@ def getLastTag() {
15331550 return runShell(' git describe --abbrev=0 --tags ' +
15341551 (githubTag. isPresent() ? runShell(' git rev-list --tags --skip=1 --max-count=1' ) : ' ' ))
15351552}
1553+
1554+
1555+ // Allow others using this buildscript to have custom gradle code run
1556+ if (getFile(' addon.gradle' ). exists()) {
1557+ apply from : ' addon.gradle'
1558+ } else if (getFile(' addon.gradle.kts' ). exists()) {
1559+ apply from : ' addon.gradle.kts'
1560+ }
0 commit comments