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

Enabled Caching for LombokConfig Task #525

Closed
wants to merge 3 commits into from
Closed

Enabled Caching for LombokConfig Task #525

wants to merge 3 commits into from

Conversation

CaunCaran
Copy link

The current annotations in LombokConfig are incorrect according to the javadoc, this Pullrequest is an attempt to fix it.

As stated in the Gradle javadoc https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/InputFiles.html @InputFiles @input and @OutputFile have to be applied on getters instead of fields for them to be processed.

Enabling the caching reduced the build time in our project to a quarter as it also effects the caching of dependent tasks.

@codecov
Copy link

codecov bot commented May 24, 2022

Codecov Report

Merging #525 (3aa1842) into master (11da498) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #525      +/-   ##
============================================
+ Coverage     30.54%   30.59%   +0.04%     
- Complexity      194      198       +4     
============================================
  Files           104      104              
  Lines          2668     2667       -1     
  Branches        234      234              
============================================
+ Hits            815      816       +1     
+ Misses         1786     1780       -6     
- Partials         67       71       +4     
Impacted Files Coverage Δ
...fair/gradle/plugins/lombok/tasks/LombokConfig.java 65.00% <100.00%> (-0.58%) ⬇️
.../freefair/gradle/plugins/git/GitVersionPlugin.java 21.33% <0.00%> (+2.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11da498...3aa1842. Read the comment docs.

@larsgrefer
Copy link
Member

Annotating the java fields is sufficient, as long as there is a corresponding getter (which is generated by lombok in my case): gradle/gradle#7688

The conceptual problem with the cacheability of the task is this:
The "actual" inputs for the task are all the lombok.config files which are taken into account while determining the effective configuration. Unfortunately we don't know which config files will be used as the configuration system is quite complex: https://projectlombok.org/features/configuration Lombok will recursively traverse the file system and even allows importing other files.

@CaunCaran
Copy link
Author

Thank you for your quick response.

We have noticed, that we can skip the lombok config generation all together since we don't have any specific configuration.
Therefore i will close this merge request as we no longer require any caching of the LombokConfig task.

@flocsy
Copy link

flocsy commented Jun 14, 2022

How did you "skip the lombok config generation"? I have similar problem: builds are very slow, even when I already had a full build and did not change anything in the java code the generateEffectiveLombokConfig tasks run on the next build. We don't even have any lombok.config file in our project.

@CaunCaran
Copy link
Author

The easiest way is to set the System Property in your build.gradle: System.setProperty("lombok.disableConfig", "true")

But maybe there should be a configuration option to ignore external files and rely on clean build in case of external file changes.

larsgrefer added a commit that referenced this pull request Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants