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
)
Podspec
有五个podspec用于提供这些工具,请查看每个的README以获取更多信息
注意:这些工具通过单独的podspec而不是包含多个podspec的单个podspec提供,有几个原因。这两个spec级别对于所有功能来说并不等价。
- 为仅一个子规格安装
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
运行为任何 test_specs
创建的Pippin podspec单元测试套件。
test_smoke_test
执行 pod install
并尝试构建位于 Example/Pippin.xcodeproject
的单元和UI测试目标,这两个目标都声明了对 PippinLibrary
和 PippinTesting
的依赖。
subspec_smoke_test
集成 smoke 测试,为每个 Pippin podspec 的每个 subspec 生成一个 Xcode 项目,每个项目同时包含 Swift 和 Objective-C,以便在 pod install 那个 subspec 后尝试构建。每个项目都存储在 PippinTests/SmokeTests
下。
PippinTests/
目录下还包含 ObjcApp/
和 SwiftApp/
中的模板项目源代码,以及模板 Podfile。
test_specs
Podspec Pippin podspecs 当前在 Tests/
目录下有单元测试。
PippinLibrary
PippinTesting
感谢!
如果这个项目对您有所帮助,请考虑留下小费