Skip to content

Conversation

@carterkozak
Copy link
Contributor

==COMMIT_MSG==
Java compilation warnings and errors are no longer limited to the first 100
==COMMIT_MSG==

@changelog-app
Copy link

changelog-app bot commented Aug 19, 2021

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Java compilation warnings and errors are no longer limited to the first 100

Check the box to generate changelog(s)

  • Generate changelog entry

@carterkozak carterkozak requested review from CRogers and fawind August 19, 2021 19:09
@policy-bot policy-bot bot requested a review from ferozco August 19, 2021 19:09
project.getTasks().withType(JavaCompile.class).configureEach(javaCompileTask -> {
List<String> compilerArgs = javaCompileTask.getOptions().getCompilerArgs();
// Avoid overriding options that have already been set
if (!compilerArgs.contains(MAX_WARNINGS_ARG)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we want this to work if people override after applying the plugin too? If so, we'd probably want to put this in a project.afterEvaluate to run after people have had a chance to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it does, but only due to the fact later arguments take precedence over earlier instances. The afterEvaluate will be cleaner :-)
Note that the same potential duplication can occur if commandlineargumentproviders are used because I'm not checking those, we take advantage of knowing they're applied after the fixed args. I figured we don't want to evaluate providers unnecessarily as part of this check due to potential side-effects given the worst case result still has the desired behavior.

@bulldozer-bot bulldozer-bot bot merged commit b196aa9 into develop Aug 20, 2021
@bulldozer-bot bulldozer-bot bot deleted the ckozak/java_compiler_diagnostics branch August 20, 2021 10:44
@svc-autorelease
Copy link
Collaborator

Released 4.22.0

This was referenced Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants