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 提供。这两个规范级别在所有功能上并不等效。
- 安装单个子规范
test_spec
时存在问题。- 不支持使用
Pod:configurations
安装子规范: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
运行任何 Pippin podspec 中任何 test_specs
创建的单元测试套件。
test_smoke_test
执行 pod install
并尝试构建 Example/Pippin.xcodeproject
单元和 UI 测试目标,这两个目标都声明了对 PippinLibrary
和 PippinTesting
的依赖。
subspec_smoke_test
一个集成冒烟测试,为每个 Pippin podspec 的每个 subspec 生成一个 Xcode 项目,每个以 Swift 和 Objective-C 编写,并尝试在 pod install
访问此 subspec 后进行构建。每个项目都存放在 PippinTests/SmokeTests
下。
PippinTests/
还包含位于 ObjcApp/
和 SwiftApp/
的模板项目源代码,以及模板 Podfile。
test_specs
Podspec Pippin podspecs 当前在 Tests/
下包含单元测试
PippinLibrary
PippinTesting
感谢!
如果您觉得这个项目有帮助,请考虑给我们的小费