Skip to content

Commit

Permalink
Merge pull request #160 from mbeddr/bugfix/main_vs_master_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderpann committed Sep 10, 2024
2 parents 896925d + e070f8a commit d6256d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions git-based-versioning/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.0

Initial version, extracted from `mps-gradle-plugin`.

# 1.1.0

Not only the 'master' prefix but also the 'main' prefix is now stripped when deriving the version identifier.
2 changes: 1 addition & 1 deletion git-based-versioning/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "de.itemis.mps.gradle"
version = "1.0"
version = "1.1.0"

dependencies {
implementation(gradleApi())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class GitBasedVersioning {
static String getVersion(String branch, String major, String minor, String bugfix = "", int count) {
def hash = getGitShortCommitHash()
def baseVersion = bugfix.isEmpty() ? "$major.$minor.$count.$hash" : "$major.$minor.$bugfix.$count.$hash"
if (branch == 'master' || branch == 'HEAD' /*this happens in detached head situations*/) {
if (branch == 'master' || branch == 'main' || branch == 'HEAD' /*this happens in detached head situations*/) {
return baseVersion
}

Expand Down

0 comments on commit d6256d2

Please sign in to comment.