-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Fix up-to-date checks for precommit related tasks #57203
Fix up-to-date checks for precommit related tasks #57203
Conversation
breskeby
commented
May 27, 2020
- Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check
- Use marker output folder for dependencies license task to make task incremental build compliant
Pinging @elastic/es-core-infra (:Core/Infra/Build) |
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 changes LGTM.
I was wondering whether it's worth defining a wrapper of some kind, so that we don't have to keep repeating the "Explicitly using an Action interface" comments. Something like:
jarTask.doFirst(TaskWrapper.of(task -> { ... }))
where the implementation is something like:
public class TaskWrapper {
/**
* Explicitly use an Action interface as Java lambdas
* are not supported by Gradle up-to-date checks
*/
public static Action<Task> of(Consumer<Task> fn) {
return new Action<Task>() {
@Override
public void execute(Task task) {
fn.call(task);
}
}
}
}
@pugnascotia Neat idea, but I checked and this wrapper could potentially break the up-to-date check when the implementation of the lambda changes. The problem is that a change in the implementationof a lambda cannot be tracked properly by gradle |
- Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check - Use marker output folder for dependencies license task to make task incremental build compliant
0497c8b
to
c4c2548
Compare
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.
Changes LGTM 👍
@breskeby Ah, that's shame. Never mind then. 👍 |
* Fix up-to-date checks for precommit related tasks - Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check - Use marker output folder for dependencies license task to make task incremental build compliant * Tweak formatting
* Fix up-to-date checks for precommit related tasks - Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check - Use marker output folder for dependencies license task to make task incremental build compliant * Tweak formatting
* Fix up-to-date checks for precommit related tasks - Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check - Use marker output folder for dependencies license task to make task incremental build compliant * Tweak formatting
* Fix up-to-date checks for precommit related tasks - Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check - Use marker output folder for dependencies license task to make task incremental build compliant * Tweak formatting
* Fix up-to-date checks for precommit related tasks - Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check - Use marker output folder for dependencies license task to make task incremental build compliant * Tweak formatting
* Fix up-to-date checks for precommit related tasks - Do not use lambdas for doFirst / doLast action declarations as this is not supported by gradle up-to-date check - Use marker output folder for dependencies license task to make task incremental build compliant * Tweak formatting