Pippin
Pippin
是一组用于设置 iOS 应用基础设施并协助开发任务(如编写代码、测试和调试)的工具集合。
使用默认设置开始只要声明 Podfile 依赖项就很简单
pod 'Pippin'
并且,在您的应用启动序列中的某个时刻
import Pippin
import PippinAdapters
let environment = Environment.default(
bugReportRecipients: ["[email protected]"],
touchVizRootVC: UIViewController(nibName: nil, bundle: nil) // optional
)
// Crashlytics is a special situation
environment.crashReporter = CrashlyticsAdapter(debug: true)
// other optional peripherals
environment.locator = CoreLocationAdapter(locatorDelegate: self)
environment.connectEnvironment()
您将得到以下内容,几乎无需编写任何样板代码
- 记录日志
- 崩溃报告
- 错误报告
- 进度指示器
- 警告对话框
- 字体
- 应用程序和启动信息
- 数据模型
- 触摸可视化
- 启动参数和环境变量
- 已授权的
CLLocationManager
(也可以用类似的方式获取已授权的AVCaptureDevice
)
Podspecs
有五个 podspecs 可以使用这些工具,请查阅每个的 README 以获取更多信息
注意:这些是通过单独的 podspecs 而不是带有多个 podspecs 的单个 podspec 交付的,有几个原因。这两个规范级别对所有功能并不是等效的。
- 仅为单个 subspec 安装
test_spec
存在问题。- 不支持使用
Pod:configurations
安装 subspec:https://github.com/CocoaPods/CocoaPods/issues/3503。
旧的 Pippin.podspec
现在是一个伞形框架,它拉取了 PippinCore
、PippinAdapters
、PippinLibrary
和 PippinTesting
以方便使用。
示例项目
这些项目用于测试,可以使用 pod try
进行评估
贡献
欢迎提交问题和拉取请求!
测试
rake test
运行一组Rake任务,这些任务本身也可以独立运行
example_smoke_tests
unit_tests
test_smoke_test
subspec_smoke_test
example_smoke_tests
对于 Examples/
中的每个项目,尝试 pod install
并构建。
unit_tests
运行为任何 test_specs
创建的Pippin podspecs单元测试套件。
test_smoke_test
通过 pod install
尝试构建 Example/Pippin.xcodeproject
单元和 UI 测试目标,这两个目标都声明了依赖于 PippinLibrary
和 PippinTesting
。
subspec_smoke_test
集成烟雾测试,为每个Pippin podspec的每个子spec生成一个Xcode项目,每个项目都有Swift和Objective-C两种语言实现,以便在执行pod install
后尝试构建。每个项目都存放在PippinTests/SmokeTests
下。
PippinTests/
还包含在ObjcApp/
和SwiftApp/
中的模板项目源代码,以及模板Podfile。
test_specs
Podspec Pippin的podspec现阶段在Tests/
目录下包含单元测试。
PippinLibrary
PippinTesting
感谢!
如果这个项目帮到了您,请考虑留一些小费