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 option to provide additional custom packages #131

Closed
wants to merge 4 commits into from

Conversation

timonwd
Copy link
Contributor

@timonwd timonwd commented Feb 7, 2025

Overview

This PR proposes an additional capability to append custom packages/licenses added manually or through other sources to the package list provided by this package in addition to the packages automatically fetched using Swift Package Manager.

Implementation Details

  • The proposed feature leverages the existing structure of the JSON output type.
  • Users can specify a custom path to a file containing custom packages/licenses. This file will be appended to the automatically fetched packages.
  • A test for checking the parsing of the custom packages file has been added.

Benefits

  • Enhances flexibility: Users can include packages and licenses that are not fetched via SPM.
  • Maintains consistency: Integrates seamlessly with the existing JSON output format.

I would highly appreciate your feedback on this approach. If this feature does not align with your expectations, I'd be happy to implement adjustments.

@FelixHerrmann
Copy link
Owner

Hey @timonwd, thanks for your contribution.

I thought about introducing such functionality a few times. There is already flexibility on the code side with the PackageProvider protocol but for the static file generations (PDF and Settings.bundle) it needs to happen on the tooling side.

For v5 I had in mind introducing a config-file for the CLI tool (like the current one for the SPM plugin) and this would be the perfect place for a customPackages field; this is not fully elaborated at this point in time tho.

On the implementation side I'm mostly fine with this approach but I want to think a little bit about the above explained. Let me know if there is any urgency from your side getting such functionality in!

@timonwd
Copy link
Contributor Author

timonwd commented Feb 10, 2025

Hi @FelixHerrmann, thanks for the feedback! It's not too urgent on our end. Just some additional input on the config file: The approach with a dedicated file for the additional packages would be a little more convenient for us as we'd like to automate the process of translating license information from our internal systems into a format that can be displayed using this package.

@FelixHerrmann
Copy link
Owner

FelixHerrmann commented Feb 17, 2025

Hey @timonwd, I made some thoughts and I'm fine introducing that change now. I couldn't force-push to your fork's master and I had to recreate this PR.

I did the following adjustments:

  • [Fix] Non-URL Package location #132 introduced a change that affected this PR as well, this is streamlined now
  • the CLI option is slightly renamed to --custom-packages-file-path for consistency
  • the option can be applied multiple times now so you can have multiple files (e.g. one for Fonts and one for CocoaPods dependencies)
  • packages provided via the custom-packages file will now also be filtered by the --requires-license and --ignore-package options
  • the feature got carried over to the SPM plugin and is available there via the "customPackagesFilePaths" field

Please take a look at the PR and let me know what you think!

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.

2 participants