GitVersioner.groovy: Add debug information at build stage

This commit is contained in:
s1lent 2020-02-22 15:28:04 +07:00
parent 8c82c6236e
commit 41d75f9f2c
2 changed files with 22 additions and 1 deletions

View File

@ -32,6 +32,11 @@ if (gitInfo && gitInfo.tag && gitInfo.tag[0] == 'v') {
commitURL: gitInfo.commitURL commitURL: gitInfo.commitURL
) )
} else { } else {
if (!gitInfo) {
System.err.println "WARNING! couldn't get gitInfo";
}
versionInfo = new RegamedllVersionInfo( versionInfo = new RegamedllVersionInfo(
majorVersion: project.majorVersion as int, majorVersion: project.majorVersion as int,
minorVersion: project.minorVersion as int, minorVersion: project.minorVersion as int,

View File

@ -60,7 +60,23 @@ class GitVersioner {
static boolean getUncommittedChanges(Repository repo) { static boolean getUncommittedChanges(Repository repo) {
Git git = new Git(repo); Git git = new Git(repo);
Status status = git.status().setIgnoreSubmodules(SubmoduleWalk.IgnoreSubmoduleMode.ALL).call(); Status status = git.status().setIgnoreSubmodules(SubmoduleWalk.IgnoreSubmoduleMode.ALL).call();
if (!status.getUncommittedChanges().isEmpty()) { Set<String> 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; return true;
} }