-
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
Changes from 2 commits
fb3aa15
337648c
a08278f
9ca57de
9b5c7f4
247446c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,3 +258,17 @@ tasks.assemble { | |
dependsOn(generateManpageAsciiDoc) | ||
} | ||
// end --- ASCII doc generation --- | ||
|
||
val updateVersion by tasks.registering { | ||
shouldRunAfter(tasks.processResources) | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. should we exec on a background thread? here's an example: also probably better to use There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
) | ||
} | ||
} | ||
|
||
tasks.classes { | ||
dependsOn(updateVersion) | ||
} |
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:
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.