Skip to content

Commit a19b7a5

Browse files
authored
Update Buildscript (#343)
* update build.gradle * update properties more * remove unneeded `project` * sort alphabetically * update mixinbooter * make mod_dependencies like runtime_dependencies * rename some mods to be the full project name * rename dev settings to dev instead of debug * terminal of color update * change mod version to 1.2.5 * gradle settings are in gradle.properties
1 parent 4108364 commit a19b7a5

File tree

5 files changed

+449
-425
lines changed

5 files changed

+449
-425
lines changed

addon.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
minecraft {
44
injectedTags.put 'GROOVY_VERSION', groovy_version
55

6-
if (project.debug_use_examples_folder.toBoolean()) {
6+
if (project.dev_use_examples_folder.toBoolean()) {
77
extraRunJvmArguments.add('-Dgroovyscript.use_examples_folder=true')
88
}
9-
if (project.debug_run_ls.toBoolean()) {
9+
if (project.dev_run_ls.toBoolean()) {
1010
extraRunJvmArguments.add('-Dgroovyscript.run_ls=true')
1111
}
12-
if (project.debug_generate_examples.toBoolean()) {
12+
if (project.dev_generate_examples.toBoolean()) {
1313
extraRunJvmArguments.add('-Dgroovyscript.generate_examples=true')
1414
}
15-
if (project.debug_generate_wiki.toBoolean()) {
15+
if (project.dev_generate_wiki.toBoolean()) {
1616
extraRunJvmArguments.add('-Dgroovyscript.generate_wiki=true')
1717
}
18-
if (project.debug_generate_and_crash.toBoolean()) {
18+
if (project.dev_generate_and_crash.toBoolean()) {
1919
extraRunJvmArguments.add('-Dgroovyscript.generate_and_crash=true')
2020
}
21-
if (project.debug_log_missing_lang_keys.toBoolean()) {
21+
if (project.dev_log_missing_lang_keys.toBoolean()) {
2222
extraRunJvmArguments.add('-Dgroovyscript.log_missing_lang_keys=true')
2323
}
24-
if (project.debug_disable_cache.toBoolean()) {
24+
if (project.dev_disable_cache.toBoolean()) {
2525
extraRunJvmArguments.add('-Dgroovyscript.disable_cache=true')
2626
}
2727

build.gradle

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//version: 1723428048
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")
@@ -80,6 +82,7 @@ propertyDefaultIfUnset("includeWellKnownRepositories", true)
8082
propertyDefaultIfUnset("includeCommonDevEnvMods", true)
8183
propertyDefaultIfUnset("stripForgeRequirements", false)
8284
propertyDefaultIfUnset("noPublishedSources", false)
85+
propertyDefaultIfUnset("mixinProviderSpec", "zone.rong:mixinbooter:10.6")
8386
propertyDefaultIfUnset("forceEnableMixins", false)
8487
propertyDefaultIfUnset("mixinConfigRefmap", "mixins.${project.modId}.refmap.json")
8588
propertyDefaultIfUnsetWithEnvVar("enableCoreModDebug", false, "CORE_MOD_DEBUG")
@@ -518,7 +521,6 @@ configurations {
518521
testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
519522
}
520523

521-
String mixinProviderSpec = 'zone.rong:mixinbooter:9.1'
522524
dependencies {
523525
if (usesMixins.toBoolean()) {
524526
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
@@ -870,10 +872,10 @@ if (enableJava17RunTasks.toBoolean()) {
870872

871873
dependencies {
872874
if (modId != 'lwjgl3ify') {
873-
java17Dependencies("io.github.twilightflower:lwjgl3ify:1.0.0")
874-
}
875-
java17PatchDependencies("io.github.twilightflower:lwjgl3ify:1.0.0:forgePatches") {
875+
java17Dependencies("io.github.twilightflower:lwjgl3ify:1.0.1")
876+
java17PatchDependencies("io.github.twilightflower:lwjgl3ify:1.0.1:forgePatches") {
876877
transitive = false
878+
}
877879
}
878880
}
879881

@@ -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/GregTechCEu/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/GregTechCEu/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/GregTechCEu/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/GregTechCEu/Buildscripts/blob/main/buildscript.properties and https://github.com/GregTechCEu/Buildscripts/blob/main/gradle.properties")
14991515
}
15001516
}
15011517

buildscript.properties

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
#
2+
# The "buildscript.properties" file contains settings loaded and used by the "build.gradle" file.
3+
# For settings loaded in all gradle files or custom settings, use "gradle.properties" instead.
4+
# New properties should not be created in this file, use "gradle.properties" instead.
5+
#
6+
7+
# The name of your mod. Can be any sequence of characters.
8+
modName = GroovyScript
9+
10+
# This is a case-sensitive string to identify your mod.
11+
# Must be less than 64 characters and all lowercase. Convention is to only contain alphabetic characters.
12+
modId = groovyscript
13+
14+
# Project package location.
15+
modGroup = com.cleanroommc.groovyscript
16+
17+
# Version of your mod.
18+
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
19+
modVersion = 1.2.5
20+
21+
# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version)
22+
includeMCVersionJar = false
23+
24+
# The name of your jar when you produce builds, not including any versioning info
25+
modArchivesBaseName = groovyscript
26+
27+
# Will update your build.gradle automatically whenever an update is available
28+
autoUpdateBuildScript = false
29+
30+
minecraftVersion = 1.12.2
31+
32+
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
33+
# restart Minecraft in development. Choose this dependent on your mod:
34+
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
35+
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
36+
# Alternatively this can be set with the 'DEV_USERNAME' environment variable.
37+
developmentEnvironmentUserName = Developer
38+
39+
# Additional arguments applied to the JVM when launching minecraft
40+
# Syntax: -arg1=value1;-arg2=value2;...
41+
# Example value: -Dmixin.debug.verify=true;-XX:+UnlockExperimentalVMOptions
42+
additionalJavaArguments = -Dterminal.jline=true
43+
44+
# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8.
45+
# See https://github.com/bsideup/jabel for details on how this works.
46+
# Using this requires that you use a Java 17 JDK for development.
47+
enableModernJavaSyntax = true
48+
49+
# Enables runClient/runServer tasks for Java 17 and Java 21 using LWJGL3ify.
50+
# This is primarily used to test if your mod is compatible with platforms running
51+
# Minecraft 1.12.2 on modern versions of Java and LWJGL, and assist in fixing any problems with it.
52+
# Using this requires that you use a Java 17/Java 21 JDK for development.
53+
enableJava17RunTasks = false
54+
55+
# Generate a class with String fields for the mod id, name and version named with the fields below
56+
generateGradleTokenClass = com.cleanroommc.groovyscript.Tags
57+
gradleTokenModId = MODID
58+
gradleTokenModName = MODNAME
59+
gradleTokenVersion = VERSION
60+
61+
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
62+
# leave this property empty.
63+
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
64+
apiPackage =
65+
66+
# If you want to keep your API code in src/api instead of src/main
67+
useSrcApiPath = false
68+
69+
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/
70+
# There can be multiple files in a comma-separated list.
71+
# Example value: mymodid_at.cfg,jei_at.cfg
72+
accessTransformersFile =
73+
74+
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
75+
usesMixins = true
76+
# Mixin Provider to use. Primarily changed when needing to use a different version.
77+
mixinProviderSpec = zone.rong:mixinbooter:10.7
78+
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
79+
mixinsPackage = core.mixin
80+
# Location of the mixin config refmap. If left, blank, defaults to "mixins.${modId}.refmap.json". Target file must have the "json" extension.
81+
mixinConfigRefmap =
82+
# Automatically generates a mixin config json if enabled, with the name mixins.modid.json
83+
generateMixinConfig = false
84+
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
85+
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
86+
coreModClass = core.GroovyScriptCore
87+
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod (meaning that
88+
# there is no class annotated with @Mod) you want this to be true. When in doubt: leave it on false!
89+
containsMixinsAndOrCoreModOnly = false
90+
91+
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
92+
forceEnableMixins = false
93+
94+
# Outputs pre-transformed and post-transformed loaded classes to run/CLASSLOADER_TEMP. Can be used in combination with
95+
# diff to see exactly what your ASM or Mixins are changing in the target file.
96+
# Optionally can be specified with the 'CORE_MOD_DEBUG' env var. Will output a lot of files!
97+
enableCoreModDebug = false
98+
99+
# Adds CurseMaven, Modrinth Maven, BlameJared maven, and some more well-known 1.12.2 repositories
100+
includeWellKnownRepositories = true
101+
102+
# Adds JEI and TheOneProbe to your development environment. Adds them as 'implementation', meaning they will
103+
# be available at compiletime and runtime for your mod (in-game and in-code).
104+
# Overrides the above setting to be always true, as these repositories are needed to fetch the mods
105+
includeCommonDevEnvMods = true
106+
107+
# Some mods require a specific forge version to launch in. When you need to use one of those mods as a dependency,
108+
# and cannot launch with the forge version required, enable this to strip the forge version requirements from that mod.
109+
# This will add 'strip-latest-forge-requirements' as 'runtimeOnlyNonPublishable'.
110+
# Requires useMixins or forceEnableMixins to be true, as the mod uses mixins to function.
111+
stripForgeRequirements = true
112+
113+
114+
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
115+
# responsibility check the licence and request permission for distribution, if required.
116+
usesShadowedDependencies = false
117+
# If disabled, won't remove unused classes from shaded dependencies. Some libraries use reflection to access
118+
# their own classes, making the minimization unreliable.
119+
minimizeShadowedDependencies = true
120+
# If disabled, won't rename the shadowed classes.
121+
relocateShadowedDependencies = true
122+
123+
# Separate run directories into "run/client" for runClient task, and "run/server" for runServer task.
124+
# Useful for debugging a server and client simultaneously. If not enabled, it will be in the standard location "run/"
125+
separateRunDirectories = false
126+
127+
# The display name format of versions published to Curse and Modrinth. $MOD_NAME and $VERSION are available variables.
128+
# Default: $MOD_NAME \u2212 $VERSION. \u2212 is the minus character which looks much better than the hyphen minus on Curse.
129+
versionDisplayFormat = $MOD_NAME \u2212 $VERSION
130+
131+
# Publishing to modrinth requires you to set the MODRINTH_API_KEY environment variable to your current modrinth API token.
132+
133+
# The project's ID on Modrinth. Can be either the slug or the ID.
134+
# Leave this empty if you don't want to publish on Modrinth.
135+
# Alternatively this can be set with the 'MODRINTH_PROJECT_ID' environment variable.
136+
modrinthProjectId = GJaDRTrb
137+
138+
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
139+
# Syntax: scope1-type1:name1;scope2-type2:name2;...
140+
# Where scope can be one of [required, optional, incompatible, embedded],
141+
# type can be one of [project, version],
142+
# and the name is the Modrinth project or version slug/id of the other mod.
143+
# Example: required-project:jei;optional-project:top;incompatible-project:gregtech
144+
modrinthRelations = req:mixinbooter
145+
146+
147+
# Publishing to CurseForge requires you to set the CURSEFORGE_API_KEY environment variable to one of your CurseForge API tokens.
148+
149+
# The project's numeric ID on CurseForge. You can find this in the About Project box.
150+
# Leave this empty if you don't want to publish on CurseForge.
151+
# Alternatively this can be set with the 'CURSEFORGE_PROJECT_ID' environment variable.
152+
curseForgeProjectId = 687577
153+
154+
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
155+
# Syntax: type1:name1;type2:name2;...
156+
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
157+
# and the name is the CurseForge project slug of the other mod.
158+
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
159+
curseForgeRelations = req:mixin-booter;\
160+
opt:actually-additions;\
161+
opt:additional-enchanted-miner;\
162+
opt:advanced-mortars;\
163+
opt:advanced-rocketry;\
164+
opt:advanced-rocketry-2;\
165+
opt:aether;\
166+
opt:alchemistry;\
167+
opt:angry-pixel-the-betweenlands-mod;\
168+
opt:applied-energistics-2;\
169+
opt:arcane-archives;\
170+
opt:arcane-world;\
171+
opt:astral-sorcery;\
172+
opt:atum;\
173+
opt:avaritia-1-10;\
174+
opt:better-with-addons;\
175+
opt:bewitchment;\
176+
opt:blood-arsenal;\
177+
opt:blood-magic;\
178+
opt:botania;\
179+
opt:botania-tweaks;\
180+
opt:botanic-additions;\
181+
opt:bwm-suite;\
182+
opt:bwm-core;\
183+
opt:calculator;\
184+
opt:chisel;\
185+
opt:compact-machines;\
186+
opt:constructs-armory;\
187+
opt:cyclic;\
188+
opt:draconic-evolution;\
189+
opt:ender-io;\
190+
opt:essentialcraft-4-unofficial;\
191+
opt:evilcraft;\
192+
opt:extended-crafting;\
193+
opt:extrabotany;\
194+
opt:extra-utilities;\
195+
opt:forestry;\
196+
opt:future-mc;\
197+
opt:had-enough-items;\
198+
opt:horse-power;\
199+
opt:ic2-classic;\
200+
opt:ice-and-fire-dragons;\
201+
opt:immersive-engineering;\
202+
opt:immersive-petroleum;\
203+
opt:industrial-craft;\
204+
opt:industrial-foregoing;\
205+
opt:inspirations;\
206+
opt:integrated-dynamics;\
207+
opt:lazy-ae2;\
208+
opt:magneticraft;\
209+
opt:mct-immersive-technology;\
210+
opt:mekanism;\
211+
opt:mystical-agriculture;\
212+
opt:natures-aura;\
213+
opt:pneumaticcraft-repressurized;\
214+
opt:primal-tech;\
215+
opt:prodigy-tech;\
216+
opt:projecte;\
217+
opt:pyrotech;\
218+
opt:random-things;\
219+
opt:rustic;\
220+
opt:roots;\
221+
opt:silents-gems;\
222+
opt:techreborn;\
223+
opt:thaumcraft;\
224+
opt:the-aurorian;\
225+
opt:thermal-expansion;\
226+
opt:tinkers-construct;\
227+
opt:tinkers-complement;\
228+
opt:woot;
229+
230+
# This project's release type on CurseForge and/or Modrinth
231+
# Alternatively this can be set with the 'RELEASE_TYPE' environment variable.
232+
# Allowed types: release, beta, alpha
233+
releaseType =
234+
235+
# Generate a default changelog for releases. Requires git to be installed, as it uses it to generate a changelog of
236+
# commits since the last tagged release.
237+
generateDefaultChangelog = false
238+
239+
# Prevent the source code from being published
240+
noPublishedSources = false
241+
242+
243+
# Publish to a custom maven location. Follows a few rules:
244+
# Group ID can be set with the 'ARTIFACT_GROUP_ID' environment variable, default to 'project.group'
245+
# Artifact ID can be set with the 'ARTIFACT_ID' environment variable, default to 'project.name'
246+
# Version can be set with the 'RELEASE_VERSION' environment variable, default to 'modVersion'
247+
# For maven credentials:
248+
# Username is set with the 'MAVEN_USER' environment variable, default to "NONE"
249+
# Password is set with the 'MAVEN_PASSWORD' environment variable, default to "NONE"
250+
customMavenPublishUrl = https://repo.cleanroommc.com/releases
251+
252+
# The group for maven artifacts. Defaults to the 'project.modGroup' until the last '.' (if any).
253+
# So 'mymod' becomes 'mymod' and 'com.myname.mymodid' 'becomes com.myname'
254+
mavenArtifactGroup = com.cleanroommc
255+
256+
# Enable spotless checks
257+
# Enforces code formatting on your source code
258+
# By default this will use the files found here: https://github.com/GregTechCEu/Buildscripts/tree/master/spotless
259+
# to format your code. However, you can create your own version of these files and place them in your project's
260+
# root directory to apply your own formatting options instead.
261+
enableSpotless = true
262+
263+
# Enable JUnit testing platform used for testing your code.
264+
# Uses JUnit 5. See guide and documentation here: https://junit.org/junit5/docs/current/user-guide/
265+
enableJUnit = true
266+
267+
# Deployment debug setting
268+
# Uncomment this to test deployments to CurseForge and Modrinth
269+
# Alternatively, you can set the 'DEPLOYMENT_DEBUG' environment variable.
270+
deploymentDebug = false

0 commit comments

Comments
 (0)