yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
6.88k stars 809 forks source link

Generate acknowledgement in Settings bundle #1435

Open pafdad opened 6 months ago

pafdad commented 6 months ago

Hello and thank you for Xcodegen

Can Xcodegen help in generating the acknowledgements.plist for a Settings.bundle, like CocoaPods does?

Thank you in advance

markst commented 5 months ago

Personally seems a bit out of scope for Xcodegen. You might consider using a tool such as: https://github.com/mono0926/LicensePlist

pafdad commented 5 months ago

@markst thank you for your response

So a tool like that will have to have access to SPM's Package.swift file, which is a file managed by Xcodegen. When we use Xcodegen we don't actually manage the Package.swift file manually. Instead we are telling Xcodegen which dependencies we need. So it seems appropriate that the application that manages the actual dependencies (Xcodegen) generates also the acknowledgements for them.

This is true in case of Cocoapods as well. In that case Cocoapods is managing the dependencies, hence it's able to generate the acknowledgements for them too.

Regards

markst commented 5 months ago

The LicensePlist uses the project.xcworkspace/xcshareddata/swiftpm/Package.resolved in order to generate the output Acknowledgements. This file file will exist after a project generated by XcodeGen has resolved dependencies.

So in order to use LicensePlist you can update your project.yml to add a buildToolPlugins to execute the LicensePlistBuildTool. I'm happy to create a demonstration as an example if it's not clear.

markst commented 5 months ago

You might hit a blocker trusting the build tool - "Trust & Enable All". Depending on how you are running your build you could pass -skipPackagePluginValidation to your xcodebuild.

yonaskolb commented 3 months ago

Thanks for the info here @markst, I learned something too 😄