Skip to content

Commit 4ec07d0

Browse files
committed
update
1 parent 8c6d892 commit 4ec07d0

File tree

3 files changed

+233
-204
lines changed

3 files changed

+233
-204
lines changed

build.gradle

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//version: 1743737794
1+
//version: 1753288091
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
5557
checkPropertyExists("modName")
@@ -372,9 +374,9 @@ minecraft {
372374
extraRunJvmArguments.add("-ea:${modGroup}")
373375
if (usesMixins.toBoolean()) {
374376
extraRunJvmArguments.addAll([
375-
'-Dmixin.hotSwap=true',
376-
'-Dmixin.checks.interfaces=true',
377-
'-Dmixin.debug.export=true'
377+
'-Dmixin.hotSwap=true',
378+
'-Dmixin.checks.interfaces=true',
379+
'-Dmixin.debug.export=true'
378380
])
379381
}
380382

@@ -870,9 +872,9 @@ if (enableJava17RunTasks.toBoolean()) {
870872

871873
dependencies {
872874
if (modId != 'lwjgl3ify') {
873-
java17Dependencies("io.github.twilightflower:lwjgl3ify:1.0.0")
874-
java17PatchDependencies("io.github.twilightflower:lwjgl3ify:1.0.0:forgePatches") {
875-
transitive = false
875+
java17Dependencies("io.github.twilightflower:lwjgl3ify:1.0.1")
876+
java17PatchDependencies("io.github.twilightflower:lwjgl3ify:1.0.1:forgePatches") {
877+
transitive = false
876878
}
877879
}
878880
}
@@ -1009,7 +1011,7 @@ abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
10091011

10101012
if (project.usesMixins.toBoolean()) {
10111013
this.extraJvmArgs.addAll(project.provider(() -> {
1012-
def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(mixinProviderSpec))
1014+
def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec))
10131015
mixinCfg.canBeConsumed = false
10141016
mixinCfg.canBeResolved = true
10151017
mixinCfg.transitive = false
@@ -1475,14 +1477,28 @@ tasks.register('faq') {
14751477
"To add new dependencies to your project, place them in 'dependencies.gradle', NOT in 'build.gradle' as they would be replaced when the script updates.\n" +
14761478
"To add new repositories to your project, place them in 'repositories.gradle'.\n" +
14771479
"If you need additional gradle code to run, you can place it in a file named 'addon.gradle' (or either of the above, up to you for organization).\n\n" +
1478-
"If your build fails to recognize the syntax of newer Java versions, enable Jabel in your 'gradle.properties' under the option name 'enableModernJavaSyntax'.\n" +
1480+
"If your build fails to recognize the syntax of newer Java versions, enable Jabel in your 'buildscript.properties' under the option name 'enableModernJavaSyntax'.\n" +
14791481
"To see information on how to configure your IDE properly for Java 17, see https://github.com/GTModpackTeam/Buildscripts/blob/master/docs/jabel.md\n\n" +
14801482
"Report any issues or feature requests you have for this build script to https://github.com/GTModpackTeam/Buildscripts/issues\n")
14811483
}
14821484
}
14831485

14841486

14851487
// Helpers
1488+
def loadProjectProperties() {
1489+
def configFile = file("buildscript.properties")
1490+
if (configFile.exists()) {
1491+
configFile.withReader {
1492+
def prop = new Properties()
1493+
prop.load(it)
1494+
new ConfigSlurper().parse(prop).forEach { String k, def v ->
1495+
project.ext.setProperty(k, v)
1496+
}
1497+
}
1498+
} else {
1499+
print("Failed to read from buildscript.properties, as it did not exist!")
1500+
}
1501+
}
14861502

14871503
def getDefaultArtifactGroup() {
14881504
def lastIndex = project.modGroup.lastIndexOf('.')
@@ -1495,7 +1511,7 @@ def getFile(String relativePath) {
14951511

14961512
def checkPropertyExists(String propertyName) {
14971513
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/GTModpackTeam/Buildscripts/blob/main/gradle.properties")
1514+
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/GTModpackTeam/Buildscripts/blob/main/buildscript.properties and https://github.com/GTModpackTeam/Buildscripts/blob/main/gradle.properties")
14991515
}
15001516
}
15011517

buildscript.properties

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
modName = TestMod
2+
3+
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
4+
modId = testmod
5+
6+
modGroup = com.github.gtexpert.testmod
7+
8+
# Version of your mod.
9+
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
10+
modVersion = 1.0.0
11+
12+
# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version)
13+
includeMCVersionJar = true
14+
15+
# The name of your jar when you produce builds, not including any versioning info
16+
modArchivesBaseName = testmod
17+
18+
# Will update your build.gradle automatically whenever an update is available
19+
autoUpdateBuildScript = false
20+
21+
minecraftVersion = 1.12.2
22+
23+
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
24+
# restart Minecraft in development. Choose this dependent on your mod:
25+
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
26+
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
27+
# Alternatively this can be set with the 'DEV_USERNAME' environment variable.
28+
developmentEnvironmentUserName = Developer
29+
30+
# Additional arguments applied to the JVM when launching minecraft
31+
# Syntax: -arg1=value1;-arg2=value2;...
32+
# Example value: -Dmixin.debug.verify=true;-XX:+UnlockExperimentalVMOptions
33+
additionalJavaArguments =
34+
35+
# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8.
36+
# See https://github.com/bsideup/jabel for details on how this works.
37+
# Using this requires that you use a Java 17 JDK for development.
38+
enableModernJavaSyntax = true
39+
40+
# Enables runClient/runServer tasks for Java 17 and Java 21 using LWJGL3ify.
41+
# This is primarily used to test if your mod is compatible with platforms running
42+
# Minecraft 1.12.2 on modern versions of Java and LWJGL, and assist in fixing any problems with it.
43+
# Using this requires that you use a Java 17/Java 21 JDK for development.
44+
enableJava17RunTasks = false
45+
46+
# Generate a class with String fields for the mod id, name and version named with the fields below
47+
generateGradleTokenClass = com.github.gtexpert.testmod.Tags
48+
gradleTokenModId = MODID
49+
gradleTokenModName = MODNAME
50+
gradleTokenVersion = VERSION
51+
52+
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
53+
# leave this property empty.
54+
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
55+
apiPackage =
56+
57+
# If you want to keep your API code in src/api instead of src/main
58+
useSrcApiPath = false
59+
60+
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/
61+
# There can be multiple files in a comma-separated list.
62+
# Example value: mymodid_at.cfg,jei_at.cfg
63+
accessTransformersFile =
64+
65+
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
66+
usesMixins = false
67+
68+
# Mixin Provider to use. Primarily changed when needing to use a different version.
69+
mixinProviderSpec = zone.rong:mixinbooter:9.4
70+
71+
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
72+
mixinsPackage =
73+
# Location of the mixin config refmap. If left, blank, defaults to "mixins.${modId}.refmap.json". Target file must have the "json" extension.
74+
mixinConfigRefmap =
75+
# Automatically generates a mixin config json if enabled, with the name mixins.modid.json
76+
generateMixinConfig = true
77+
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
78+
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
79+
coreModClass =
80+
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod (meaning that
81+
# there is no class annotated with @Mod) you want this to be true. When in doubt: leave it on false!
82+
containsMixinsAndOrCoreModOnly = false
83+
84+
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
85+
forceEnableMixins = true
86+
87+
# Outputs pre-transformed and post-transformed loaded classes to run/CLASSLOADER_TEMP. Can be used in combination with
88+
# diff to see exactly what your ASM or Mixins are changing in the target file.
89+
# Optionally can be specified with the 'CORE_MOD_DEBUG' env var. Will output a lot of files!
90+
enableCoreModDebug = false
91+
92+
# Adds CurseMaven, Modrinth Maven, BlameJared maven, and some more well-known 1.12.2 repositories
93+
includeWellKnownRepositories = true
94+
95+
# Adds JEI and TheOneProbe to your development environment. Adds them as 'implementation', meaning they will
96+
# be available at compiletime and runtime for your mod (in-game and in-code).
97+
# Overrides the above setting to be always true, as these repositories are needed to fetch the mods
98+
includeCommonDevEnvMods = true
99+
100+
# Some mods require a specific forge version to launch in. When you need to use one of those mods as a dependency,
101+
# and cannot launch with the forge version required, enable this to strip the forge version requirements from that mod.
102+
# This will add 'strip-latest-forge-requirements' as 'runtimeOnlyNonPublishable'.
103+
# Requires useMixins or forceEnableMixins to be true, as the mod uses mixins to function.
104+
stripForgeRequirements = false
105+
106+
107+
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
108+
# responsibility check the licence and request permission for distribution, if required.
109+
usesShadowedDependencies = false
110+
# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access
111+
# their own classes, making the minimization unreliable.
112+
minimizeShadowedDependencies = true
113+
# If disabled, won't rename the shadowed classes.
114+
relocateShadowedDependencies = true
115+
116+
# Separate run directories into "run/client" for runClient task, and "run/server" for runServer task.
117+
# Useful for debugging a server and client simultaneously. If not enabled, it will be in the standard location "run/"
118+
separateRunDirectories = false
119+
120+
# The display name format of versions published to Curse and Modrinth. $MOD_NAME and $VERSION are available variables.
121+
# Default: $MOD_NAME \u2212 $VERSION. \u2212 is the minus character which looks much better than the hyphen minus on Curse.
122+
versionDisplayFormat = $MOD_NAME \u2212 $VERSION
123+
124+
# Publishing to modrinth requires you to set the MODRINTH_API_KEY environment variable to your current modrinth API token.
125+
126+
# The project's ID on Modrinth. Can be either the slug or the ID.
127+
# Leave this empty if you don't want to publish on Modrinth.
128+
# Alternatively this can be set with the 'MODRINTH_PROJECT_ID' environment variable.
129+
modrinthProjectId =
130+
131+
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
132+
# Syntax: scope1-type1:name1;scope2-type2:name2;...
133+
# Where scope can be one of [required, optional, incompatible, embedded],
134+
# type can be one of [project, version],
135+
# and the name is the Modrinth project or version slug/id of the other mod.
136+
# Example: required-project:jei;optional-project:top;incompatible-project:gregtech
137+
modrinthRelations =
138+
139+
140+
# Publishing to CurseForge requires you to set the CURSEFORGE_API_KEY environment variable to one of your CurseForge API tokens.
141+
142+
# The project's numeric ID on CurseForge. You can find this in the About Project box.
143+
# Leave this empty if you don't want to publish on CurseForge.
144+
# Alternatively this can be set with the 'CURSEFORGE_PROJECT_ID' environment variable.
145+
curseForgeProjectId =
146+
147+
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
148+
# Syntax: type1:name1;type2:name2;...
149+
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
150+
# and the name is the CurseForge project slug of the other mod.
151+
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
152+
curseForgeRelations =
153+
154+
# This project's release type on CurseForge and/or Modrinth
155+
# Alternatively this can be set with the 'RELEASE_TYPE' environment variable.
156+
# Allowed types: release, beta, alpha
157+
releaseType = release
158+
159+
# Generate a default changelog for releases. Requires git to be installed, as it uses it to generate a changelog of
160+
# commits since the last tagged release.
161+
generateDefaultChangelog = false
162+
163+
# Prevent the source code from being published
164+
noPublishedSources = false
165+
166+
167+
# Publish to a custom maven location. Follows a few rules:
168+
# Group ID can be set with the 'ARTIFACT_GROUP_ID' environment variable, default to 'project.group'
169+
# Artifact ID can be set with the 'ARTIFACT_ID' environment variable, default to 'project.name'
170+
# Version can be set with the 'RELEASE_VERSION' environment variable, default to 'modVersion'
171+
# For maven credentials:
172+
# Username is set with the 'MAVEN_USER' environment variable, default to "NONE"
173+
# Password is set with the 'MAVEN_PASSWORD' environment variable, default to "NONE"
174+
customMavenPublishUrl =
175+
176+
# The group for maven artifacts. Defaults to the 'project.modGroup' until the last '.' (if any).
177+
# So 'mymod' becomes 'mymod' and 'com.myname.mymodid' 'becomes com.myname'
178+
mavenArtifactGroup =
179+
180+
# Enable spotless checks
181+
# Enforces code formatting on your source code
182+
# By default this will use the files found here: https://github.com/GTModpackTeam/Buildscripts/tree/master/spotless
183+
# to format your code. However, you can create your own version of these files and place them in your project's
184+
# root directory to apply your own formatting options instead.
185+
enableSpotless = true
186+
187+
# Enable JUnit testing platform used for testing your code.
188+
# Uses JUnit 5. See guide and documentation here: https://junit.org/junit5/docs/current/user-guide/
189+
enableJUnit = true
190+
191+
# Deployment debug setting
192+
# Uncomment this to test deployments to CurseForge and Modrinth
193+
# Alternatively, you can set the 'DEPLOYMENT_DEBUG' environment variable.
194+
deploymentDebug = false
195+
196+
197+
# Gradle Settings
198+
# Effectively applies the '--stacktrace' flag by default
199+
org.gradle.logging.stacktrace = all
200+
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
201+
# This is required to provide enough memory for the Minecraft decompilation process.
202+
org.gradle.jvmargs = -Xmx3G

0 commit comments

Comments
 (0)