Skip to content

Commit 6311bce

Browse files
authored
Try to read git hash from environment for dev build (#8483)
This may address #8476 but I have to push to main to try it out. The kokoro job prints out this variable `KOKORO_GITHUB_COMMIT`, but I'm not sure that is available in env for our script.
1 parent 52dc408 commit 6311bce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ if (project.hasProperty("release")) {
5858
val nextMajorVersion = majorVersion + 1
5959
val datestamp = DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDate.now())
6060
flutterPluginVersion = "$nextMajorVersion.0.0-dev.$datestamp"
61+
62+
val commitHash = System.getenv("KOKORO_GIT_COMMIT")
63+
if (commitHash is String) {
64+
val shortCommitHash = commitHash.take(7)
65+
flutterPluginVersion += "-$shortCommitHash"
66+
}
6167
}
6268

6369
val ideaVersion = providers.gradleProperty("ideaVersion").get()

0 commit comments

Comments
 (0)