swiftgen.yml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ## Note: all of the config entries below are just examples with placeholders. Be sure to edit and adjust to your needs when uncommenting.
  2. ## In case your config entries all use a common input/output parent directory, you can specify those here.
  3. ## Every input/output paths in the rest of the config will then be expressed relative to these.
  4. ## Those two top-level keys are optional and default to "." (the directory of the config file).
  5. # input_dir: MyLib/Sources/
  6. # output_dir: MyLib/Generated/
  7. ## Generate constants for your localized strings.
  8. ## Be sure that SwiftGen only parses ONE locale (typically Base.lproj, or en.lproj, or whichever your development region is); otherwise it will generate the same keys multiple times.
  9. ## SwiftGen will parse all `.strings` files found in that folder.
  10. #json:
  11. # inputs: hoxin/Resources/Localization
  12. # filter: .+\.xcstrings$
  13. # outputs:
  14. # templatePath: ./utils/en-strings.stencil
  15. # output: Project/Generated/generated-en.strings
  16. #strings:
  17. # inputs:
  18. # - hoxin/Resources/en.lproj
  19. # outputs:
  20. # - templateName: structured-swift5
  21. # output: hoxin/Generated/Strings+Generated.swift
  22. json:
  23. inputs: bugu/Resources/
  24. filter: .+\.xcstrings$
  25. outputs:
  26. templatePath: ./Templates/en-strings.stencil
  27. output: bugu/HXCore/Generated/generated-en.strings
  28. strings:
  29. inputs: bugu/HXCore/Generated/generated-en.strings
  30. outputs:
  31. templatePath: ./Templates/l21strings.stencil
  32. output: bugu/HXCore/Generated/Strings+Generated.swift
  33. ## Generate constants for your Assets Catalogs, including constants for images, colors, ARKit resources, etc.
  34. ## This example also shows how to provide additional parameters to your template to customize the output.
  35. ## - Especially the `forceProvidesNamespaces: true` param forces to create sub-namespace for each folder/group used in your Asset Catalogs, even the ones without "Provides Namespace". Without this param, SwiftGen only generates sub-namespaces for folders/groups which have the "Provides Namespace" box checked in the Inspector pane.
  36. ## - To know which params are supported for a template, use `swiftgen template doc xcassets swift5` to open the template documentation on GitHub.
  37. #xcassets:
  38. # inputs:
  39. # - hoxin/Resources/Assets.xcassets
  40. # - hoxin/Resources/Icons.xcassets
  41. # - hoxin/Resources/Colors.xcassets
  42. # outputs:
  43. # - templateName: swift5
  44. # params:
  45. # forceProvidesNamespaces: true
  46. # output: hoxin/Generated/XCAssets+Generated.swift
  47. ## Generate constants for your storyboards and XIBs.
  48. ## This one generates 2 output files, one containing the storyboard scenes, and another for the segues.
  49. ## (You can remove the segues entry if you don't use segues in your IB files).
  50. ## For `inputs` we can use "." here (aka "current directory", at least relative to `input_dir` = "MyLib/Sources"),
  51. ## and SwiftGen will recursively find all `*.storyboard` and `*.xib` files in there.
  52. # ib:
  53. # inputs:
  54. # - .
  55. # outputs:
  56. # - templateName: scenes-swift5
  57. # output: IB-Scenes+Generated.swift
  58. # - templateName: segues-swift5
  59. # output: IB-Segues+Generated.swift
  60. ## There are other parsers available for you to use depending on your needs, for example:
  61. ## - `fonts` (if you have custom ttf/ttc font files)
  62. ## - `coredata` (for CoreData models)
  63. ## - `json`, `yaml` and `plist` (to parse custom JSON/YAML/Plist files and generate code from their content)
  64. ## …
  65. ##
  66. ## For more info, use `swiftgen config doc` to open the full documentation on GitHub.
  67. ## https://github.com/SwiftGen/SwiftGen/tree/6.4.0/Documentation/
  68. plist:
  69. inputs: bugu/Resources/Plist
  70. outputs:
  71. templateName: runtime-swift5
  72. params:
  73. forceProvidesNamespaces: true
  74. output: bugu/HXCore/Generated/Plist+Generated.swift