1- buildscript {
2- repositories {
3- maven { url = ' https://maven.minecraftforge.net' }
4- maven { url = ' https://maven.parchmentmc.org' }
5- maven { url = ' https://repo.spongepowered.org/repository/maven-public' }
6- mavenCentral()
7- mavenLocal()
8- }
9-
1+ buildscript {
102 dependencies {
11- classpath " net.minecraftforge.gradle:ForgeGradle:5.1.+"
123 classpath ' org.parchmentmc:librarian:1.+'
134 }
145}
@@ -17,26 +8,27 @@ plugins {
178 id " idea"
189 id " eclipse"
1910 id " maven-publish"
11+ id ' net.minecraftforge.gradle' version ' [6.0,6.2)'
12+ id ' org.parchmentmc.librarian.forgegradle' version ' 1.+'
2013}
2114
22- apply plugin : " net.minecraftforge.gradle"
23- apply plugin : ' org.parchmentmc.librarian.forgegradle'
24-
2515var envVersion = System . getenv(" VERSION" ) ?: " 9.9.9"
2616if (envVersion. startsWith(" v" ))
2717 envVersion = envVersion. trimStart(' v' )
2818
19+ var RUNNING_IN_CI = true // System.getenv().containsKey("CI") ?: false
20+
2921archivesBaseName = mod_id
3022group = " dev.compactmods.compactmachines"
3123version = envVersion
3224
33- tasks. create (" mcVersion" ) {
25+ tasks. register (" mcVersion" ) {
3426 doFirst {
3527 println (" version=$minecraft_version " )
3628 }
3729}
3830
39- tasks. create (" forgeVersion" ) {
31+ tasks. register (" forgeVersion" ) {
4032 doFirst {
4133 println (" version=$forge_version " )
4234 }
@@ -88,7 +80,6 @@ sourceSets {
8880 }
8981}
9082
91- println (' Java: ' + System . getProperty(' java.version' ) + ' JVM: ' + System . getProperty(' java.vm.version' ) + ' (' + System . getProperty(' java.vendor' ) + ' ) Arch: ' + System . getProperty(' os.arch' ))
9283minecraft {
9384 mappings channel : ' parchment' , version : parchment_version
9485 // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
@@ -98,8 +89,8 @@ minecraft {
9889 // Default run configurations.
9990 // These can be tweaked, removed, or duplicated as needed.
10091 runs {
101- client {
102- workingDirectory project. file(' run/client ' )
92+ data {
93+ workingDirectory project. file(' run' )
10394
10495 // Recommended logging data for a userdev environment
10596 property ' forge.logging.markers' , ' ' // 'SCAN,REGISTRIES,REGISTRYDUMP'
@@ -110,35 +101,41 @@ minecraft {
110101 property ' mixin.env.remapRefMap' , ' true'
111102 property ' mixin.env.refMapRemappingFile' , " ${ buildDir} /createSrgToMcp/output.srg"
112103
104+ args ' --mod' , mod_id
105+ args ' --existing' , file(' src/main/resources' )
106+ args ' --all'
107+ args ' --output' , file(' src/generated/resources/' )
108+
113109 if (! System . getenv(). containsKey(" CI" )) {
114110 // JetBrains Runtime Hotswap
115111 jvmArg ' -XX:+AllowEnhancedClassRedefinition'
116112 jvmArg ' -XX:HotswapAgent=fatjar'
117113 }
118114
119- args ' --username' , ' Nano'
120- args ' --width' , 1920
121- args ' --height' , 1080
122-
123115 mods {
124116 compactmachines {
125117 source sourceSets. tunnels
126118 source sourceSets. main
127119 source sourceSets. api
120+ source sourceSets. datagen
128121 }
129122 }
130123 }
131124
132- server {
133- workingDirectory project. file(' run/server ' )
125+ gameTestServer {
126+ workingDirectory project. file(' run/gametest ' )
134127
135128 // Recommended logging data for a userdev environment
136- property ' forge.logging.markers' , ' ' // 'SCAN,REGISTRIES,REGISTRYDUMP'
129+ // The markers can be added/remove as needed separated by commas.
130+ // "SCAN": For mods scan.
131+ // "REGISTRIES": For firing of registry events.
132+ // "REGISTRYDUMP": For getting the contents of all registries.
133+ property ' forge.logging.markers' , ' '
137134
138135 // Recommended logging level for the console
139- property ' forge.logging.console.level ' , ' debug '
140-
141- property ' forge.enabledGameTestNamespaces ' , mod_id
136+ // You can set various levels here.
137+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
138+ property ' forge.logging.console.level ' , ' info '
142139
143140 property ' mixin.env.remapRefMap' , ' true'
144141 property ' mixin.env.refMapRemappingFile' , " ${ buildDir} /createSrgToMcp/output.srg"
@@ -148,19 +145,23 @@ minecraft {
148145 jvmArg ' -XX:+AllowEnhancedClassRedefinition'
149146 jvmArg ' -XX:HotswapAgent=fatjar'
150147 }
151-
148+
152149 mods {
153150 compactmachines {
154151 source sourceSets. tunnels
155- source sourceSets. main
156152 source sourceSets. api
153+ source sourceSets. main
157154 source sourceSets. test
158155 }
159156 }
160157 }
158+ }
159+ }
161160
162- data {
163- workingDirectory project. file(' run' )
161+ if (! RUNNING_IN_CI ) {
162+ minecraft. runs {
163+ client {
164+ workingDirectory project. file(' run/client' )
164165
165166 // Recommended logging data for a userdev environment
166167 property ' forge.logging.markers' , ' ' // 'SCAN,REGISTRIES,REGISTRYDUMP'
@@ -171,62 +172,50 @@ minecraft {
171172 property ' mixin.env.remapRefMap' , ' true'
172173 property ' mixin.env.refMapRemappingFile' , " ${ buildDir} /createSrgToMcp/output.srg"
173174
174- args ' --mod' , mod_id
175- args ' --existing' , file(' src/main/resources' )
176- args ' --all'
177- args ' --output' , file(' src/generated/resources/' )
178-
179- if (! System . getenv(). containsKey(" CI" )) {
175+ if (! RUNNING_IN_CI ) {
180176 // JetBrains Runtime Hotswap
181177 jvmArg ' -XX:+AllowEnhancedClassRedefinition'
182178 jvmArg ' -XX:HotswapAgent=fatjar'
183- } else {
184- forceExit false
185179 }
186180
187- forceExit false
181+ args ' --username' , ' Nano'
182+ args ' --width' , 1920
183+ args ' --height' , 1080
188184
189185 mods {
190186 compactmachines {
191187 source sourceSets. tunnels
192188 source sourceSets. main
193189 source sourceSets. api
194- source sourceSets. datagen
195190 }
196191 }
197192 }
198193
199- gameTestServer {
200- workingDirectory project. file(' run/gametest ' )
194+ server {
195+ workingDirectory project. file(' run/server ' )
201196
202197 // Recommended logging data for a userdev environment
203- // The markers can be added/remove as needed separated by commas.
204- // "SCAN": For mods scan.
205- // "REGISTRIES": For firing of registry events.
206- // "REGISTRYDUMP": For getting the contents of all registries.
207- property ' forge.logging.markers' , ' '
198+ property ' forge.logging.markers' , ' ' // 'SCAN,REGISTRIES,REGISTRYDUMP'
208199
209200 // Recommended logging level for the console
210- // You can set various levels here.
211- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
212- property ' forge.logging.console.level ' , ' info '
201+ property ' forge.logging.console.level ' , ' debug '
202+
203+ property ' forge.enabledGameTestNamespaces ' , mod_id
213204
214205 property ' mixin.env.remapRefMap' , ' true'
215206 property ' mixin.env.refMapRemappingFile' , " ${ buildDir} /createSrgToMcp/output.srg"
216207
217- forceExit false
218-
219- if (! System . getenv(). containsKey(" CI" )) {
208+ if (! RUNNING_IN_CI ) {
220209 // JetBrains Runtime Hotswap
221210 jvmArg ' -XX:+AllowEnhancedClassRedefinition'
222211 jvmArg ' -XX:HotswapAgent=fatjar'
223212 }
224-
213+
225214 mods {
226215 compactmachines {
227216 source sourceSets. tunnels
228- source sourceSets. api
229217 source sourceSets. main
218+ source sourceSets. api
230219 source sourceSets. test
231220 }
232221 }
0 commit comments