Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* DO NOT CHANGE THIS FILE!
* Also, you may replace this file at any time if there is an update available.
* Please check https://github.com/GregTechCEu/Buildscripts/blob/master/build.gradle for updates.
* You can also run ./gradlew updateBuildScript to update your buildscript.
*/

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

// Optional properties: we can assume some default behavior if these are missing
propertyDefaultIfUnset("modVersion", "")
propertyDefaultIfUnset("includeMCVersionJar", false)
propertyDefaultIfUnset("autoUpdateBuildScript", false)
propertyDefaultIfUnset("modArchivesBaseName", project.modId)
propertyDefaultIfUnsetWithEnvVar("developmentEnvironmentUserName", "Developer", "DEV_USERNAME")
Expand Down Expand Up @@ -263,7 +265,13 @@ if (!modVersion) {
}
}

version = modVersion
if (includeMCVersionJar.toBoolean()){
version = "${minecraftVersion}-${modVersion}"
}
else {
version = modVersion
}

group = modGroup
archivesBaseName = modArchivesBaseName

Expand Down Expand Up @@ -672,22 +680,32 @@ idea {
project {
settings {
runConfigurations {
'1. Run Client'(Gradle) {
'1. Setup Workspace'(Gradle) {
taskNames = ['setupDecompWorkspace']
}
'2. Run Client'(Gradle) {
taskNames = ['runClient']
}
'2. Run Server'(Gradle) {
'3. Run Server'(Gradle) {
taskNames = ['runServer']
}
'3. Run Obfuscated Client'(Gradle) {
'4. Run Obfuscated Client'(Gradle) {
taskNames = ['runObfClient']
}
'4. Run Obfuscated Server'(Gradle) {
'5. Run Obfuscated Server'(Gradle) {
taskNames = ['runObfServer']
}
if (enableSpotless.toBoolean()) {
"5. Apply Spotless"(Gradle) {
'6. Apply Spotless'(Gradle) {
taskNames = ["spotlessApply"]
}
'7. Build Jars'(Gradle) {
taskNames = ['build']
}
} else {
'6. Build Jars'(Gradle) {
taskNames = ['build']
}
}
'Update Buildscript'(Gradle) {
taskNames = ['updateBuildScript']
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ modGroup = com.myname.mymodid
# This field can be left empty if you want your mod's version to be determined by the latest git tag instead.
modVersion = 1.0.0

# Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version)
includeMCVersionJar = false

# The name of your jar when you produce builds, not including any versioning info
modArchivesBaseName = mymodid

Expand Down