Log actual checkout hash instead of generic refspec (#46637)

This commit is contained in:
Mark Vieira 2019-09-13 16:07:19 -07:00
parent 272b0ecbdd
commit 9774377959
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
1 changed files with 5 additions and 3 deletions

View File

@ -105,7 +105,7 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
dependsOn fetchLatest dependsOn fetchLatest
doLast { doLast {
String refspec = System.getProperty("bwc.refspec.${bwcBranch}") ?: System.getProperty("tests.bwc.refspec.${bwcBranch}") ?: "${remote}/${bwcBranch}" String refspec = System.getProperty("bwc.refspec.${bwcBranch}") ?: System.getProperty("tests.bwc.refspec.${bwcBranch}") ?: "${remote}/${bwcBranch}"
if (System.getProperty("bwc.checkout.align") != null || System.getProperty("tests.bwc.checkout.align") != null) { if (System.getProperty("bwc.checkout.align") != null) {
/* /*
We use a time based approach to make the bwc versions built deterministic and compatible with the current hash. We use a time based approach to make the bwc versions built deterministic and compatible with the current hash.
Most of the time we want to test against latest, but when running delayed exhaustive tests or wanting Most of the time we want to test against latest, but when running delayed exhaustive tests or wanting
@ -141,12 +141,14 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
} }
} }
logger.lifecycle("Checkout hash for ${project.path} is ${refspec}") logger.lifecycle("Performing checkout of ${refspec}...")
LoggedExec.exec(project) { spec -> LoggedExec.exec(project) { spec ->
spec.workingDir = checkoutDir spec.workingDir = checkoutDir
spec.commandLine "git", "checkout", refspec spec.commandLine "git", "checkout", refspec
} }
file("${project.buildDir}/refspec").text = GlobalBuildInfoPlugin.gitRevision(checkoutDir) String checkoutHash = GlobalBuildInfoPlugin.gitRevision(checkoutDir)
logger.lifecycle("Checkout hash for ${project.path} is ${checkoutHash}")
file("${project.buildDir}/refspec").text = checkoutHash
} }
} }