Skip to content

Commit a9fb145

Browse files
authored
Add more Run Config + Option to use old Jar Naming Format (#34)
1 parent 0029f02 commit a9fb145

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

build.gradle

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* DO NOT CHANGE THIS FILE!
44
* Also, you may replace this file at any time if there is an update available.
55
* Please check https://github.com/GregTechCEu/Buildscripts/blob/master/build.gradle for updates.
6+
* You can also run ./gradlew updateBuildScript to update your buildscript.
67
*/
78

89
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
@@ -53,6 +54,7 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly")
5354

5455
// Optional properties: we can assume some default behavior if these are missing
5556
propertyDefaultIfUnset("modVersion", "")
57+
propertyDefaultIfUnset("includeMCVersionJar", false)
5658
propertyDefaultIfUnset("autoUpdateBuildScript", false)
5759
propertyDefaultIfUnset("modArchivesBaseName", project.modId)
5860
propertyDefaultIfUnsetWithEnvVar("developmentEnvironmentUserName", "Developer", "DEV_USERNAME")
@@ -263,7 +265,13 @@ if (!modVersion) {
263265
}
264266
}
265267

266-
version = modVersion
268+
if (includeMCVersionJar.toBoolean()){
269+
version = "${minecraftVersion}-${modVersion}"
270+
}
271+
else {
272+
version = modVersion
273+
}
274+
267275
group = modGroup
268276
archivesBaseName = modArchivesBaseName
269277

@@ -672,22 +680,32 @@ idea {
672680
project {
673681
settings {
674682
runConfigurations {
675-
'1. Run Client'(Gradle) {
683+
'1. Setup Workspace'(Gradle) {
684+
taskNames = ['setupDecompWorkspace']
685+
}
686+
'2. Run Client'(Gradle) {
676687
taskNames = ['runClient']
677688
}
678-
'2. Run Server'(Gradle) {
689+
'3. Run Server'(Gradle) {
679690
taskNames = ['runServer']
680691
}
681-
'3. Run Obfuscated Client'(Gradle) {
692+
'4. Run Obfuscated Client'(Gradle) {
682693
taskNames = ['runObfClient']
683694
}
684-
'4. Run Obfuscated Server'(Gradle) {
695+
'5. Run Obfuscated Server'(Gradle) {
685696
taskNames = ['runObfServer']
686697
}
687698
if (enableSpotless.toBoolean()) {
688-
"5. Apply Spotless"(Gradle) {
699+
'6. Apply Spotless'(Gradle) {
689700
taskNames = ["spotlessApply"]
690701
}
702+
'7. Build Jars'(Gradle) {
703+
taskNames = ['build']
704+
}
705+
} else {
706+
'6. Build Jars'(Gradle) {
707+
taskNames = ['build']
708+
}
691709
}
692710
'Update Buildscript'(Gradle) {
693711
taskNames = ['updateBuildScript']

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ modGroup = com.myname.mymodid
99
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
1010
modVersion = 1.0.0
1111

12+
# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version)
13+
includeMCVersionJar = false
14+
1215
# The name of your jar when you produce builds, not including any versioning info
1316
modArchivesBaseName = mymodid
1417

0 commit comments

Comments
 (0)