-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Set Java 9 checkstyle to depend on checkstyle conf #28383
Conversation
We need to configure the Java 9 checkstyle task to depend on the checkstyle configuration task or the task could run before the checkstyle conf has been copied leading to runtime failures. We have to do this after projects have been evaluated because the configuration of these tasks can occur before the Java 9 source set has been added to a project.
task.inputs.file(checkstyleSuppressions) | ||
task.reports { | ||
html.enabled false | ||
project.afterEvaluate { |
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.
I don't think we need an afterEvaluate. Instead, I think we can use:
project.tasks.withType(Checkstyle) {
dependsOn(copyCheckstyleConf)
}
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.
I might be misunderstanding but I do not think that works; the problem here, and the reason for the afterEvaluate
is that the checkstyleJava9 task is not defined when we create the precommit tasks. The source set for Java 9 is added later. This is why I do this in an afterEvaluate
, to ensure that the Java 9 source set is added before the checkstyle tasks are configured.
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.
Many of the methods that gradle has on collections, like withType
, operate not only on the current objects in that collection, but also on future objects added. So the closure applied to withType here will also be applied to the java9 checkstyle when it is later added.
Pinging @elastic/es-core-infra |
* master: (476 commits) Fix compilation errors in ML integration tests Small code cleanups and refactorings in persistent tasks (elastic#29109) Update allocation awareness docs (elastic#29116) Configure error file for archive packages (elastic#29129) Configure heap dump path for archive packages (elastic#29130) Client: Add missing test getMinGenerationForSeqNo should acquire read lock (elastic#29126) Backport - Do not renew sync-id PR to 5.6 and 6.3 Client: Wrap SSLHandshakeException in sync calls Fix creating keystore when upgrading (elastic#29121) Align thread pool info to thread pool configuration (elastic#29123) TEST: Adjust translog size assumption in new engine Docs: HighLevelRestClient#multiGet (elastic#29095) Client: Wrap synchronous exceptions (elastic#28919) REST: Clear Indices Cache API simplify param parsing (elastic#29111) Fix typo in ExceptionSerializationTests Remove BWC layer for rejected execution exception Fix EsAbortPolicy to conform to API (elastic#29075) [DOCS] Removed prerelease footnote from upgrade table. Docs: Support triple quotes (elastic#28915) ...
@rjernst I have updated this pull request; would you please take another look? |
We need to configure the Java 9 checkstyle task to depend on the checkstyle configuration task or the task could run before the checkstyle conf has been copied leading to runtime failures. We have to do this after projects have been evaluated because the configuration of these tasks can occur before the Java 9 source set has been added to a project.
We need to configure the Java 9 checkstyle task to depend on the checkstyle configuration task or the task could run before the checkstyle conf has been copied leading to runtime failures. We have to do this after projects have been evaluated because the configuration of these tasks can occur before the Java 9 source set has been added to a project.
* es/master: (50 commits) Reject updates to the `_default_` mapping. (#29165) Improve similarity docs. (#29089) [Docs] Update api.asciidoc (#29166) Docs: Add note about missing mapping for doc values field (#29036) Fix BWC issue for PreSyncedFlushResponse Remove BytesArray and BytesReference usage from XContentFactory (#29151) Add pluggable XContentBuilder writers and human readable writers (#29120) Add unreleased version 6.2.4 (#29171) Add unreleased version 6.1.5 (#29168) Add a note about using the `retry_failed` flag before accepting data loss (#29160) Fix typo in percolate-query.asciidoc (#29155) Require HTTP::Tiny 0.070 for release notes script Set Java 9 checkstyle to depend on checkstyle conf (#28383) REST high-level client: add clear cache API (#28866) Docs: Add example of resetting index setting (#29048) Plugins: Fix module name conflict check for meta plugins (#29146) Build: Fix meta plugin bundled plugin names (#29147) Build: Simplify rest spec hack configuration (#29149) Build: Fix meta modules to not install as plugin in tests (#29150) Fix javadoc warning in Strings for missing parameter description ...
* es/6.x: (46 commits) Docs: Add note about missing mapping for doc values field (#29036) [DOCS] Removed 6.1.4, 6.2.2, and 6.2.3 coming tags Remove BytesArray and BytesReference usage from XContentFactory (#29151) Fix BWC issue for PreSyncedFlushResponse Add pluggable XContentBuilder writers and human readable writers (#29120) Add unreleased version 6.2.4 (#29171) Add unreleased version 6.1.5 (#29168) Add a note about using the `retry_failed` flag before accepting data loss (#29160) Fix typo in percolate-query.asciidoc (#29155) Add release notes for 6.1.4 and 6.2.3 Require HTTP::Tiny 0.070 for release notes script REST high-level client: add clear cache API (#28866) Relax remote check for bwc project checkouts (#28666) Set Java 9 checkstyle to depend on checkstyle conf (#28383) Docs: Add example of resetting index setting (#29048) Plugins: Fix module name conflict check for meta plugins (#29146) Build: Fix meta plugin bundled plugin names (#29147) Build: Simplify rest spec hack configuration (#29149) CLI: Close subcommands in MultiCommand (#28954) Build: Fix meta modules to not install as plugin in tests (#29150) ...
We need to configure the Java 9 checkstyle task to depend on the checkstyle configuration task or the task could run before the checkstyle conf has been copied leading to runtime failures. We have to do this after projects have been evaluated because the configuration of these tasks can occur before the Java 9 source set has been added to a project.
Closes #28376