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

feat(gradle-plugin): enable lazy evaluation, implicit task dependencies and fixing setEncoding #4761

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nbrugger-tgm
Copy link

@nbrugger-tgm nbrugger-tgm commented Oct 17, 2024

Why

  • lazy configuration: The lack cause pain when working in a remotely up to date gradle enviroment and
  • fixed immutable task dependencies: this is a blocker since you have no modify theese task dependencies (resolve depending compileTestJava for example)
  • setting the encoding didn't work at all

Changes

  • fix encoding setter
  • enable lazy evaluation by
    • replacing all Task configurations with gradles Property types
    • using register instead of create to register the task
  • remove wrongly set task dependencies that can cause circular dependencies. Task dependencies are now inferred by the set classpath. When gradle detects that an output of a task (like compileJava) is used an automatic dependency is formed and resolve will always execute compileJava first. The advantage is that this is dynamic. If one does NOT want compileJava to be executed it won't be as soon as nothing of compileJava is on the configured classpath

Fixes: #4366 #4367

@nbrugger-tgm nbrugger-tgm changed the title feat(gradle-plugin): enable lazy evaluation, implicit task dependencies feat(gradle-plugin): enable lazy evaluation, implicit task dependencies and fixing setEncoding Oct 17, 2024
@nbrugger-tgm nbrugger-tgm force-pushed the gradle/enable-lazy-configuration branch 2 times, most recently from 57c56d2 to b7d4a37 Compare October 18, 2024 07:53
@nbrugger-tgm
Copy link
Author

Sorry for the force pushes, i had to fix the commit it had the wrong commiter was not signed and i messed up the commit message

@nbrugger-tgm nbrugger-tgm force-pushed the gradle/enable-lazy-configuration branch from 1427fbb to 22301bb Compare October 28, 2024 15:51
changes:
  - enable lazy evaluation by
    - replacing all Task configurations with gradles Property types
    - using `register` instead of `create` to register the task
  - remove wrongly set task dependencies that can cause circular dependencies. Task dependencies are now inferred by the set classpath. When gradle detects that an output of a task (like compileJava) is used an automatic dependency is formed and `resolve` will always execute compileJava first. The advantage is that this is dynamic. If one does NOT want `compileJava` to be executed it won't be as soon as nothing of compileJava is on the configured classpath
@ponelat
Copy link
Member

ponelat commented Nov 1, 2024

Thanks @nbrugger-tgm , we'll try to take a look as soon as we can, we appreciate the code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants