LicensesViewController 0.11.0

LicensesViewController 0.11.0

测试已测试
Lang语言 SwiftSwift
许可证 NOASSERTION
发布最后发布2022年12月
SPM支持 SPM

Carlo Eugster维护。




  • Carlo Eugster

LicenseGenerator iOS

Build Version Swift Maintainability

递归查找目录中的所有 LICENSE.* 文件,并生成可以在 Settings.bundle 或提供的视图控制器中显示的 plist。

Screenshot

此脚本能帮助确保应用程序的许可证部分始终保持最新。因为它递归地搜索,所以脚本非常适合与 Cocoapods 项目一起使用。

灵感来自于 JosephH 和 Sean 在 stackoverflow 上的评论。

构建脚本

构建脚本递归地搜索项目中的 LICENSE 文件,并生成可在 Settings.bundle 中使用的 plist。脚本假定 LICENSE 文件的父目录也是需要归档的库的名称。

用法

  • credits.py 复制到项目根目录
  • 打开项目,选择你的 目标,然后选择 构建阶段
  • 在目标依赖项之后添加一个 运行脚本阶段
  • 添加如下内容: ./credits.py -s "$SRCROOT" -o "$SRCROOT/Project/Settings.bundle/Credits.plist"
  • 构建与盈利

排除目录

可以可选地告诉生成器忽略某些路径。为此,请使用 `-e` 选项,并传入一个以逗号分隔的路径片段列表。

视图控制器

如果你的应用未使用 Settings.bundle,则可以使用提供的视图控制器来显示许可协议。

安装

将 LicensesViewController 添加到你的 Podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'LicensesViewController', '~> 0.10.0'

然后告诉 Pod 进行安装

$ pod install

从本仓库获取 credits.py 并将其添加到你的项目中。

用法

按照上述描述添加构建脚本,并确保生成的plist文件包含在应用目标中。

import LicensesViewController

// ...

let licensesController = LicensesViewController()
licensesController.loadPlist(Bundle.main, resourceName: "Credits")

// ...

示例项目

git clone https://github.com/carloe/LicenseGenerator-iOS.git
cd LicenseGenerator-iOS/Example
pod install
open LicensesViewControllerExample.xcworkspace

需求

  • iOS 8.0
  • tvOS 9.0
  • Swift 4.25.05.15.2

如果您依赖于Python 2.x,请在Podfile中使用'~> 0.9.0'

如果目标是Swift 4.0,请在Podfile中使用'~> 0.6.6'

联系

Twitter: @carloeugster 邮箱: [email protected]

许可

MIT