STRUCT
ResourceSynthesizer
Contents
- Properties
templateTypeparserparserOptionsextensions
- Methods
strings(parserOptions:)strings(plugin:parserOptions:)assets(parserOptions:)assets(plugin:parserOptions:)fonts(parserOptions:)fonts(plugin:parserOptions:)plists(parserOptions:)plists(plugin:parserOptions:)coreData(plugin:parserOptions:)coreData(parserOptions:)interfaceBuilder(plugin:parserOptions:)interfaceBuilder(parserOptions:)json(plugin:parserOptions:)json(parserOptions:)yaml(plugin:parserOptions:)yaml(parserOptions:)files(plugin:parserOptions:extensions:)files(parserOptions:extensions:)custom(plugin:parser:parserOptions:extensions:resourceName:)custom(name:parser:parserOptions:extensions:)
public struct ResourceSynthesizer: Codable, Equatable, SendableA resource synthesizer for given file extensions.
For example to synthesize resource accessors for strings, you can use:
.strings()for tuist's default.strings(parserOptions: ["separator": "/"])to use strings template with SwiftGen Parser Options.strings(plugin: "MyPlugin")to use strings template from a plugin.strings(templatePath: "Templates/Strings.stencil")to use strings template at a given path
Properties
templateType
public var templateType: TemplateTypeTemplates can be of multiple types
parser
public var parser: ParserparserOptions
public var parserOptions: [String: Parser.Option]extensions
public var extensions: Set<String>Methods
strings(parserOptions:)
public static func strings(parserOptions: [String: Parser.Option] = [:]) -> SelfDefault strings synthesizer defined in Tuist/{ProjectName} or tuist itself
strings(plugin:parserOptions:)
public static func strings(
plugin: String,
parserOptions: [String: Parser.Option] = [:]
) -> SelfStrings synthesizer defined in a plugin
assets(parserOptions:)
public static func assets(parserOptions: [String: Parser.Option] = [:]) -> SelfDefault assets synthesizer defined in Tuist/{ProjectName} or tuist itself
assets(plugin:parserOptions:)
public static func assets(
plugin: String,
parserOptions: [String: Parser.Option] = [:]
) -> SelfAssets synthesizer defined in a plugin
fonts(parserOptions:)
public static func fonts(parserOptions: [String: Parser.Option] = [:]) -> SelfDefault fonts synthesizer defined in Tuist/{ProjectName} or tuist itself
fonts(plugin:parserOptions:)
public static func fonts(
plugin: String,
parserOptions: [String: Parser.Option] = [:]
) -> SelfFonts synthesizer defined in a plugin
plists(parserOptions:)
public static func plists(parserOptions: [String: Parser.Option] = [:]) -> SelfDefault plists synthesizer defined in Tuist/{ProjectName} or tuist itself
plists(plugin:parserOptions:)
public static func plists(
plugin: String,
parserOptions: [String: Parser.Option] = [:]
) -> SelfPlists synthesizer defined in a plugin
coreData(plugin:parserOptions:)
public static func coreData(
plugin: String,
parserOptions: [String: Parser.Option] = [:]
) -> SelfCoreData synthesizer defined in a plugin
coreData(parserOptions:)
public static func coreData(parserOptions: [String: Parser.Option] = [:]) -> SelfDefault CoreData synthesizer defined in Tuist/{ProjectName}
interfaceBuilder(plugin:parserOptions:)
public static func interfaceBuilder(
plugin: String,
parserOptions: [String: Parser.Option] = [:]
) -> SelfInterfaceBuilder synthesizer defined in a plugin
interfaceBuilder(parserOptions:)
public static func interfaceBuilder(parserOptions: [String: Parser.Option] = [:]) -> SelfInterfaceBuilder synthesizer with a template defined in Tuist/{ProjectName}
json(plugin:parserOptions:)
public static func json(plugin: String, parserOptions: [String: Parser.Option] = [:]) -> SelfJSON synthesizer defined in a plugin
json(parserOptions:)
public static func json(parserOptions: [String: Parser.Option] = [:]) -> SelfJSON synthesizer with a template defined in Tuist/{ProjectName}
yaml(plugin:parserOptions:)
public static func yaml(plugin: String, parserOptions: [String: Parser.Option] = [:]) -> SelfYAML synthesizer defined in a plugin
yaml(parserOptions:)
public static func yaml(parserOptions: [String: Parser.Option] = [:]) -> SelfCoreData synthesizer with a template defined in Tuist/{ProjectName}
files(plugin:parserOptions:extensions:)
public static func files(
plugin: String,
parserOptions: [String: Parser.Option] = [:],
extensions: Set<String>
) -> SelfFiles synthesizer defined in a plugin
files(parserOptions:extensions:)
public static func files(
parserOptions: [String: Parser.Option] = [:],
extensions: Set<String>
) -> SelfFiles synthesizer with a template defined in Tuist/{ProjectName}
custom(plugin:parser:parserOptions:extensions:resourceName:)
public static func custom(
plugin: String,
parser: Parser,
parserOptions: [String: Parser.Option] = [:],
extensions: Set<String>,
resourceName: String
) -> SelfCustom synthesizer from a plugin
- Parameters:
- plugin: Name of a plugin where resource synthesizer template is located
- parser:
Parserto use for parsing the file to obtain its data - extensions: Set of extensions that should be parsed
- resourceName: Name of the template file and the resulting
.swiftfile
Parameters
| Name | Description |
|---|---|
| plugin | Name of a plugin where resource synthesizer template is located |
| parser | Parser to use for parsing the file to obtain its data |
| extensions | Set of extensions that should be parsed |
| resourceName | Name of the template file and the resulting .swift file |
custom(name:parser:parserOptions:extensions:)
public static func custom(
name: String,
parser: Parser,
parserOptions: [String: Parser.Option] = [:],
extensions: Set<String>
) -> SelfCustom local synthesizer defined Tuist/ResourceSynthesizers/{name}.stencil
- Parameters:
- name: Name of synthesizer
- parser:
Parserto use for parsing the file to obtain its data - extensions: Set of extensions that should be parsed
Parameters
| Name | Description |
|---|---|
| name | Name of synthesizer |
| parser | Parser to use for parsing the file to obtain its data |
| extensions | Set of extensions that should be parsed |
