Skip to content
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

Merged
merged 4 commits into from
Mar 20, 2018

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Jan 26, 2018

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

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 {
Copy link
Member

@rjernst rjernst Jan 26, 2018

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)
}

Copy link
Member Author

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.

Copy link
Member

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.

@colings86 colings86 removed the >bug label Jan 31, 2018
@jasontedor jasontedor added v6.2.1 and removed v6.2.0 labels Feb 8, 2018
@hub-cap hub-cap added :Delivery/Build Build or test infrastructure and removed :Delivery/Build Build or test infrastructure labels Mar 12, 2018
@elasticmachine
Copy link
Collaborator

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)
  ...
@jasontedor
Copy link
Member Author

@rjernst I have updated this pull request; would you please take another look?

@jasontedor jasontedor merged commit d766b68 into elastic:master Mar 20, 2018
jasontedor added a commit that referenced this pull request Mar 20, 2018
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.
jasontedor added a commit that referenced this pull request Mar 20, 2018
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.
@jasontedor jasontedor deleted the java9-checkstyle branch March 20, 2018 13:09
martijnvg added a commit that referenced this pull request Mar 21, 2018
* 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
  ...
martijnvg added a commit that referenced this pull request Mar 21, 2018
* 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)
  ...
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v6.2.1 v6.3.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix task ordering for checkstyle Java 9
6 participants