-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print version and revision before each command #757
Conversation
3569cc9
to
337648c
Compare
Codecov Report
@@ Coverage Diff @@
## master #757 +/- ##
============================================
- Coverage 78.22% 78.13% -0.10%
Complexity 665 665
============================================
Files 125 125
Lines 2774 2776 +2
Branches 399 399
============================================
- Hits 2170 2169 -1
- Misses 350 351 +1
- Partials 254 256 +2 |
test_runner/build.gradle.kts
Outdated
shouldRunAfter(tasks.processResources) | ||
doLast { | ||
File("${project.buildDir}/resources/main/version.txt").writeText("local_snapshot") | ||
File("${project.buildDir}/resources/main/revision.txt").writeText( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bitrise job does this:
echo "$BITRISE_GIT_TAG" > ./test_runner/src/main/resources/version.txt
echo "$GIT_CLONE_COMMIT_HASH" > ./test_runner/src/main/resources/revision.txt
and then the gradle commands are run. I think this may break the bitrise release job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for info. So I will use BITRISE_IO
env for turning off this task when running on bitrise.
test_runner/build.gradle.kts
Outdated
if (!runningOnBitrise) doLast { | ||
File("${project.buildDir}/resources/main/version.txt").writeText("local_snapshot") | ||
File("${project.buildDir}/resources/main/revision.txt").writeText( | ||
String(Runtime.getRuntime().exec("git rev-parse HEAD").inputStream.readBytes()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we exec on a background thread? here's an example:
https://github.com/bootstraponline/gradle_enterprise_example/blob/master/app/enterprise.gradle.kts#L152
also probably better to use exec { ... }
instead of Runtime directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running on background from your example requires GradleEnterprisePlugin, TBH I have no experience with build scan. Any way, adding GradleEnterprisePlugin looks like standalone tasks, not a part of another. Also Updating those two files is pretty fast so it don't much impact on build time.
Ok, I will use exec { ... }
.
247446c
Fixes #740
Checklist