Rapier
例子
要运行示例项目,首先克隆仓库,然后从 Example 目录运行 pod install
。
需求
安装
Rapier 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:(目前还不是完全自动化的)
pod 'Rapier/AutoIntegrate'
这将还会拉入用于代码生成的 sourcery。然后在预编译构建阶段使用以下脚本
sourcerycmd="$PODS_ROOT/Sourcery/bin/sourcery"
normal_template_location="$PODS_ROOT/Rapier/Templates"
example_template_location="$PODS_ROOT/../../Rapier/Templates"
if [ -d "$normal_template_location" ]; then
template_location="$normal_template_location"
else
template_location="$example_template_location"
fi
$sourcerycmd --templates "$template_location" --sources "$SRCROOT" --exclude-sources "$PODS_ROOT" --exclude-sources "$SRCROOT/PODS" --output "$SRCROOT/Generated" --verbose
您项目的 Sourceroot 应包含一个名为 'Generated' 的文件夹。将其添加到 xcode 项目中即可。
如果您不喜欢默认集成,只需在您的项目中添加
pod 'Rapier'
但您需要手动设置 sourcery 集成。注意:这个 pods 使用 swifttemplates,这是 sourcery 黑莓版不支持的特征。(使用 sourcery 的发布 tap 或者通过 cocoa pods 包含 sourcery。)
作者
用户名:kaygro, [邮箱地址显示方式隐藏]
许可协议
Rapier遵从MIT许可协议。有关更多信息,请参阅LICENSE文件。