GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Avoid eager creation of tasks for Spotless plugin by bigdaz · Pull Request #617 · diffplug/spotless

Conversation

@bigdaz

@bigdaz bigdaz commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

Previously applying the Spotless plugin resulted in a many tasks to be created
per subproject, even for an invocation like gradle help.
Using "Task configuration avoidance" APIs means that these tasks will
not be constructed if they will not be required during task execution.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bigdaz added 3 commits June 18, 2020 15:21
@bigdaz
Do not eagerly create format-specific spotless tasks
ef2aae4
Previously applying the Spotless plugin resulted in a many tasks to be created
per subproject, even for an invocation like `gradle help`.
Using "Task configuration avoidance" APIs means that these tasks will
not be constructed if they will not be required in the task graph.
@bigdaz
Do not eagerly create per-project spotless tasks
621af48
With this commit, running `./gradlew help -PspotlessModern=true` will no longer
the `spotless`, `spotlessCheck` or `spotlessApply` tasks if they are not
required for task execution. The only remaining task that is eagerly constructed
is "spotlessInternalRegisterDependencies".
@bigdaz
Update TODO items in code
78cfd65
@nedtwigg

nedtwigg commented Jun 18, 2020

Copy link
Copy Markdown
Member

This LGTM, merge at will! If you have code-in-progress for the Provider<> stuff, I'm eager to see it. Or if you'd like me to send up a PR for us to look at with the // TODO override configure(String name, Class<T> clazz, Action<T> configure) so that it is lazy idea, I'm happy to do that.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bigdaz

bigdaz commented Jun 18, 2020

Copy link
Copy Markdown
Contributor Author

Thanks Ned. In the end I didn't bother trying to get rid of the afterEvaluate and the migration to Task config avoidance APIs was pretty straightforward.

I'm not sure what you intend for making configure lazy, so I might leave that to you.

FYI I'm having an issue running spotlessApply on the master branch in my fork. I suspect it's got to do with the fact that it was renamed to main in the primary repo, but I'm not sure. Here's a build scan with the failure: https://scans.gradle.com/s/svlbtvyqgiwj2/failure. Once the PR is merged I'll see what I need to do to get it working, but I presume a NPE isn't the intended behaviour :).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bigdaz
bigdaz merged commit 1cc5f54 into diffplug:main Jun 18, 2020
@bigdaz
bigdaz deleted the lazy-task-creation branch June 18, 2020 23:02
@bigdaz

bigdaz commented Jun 18, 2020

Copy link
Copy Markdown
Contributor Author

I can confirm that by deleting and re-creating my fork on GitHub, the above issue is resolved.

nedtwigg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jun 18, 2020

Copy link
Copy Markdown
Member

Yup, def some transients in the master -> main transition :). I'll take a quick crack at the lazy idea I had, and I'll throw it up to get your feedback on its pros/cons vs Provider<> approaches.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Jun 19, 2020

Copy link
Copy Markdown
Member

Part of #601

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@bigdaz @nedtwigg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.