简体   繁体   English

使用 Swift Package 管理器添加自动第三方库确认和许可证

[英]Automatic Third Party Libraries Acknowledgements and Licences added with Swift Package Manager

I am using the Swift Package Manger (SPM) to add third party libraries to my iOS application.我正在使用Swift Package Manger (SPM)将第三方库添加到我的 iOS 应用程序中。 I would like to display acknowledgements and their respected licences.我想表示感谢和他们受人尊敬的许可证。 In the old CocoaPod days this was possible with several libraries (eg this one ).在过去的CocoaPod时代,这可以通过几个库(例如这个)来实现。 Is there a way to achieve the similar things with SPM?有没有办法用 SPM 实现类似的事情?

I am looking for我在寻找

  1. An automated solution which generates licence information when a new dependencies is added/removed via SPM.通过 SPM 添加/删除新依赖项时生成许可证信息的自动化解决方案。
  2. Offers a UIViewController or Settings.bundle where the licences are displayed.提供显示许可证的UIViewControllerSettings.bundle

This doesn't have to be a library but can also be a build script.这不一定是库,也可以是构建脚本。 Item 2 could also be done by myself.第2项也可以自己完成。

I have found a great Library called LicensePlist , which does exactly what you asked for.我找到了一个很棒的库,叫做LicensePlist ,它完全符合您的要求。 The SPM support is still a bit lacking, however check out their GitHub Page for the exact installation instructions. SPM 支持仍然有点缺乏,但是请查看他们的 GitHub 页面以获取确切的安装说明。

You create a settings bundle and add a Build Phase (explained on the LicensePlist Github Page).创建一个设置包并添加一个构建阶段(在 LicensePlist Github 页面上进行了说明)。 The library generates a .plist file for each library in your Settings Bundle and also generates a file that automatically adds a submenu in the in-app settings where all the Licenses are listed by name.该库为您的设置包中的每个库生成一个.plist文件,并生成一个文件,该文件会自动在应用内设置中添加一个子菜单,其中所有许可证都按名称列出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM