我在Xcode项目中有两个.strings文件,例如:First.strings和Second.strings,并希望SwiftGen为每个文件生成单独的.swift文件-一个包含First.strings文件的内容,另一个包含Second.strings文件的内容。我应该如何配置strings:参数下的swiftgen.yml文件,以便它知道如何做到这一点?我希望避免运行SwiftGen脚本两次。
.strings
First.strings
Second.strings
.swift
strings:
swiftgen.yml
toiithl61#
以下是有关构建swiftgen的文档
xcassets: - inputs: Foo/Assets.xcassets outputs: - templateName: swift5 output: Foo/Resources/Assets.swift - inputs: SwiftPackages/Foo/Sources/Foo/Assets/Assets.xcassets outputs: - templateName: swift5 output: SwiftPackages/Foo/Sources/Foo/Assets/Assets.swift
上面的配置给出了预期的结果。你可以通过运行swiftgen --verbose来验证它。上面的例子使用了xcassets,但是你也可以用字符串来做。
swiftgen --verbose
yrwegjxp2#
这应该行得通:
strings: inputs: - First.strings outputs: output: FirstOutput.swift inputs: - Second.strings outputs: output: SecondOutput.swift
2条答案
按热度按时间toiithl61#
以下是有关构建swiftgen的文档
上面的配置给出了预期的结果。你可以通过运行
swiftgen --verbose
来验证它。上面的例子使用了xcassets,但是你也可以用字符串来做。yrwegjxp2#
这应该行得通: