-
Notifications
You must be signed in to change notification settings - Fork 78
Add packIncludedProjectScopes setting for filtering project dependency scopes #592
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 packIncludedProjectScopes setting for filtering project dependency scopes #592
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @zygiert1990, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new configuration option, includedDependencyMappings, to the PackPlugin. This enhancement allows users to specify which dependency mappings (e.g., "test->compile") should be considered when copying dependencies, providing greater flexibility beyond the default "compile->" mapping. This change addresses the need to include dependencies from child modules with specific configurations that were previously hardcoded.
Highlights
- New Configuration Setting: Introduced includedDependencyMappings in PackPlugin.scala to control which dependency configurations are included during packaging.
- Flexible Dependency Inclusion: Modified the core logic to use the new includedDependencyMappings setting, enabling the inclusion of dependencies with non-default mappings like "test->compile".
- Documentation Update: Updated README.md to explain the purpose and usage of the new includedDependencyMappings setting.
- Test Case Addition: Added a new test case in sbt-test to validate that dependencies with custom mappings are correctly included when includedDependencyMappings is configured.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a valuable feature by allowing customization of dependency mappings through the includedDependencyMappings setting. The implementation is well-done, including updates to documentation and tests. I've identified one medium-severity issue regarding the behavior when includedDependencyMappings is an empty sequence, which could lead to unexpected results. A code suggestion is provided to address this. Overall, this is a great enhancement to the plugin.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This reverts commit dd6d132.
- Follow pack* naming convention for consistency with other settings - Use "project scopes" instead of "dependency mappings" to avoid confusion with JAR dependency mapping - Update documentation with clearer description and example 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesThis PR adds a new setting ProblemPreviously, sbt-pack hardcoded filtering to only include Solution
Usage Example// Include both compile and test dependency scopes
packIncludedProjectScopes := Seq("compile->", "test->")Files Changed
|
|
@zygiert1990 Sorry for the long wait. I've just noticed a message from @tanishiking yesterday. I've fixed the setting name to be consistent with the other settings. I'll release a new version with this feature. |
Motivation:
With our project we are using PackPlugin and it works really well. However, we have some specific configuration so we are using dependencies from some child modules in scope "test->compile":
.dependsOn( common % "test->compile" )Currently allowed mapping is hardcoded here:
def isCompileConfig(cp: ClasspathDep[ProjectRef]) = cp.configuration.forall(_.contains("compile->"))In scope of this PR I just added possibility to override allowed mappings.