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

Add build cache for formatter/impsort/enforcer #38399

Closed
wants to merge 5 commits into from

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Jan 25, 2024

This should be merged after #38396

Created as draft as I have a few questions for the Gradle team.

Comment on lines +907 to +914
<fileSets>
<fileSet>
<name>foo</name>
<paths>
<path>${project.basedir}/pom.xml</path>
</paths>
<normalization>RELATIVE_PATH</normalization>
</fileSet>
Copy link
Member Author

@gsmet gsmet Jan 25, 2024

Choose a reason for hiding this comment

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

@jprinet I used your proposal except I restricted it to the pom file as really that's what all our enforcer rules are checking.

That being said, I have two questions:

  • are the plugin dependencies taken into account in the cache key? We have rules that are inside a jar declared as a dependency. If the jar changes, will the cache be invalidated?
  • some of our rules are inspecting the transitive dependencies so I would need to somehow include the classpath into the cache key. Is there a way to do that when the plugin doesn't expose it?

I saw the following for the kotlin-maven-plugin but these are properties from the plugin:

<fileSet>
    <name>classpath</name>
    <normalization>COMPILE_CLASSPATH</normalization>
</fileSet>
<fileSet>
    <name>testClasspath</name>
    <normalization>COMPILE_CLASSPATH</normalization>
</fileSet>

Is there a way to include the classpath jars into the cache key?

Copy link
Contributor

Choose a reason for hiding this comment

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

are the plugin dependencies taken into account in the cache key? We have rules that are inside a jar declared as a dependency. If the jar changes, will the cache be invalidated?

There is no default input, the plugin has to define it which is not the case apparently for the enforcer plugin

some of our rules are inspecting the transitive dependencies so I would need to somehow include the classpath into the cache key. Is there a way to do that when the plugin doesn't expose it?

The only way would be with the programmatic approach, nothing you can do with the XML configuration afaik.
We are doing that for the Quarkus build caching extension.

@gsmet
Copy link
Member Author

gsmet commented Jan 26, 2024

Replaced by #38416 as the enforcer will need to be handled in a Maven extension.

@gsmet gsmet closed this Jan 26, 2024
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants