From 6417e0f975aa8228ddc4fcf76413e0230e1d2955 Mon Sep 17 00:00:00 2001 From: Matteo Hausner Date: Sun, 12 Jan 2025 20:14:19 +0100 Subject: [PATCH] Revert "build.gradle: correctly determine git directory in case the repo is used as a submodule" This reverts commit 4a8a9a18117fb989696608132bd06f2ebcb478d7. --- build.gradle | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index f46e26d4..163d5166 100644 --- a/build.gradle +++ b/build.gradle @@ -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 {