-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f67fa88
commit 8c43332
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,36 @@ | ||
//version: 1707058017 | ||
|
||
plugins { | ||
id 'com.gtnewhorizons.gtnhconvention' | ||
id 'com.palantir.git-version' | ||
} | ||
|
||
// The planned name of the next release | ||
def NEXT_VERSION = ext.modVersion | ||
|
||
// Append to the version as needed. If the variables look a bit strange, that's because they are - | ||
// git-version doesn't expose a ton of useful functions, we need to extract them indirectly. | ||
|
||
// If we have a clean tag (or manually specified), this is a production release. | ||
// No need for the commit hash! | ||
def details = versionDetails() | ||
def isPlainTag = details.getCommitDistance() == 0 | ||
def noCommitHash = providers.gradleProperty("noCommitHash").isPresent() | ||
if (!isPlainTag && !noCommitHash) { | ||
NEXT_VERSION += "-nightly-" + details.gitHash | ||
} | ||
|
||
// If we have uncommitted changes, say so. | ||
def isDirty = gitVersion().endsWith(".dirty") | ||
if (isDirty && !noCommitHash) { | ||
NEXT_VERSION += "-dirty" | ||
} | ||
|
||
//Set the mod and jar version to the info we just collected. | ||
version = NEXT_VERSION | ||
|
||
minecraft { | ||
//Creates a tag in Tags with the above generated mod version, instead of the "clean" one | ||
injectedTags.put("RAW_VERSION", NEXT_VERSION) | ||
injectedTags.put("MOD_ID", project.modId) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters