2
0
Fork 0

Progress update (please work this time)

frozen
Shinare 2 years ago
parent 5ed6c449d0
commit 96a211be46

3
.gitignore vendored

@ -0,0 +1,3 @@
shortcut
assets
build

Binary file not shown.

@ -1 +0,0 @@
/home/shinare/Java/CinderLoE/src/main/resources/assets

@ -108,6 +108,7 @@ final String CHECKSTYLE_CONFIG = """
"""
checkPropertyExists("modName")
checkPropertyExists("modVersion")
checkPropertyExists("modId")
checkPropertyExists("modGroup")
checkPropertyExists("autoUpdateBuildScript")
@ -384,48 +385,9 @@ catch (Exception ignored) {
}
// Pulls version first from the VERSION env and then git tag
String identifiedVersion
String versionOverride = System.getenv("VERSION") ?: null
try {
// Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty
if (versionOverride == null) {
def gitDetails = versionDetails()
def isDirty = gitVersion().endsWith(".dirty") // No public API for this, isCleanTag has a different meaning
String branchName = gitDetails.branchName ?: (System.getenv('GIT_BRANCH') ?: 'git')
if (branchName.startsWith('origin/')) {
branchName = branchName.minus('origin/')
}
branchName = branchName.replaceAll("[^a-zA-Z0-9-]+", "-") // sanitize branch names for semver
identifiedVersion = gitDetails.lastTag ?: '${gitDetails.gitHash}'
if (gitDetails.commitDistance > 0) {
identifiedVersion += "-${branchName}.${gitDetails.commitDistance}+${gitDetails.gitHash}"
if (isDirty) {
identifiedVersion += "-dirty"
}
} else if (isDirty) {
identifiedVersion += "-${branchName}+${gitDetails.gitHash}-dirty"
}
} else {
identifiedVersion = versionOverride
}
}
catch (Exception ignored) {
out.style(Style.Failure).text(
'This mod must be version controlled by Git AND the repository must provide at least one tag,\n' +
'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' +
'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)'
)
versionOverride = '1.1'
identifiedVersion = versionOverride
}
String identifiedVersion = modVersion
String versionOverride = modVersion
version = identifiedVersion
ext {
modVersion = identifiedVersion
}
if (identifiedVersion == versionOverride) {
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
}
group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save