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

Provide functionality to automatically derive 'requires' directives from metadata #40

Closed
jjohannes opened this issue Jan 4, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@jjohannes
Copy link
Member

jjohannes commented Jan 4, 2023

Similar to exportAllPackages() (#38) we can introduce a requireAllDefinedDependencies() to automatically create requires directives based on what is defined in a component metadata (pom.xml / module.json). For this, the GA coordinates in the metadata need to be mapped to the corresponding module names. This knowledge is available for other patched Jars where the module name is introduced through this plugin. An additional knownModule(name, ga) statement should be added to the extension for adding the knowledge for existing modules when needed.

@jjohannes
Copy link
Member Author

This feature is now on main and can be used as follows:

module("org.apache.httpcomponents:httpclient", "org.apache.httpcomponents.httpclient") {
  requireAllDefinedDependencies()
}

@jjohannes
Copy link
Member Author

The current solution wouldn't work for any Jar that is not on the main compile/runtime classpath. Instead we should probably use the combined classpaths of all registered source sets, as for all of these the transform is triggered by default.

@jjohannes jjohannes reopened this Jan 4, 2023
jjohannes added a commit that referenced this issue Jan 5, 2023
This avoids moving a lot of data in memory when having large
classpaths. It also avoids potential performance regressions in
scenarios where 'requireAllDefinedDependencies' is not used at all.

#40
jjohannes added a commit that referenced this issue Jan 5, 2023
This avoids moving a lot of data in memory when having large
classpaths. It also avoids potential performance regressions in
scenarios where 'requireAllDefinedDependencies' is not used at all.

#40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant