From 41d75f9f2c4304a0b6697c1790364b3bccaeec44 Mon Sep 17 00:00:00 2001 From: s1lent Date: Sat, 22 Feb 2020 15:28:04 +0700 Subject: [PATCH] GitVersioner.groovy: Add debug information at build stage --- build.gradle | 5 +++++ .../main/groovy/versioning/GitVersioner.groovy | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8d24ebcd..0fe36724 100644 --- a/build.gradle +++ b/build.gradle @@ -32,6 +32,11 @@ if (gitInfo && gitInfo.tag && gitInfo.tag[0] == 'v') { commitURL: gitInfo.commitURL ) } else { + + if (!gitInfo) { + System.err.println "WARNING! couldn't get gitInfo"; + } + versionInfo = new RegamedllVersionInfo( majorVersion: project.majorVersion as int, minorVersion: project.minorVersion as int, diff --git a/buildSrc/src/main/groovy/versioning/GitVersioner.groovy b/buildSrc/src/main/groovy/versioning/GitVersioner.groovy index 3d7f237e..e60f9146 100644 --- a/buildSrc/src/main/groovy/versioning/GitVersioner.groovy +++ b/buildSrc/src/main/groovy/versioning/GitVersioner.groovy @@ -60,7 +60,23 @@ class GitVersioner { static boolean getUncommittedChanges(Repository repo) { Git git = new Git(repo); Status status = git.status().setIgnoreSubmodules(SubmoduleWalk.IgnoreSubmoduleMode.ALL).call(); - if (!status.getUncommittedChanges().isEmpty()) { + Set uncommittedChanges = status.getUncommittedChanges(); + System.err.println ' UncommittedChanges: ' + uncommittedChanges + + if (!uncommittedChanges.isEmpty()) { + System.err.println 'getUncommittedChanges details' + System.err.println ' Added: ' + status.getAdded() + System.err.println ' Changed: ' + status.getChanged() + System.err.println ' Removed: ' + status.getRemoved() + System.err.println ' Missing: ' + status.getMissing() + System.err.println ' Modified: ' + status.getModified() + System.err.println ' Conflicting: ' + status.getConflicting() + + System.err.println ' ConflictingStageState: ' + status.getConflictingStageState() + System.err.println ' IgnoredNotInIndex: ' + status.getIgnoredNotInIndex() + System.err.println ' Untracked: ' + status.getUntracked() + System.err.println ' UntrackedFolders: ' + status.getUntrackedFolders() + return true; }