Skip to content

Commit

Permalink
Revert "build.gradle: correctly determine git directory in case the r…
Browse files Browse the repository at this point in the history
…epo is used as a submodule"

This reverts commit 4a8a9a1.
  • Loading branch information
bwRavencl committed Jan 12, 2025
1 parent c4b41e9 commit 6417e0f
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,7 @@ plugins {
id 'org.gradlex.extra-java-module-info' version '1.9'
}

def dotGitFile = file "$projectDir/.git"
def gitDir
if (dotGitFile.isFile()) {
def gitDirConfigValue = dotGitFile.readLines().stream().mapMulti { line, downstream ->
def match = line =~ /^gitdir: (\S*)/
def value = match[0][1];
if (value) {
downstream.accept value
}
}.findFirst().orElseThrow({ new GradleException('gitdir not set') })
gitDir = "$projectDir/$gitDirConfigValue"
} else {
gitDir = projectDir
}

def git = Grgit.open dir: gitDir
def git = Grgit.open dir: projectDir
version = "${git.describe(longDescr: true).replaceFirst('-', '.').replaceFirst('-g', '-')}${((!git.status().isClean()) ? '.dirty' : '')}"

base {
Expand Down

0 comments on commit 6417e0f

Please sign in to comment.