All Versions
Latest Version
Avg Release Cycle
88 days
Latest Release

Changelog History
Page 3

  • v4.2.1 Changes

    πŸ”„ Changes in core dependencies of SwiftGen

    πŸ› Bug Fixes

    • πŸ›  Fix a bug in which the version of SwiftGen was reported as v0.0 by swiftgen --version.
      Olivier Halligon

    Internal Changes

  • v4.2.0 Changes

    πŸ”„ Changes in core dependencies of SwiftGen

    πŸ†• New Features

    • You can now pass custom parameters to your templates using the --param X=Y syntax.
      @djbe #265
      • This command-line option can be repeated at will and used to pass structured custom parameters (e.g. --param tabs=2 --param --param foo.baz=2).
      • You can then use them in your templates using e.g. {{param.tabs}}, {{}} & {{}}.
    • Templates can now access environment variables via the env key of the Stencil context (e.g. {{env.USER}}, {{env.LANG}}).
      @djbe #265
      • This is especially useful when integrating SwiftGen as a Script Build Phase in your Xcode project as you can then access Xcode Build Settings exposed as environment variables by Xcode, e.g. {{env.PRODUCT_MODULE_NAME}}.
    Notable new features from other SwiftGen repositories

    πŸ—„ Deprecations

    🚚 In preparation for an upcoming cleanup of SwiftGen to remove some legacy code as well as Stencil old variables, tags and filters, and change the default templates to Swift 3, some things are being deprecated and will be removed in the next major version 5.0.

    As a result, if you wrote custom templates, you should already prepare for the upcoming 5.0 by migrating your templates to use the new variables (already avaiable in SwiftGen 4.2 / SwiftGenKit 1.0).

    πŸ“š See #244 and [the Migration Guide](Documentation/ for a list of deprecations and their replacements.

    πŸ› Bug Fixes

    πŸ›  Notable bug fixes from other SwiftGen repositories

    Internal changes

    • SwiftGen has migrated to its own GitHub organization πŸŽ‰.
    • SwiftGen has been split in multiple repositories and separate modules.
      Olivier Halligon @djbe #240 #265
      • The present SwiftGen is the CLI parsing. It is in charge of calling the frameworks, feeding them appropriate parameters according to the command line arguments.
      • SwiftGenKit is the framework responsible for parsing your assets/resources and turning them into a structured representation compatible with Stencil templates.
      • StencilSwiftKit is a framework adding some extensions to the template engine Stencil used by SwiftGen. It adds some tags and filters as well as convenience methods shared both by SwiftGen itself and by Sourcery.
      • The SwiftGen templates has been moved into a dedicated templates repo so they can evolve and be unit-tested separately of SwiftGen.

    πŸ“š Note: The next minor version will focus on bringing more documentation for all this new structure and improve ease of future contributions.

  • v4.1.0 Changes

    πŸ†• New Features

    • βž• Added a script reference to simplify and automate localization of existing non localized project.
    • βž• Added a storyboards-osx-swift3 template.
      Felix Lisczyk #225
    • βž• Added a strings-no-comments-swift3 template that does not include the default translation of each key.
      LoΓ―s Di Qual #222
    • Images: new dot-syntax template, use dot-syntax-swift3 or dot-syntax (for Swift 2.3).
      David Jennes #206
    • Reworked the "dot-syntax" and "structured" templates to use the new macro and call tags, which greatly simplifies the templates, and also removes the limitation of 5-level deep structures.
      David Jennes #237
    • Storyboards: automatically detect the correct modules that need to be imported. The --import option has therefore been deprecated, as well as the extraImports template variable. Instead use the the new modules variable, which offers the same functionality.
      David Jennes #243
    • πŸ‘Œ Support multiple input paths for some commands.
      David Jennes #213
      • fonts accepts multiple input directories, all found fonts will be added to the families template variable.
      • images now supports multiple asset catalogs as input. Templates can now use the catalogs variable to access each individual catalog.
      • storyboards accepts multiple paths (to folders or storyboard files). All found storyboards will be available in the storyboards template variable.

    πŸ› Bug Fixes

    • Strings: fix issue with dot-syntax-swift3 where function definitions were not Swift 3 guidelines compliant.
      David Jennes #241 #247
    • Snake cased keys with uppercase letters are correctly camel cased again.
      Cihat GΓΌndΓΌz #226 #233

    Internal changes

    • πŸ‘ Better error handling in the colors command.
      David Jennes #227
    • πŸ‘€ Stencil: added two new tags macro and call, see the documentation. for in depth explanations on how to use them.
      David Jennes #237
    • SwiftLint: Remove switch_case_on_newline warning for generated color file.
      Mickael Titeca #239
    • βœ… Stencil: better string filter testing and fixed a small issue with lowerFirstWord.
      David Jennes #245
  • v4.0.1 Changes

    πŸ› Bug Fixes

    Internal changes

  • v4.0.0 Changes

    πŸ’₯ Breaking Changes

    • πŸ”„ Change swift 3 storyboard segue template's sender from AnyObject to Any.
      Derek Ostrander #197
    • πŸ›  Fix swift 3 storyboard templates to be compliant with swift 3 api design guidelines.
      Afonso #194
    • βœ‚ Remove the key param label from the tr function for Localized String in the Swift 3 template.
      AndrewSB #190
    • πŸ”Š The swiftgen images command now uses the actool utility to parse asset catalogs, ensuring that the parser correctly handles namespaced folders.
       ⚠️ Note that you now have to specify the exact path to your .xcassets assets catalogs  when using swiftgen images (and not just a directory to parse).
      David Jennes #199

    πŸ†• New Features

    • βž• Add support for multiline strings in *.strings file.
      Jeong Yonguk #192
    • βž• Add option to add import statements at the top of the generated swift file (for storyboards) using the import flag.
      David Jennes #175
    • Escape reserved swift keywords in the structured and dot-syntax generated strings code.
      Afonso #198
  • v3.0.1 Changes

  • v3.0.0 Changes

    • βž• Add template that calls NSLocalizedString() separately for each string, which is useful when trying to extract strings in the app to a .strings file.
      Ahmet Karalar
    • βž• Add some file_length and similar SwiftLint exceptions in bundled templates, as files generated by SwiftGen might contain lots of constants and can be long by design.
      Olivier Halligon
    • πŸ–¨ Error messages ("template not found", etc) are now printed on stderr.
      Olivier Halligon
    • βž• Add more swiftgen templates subcommands.
      Olivier Halligon
      • swiftgen templates list lists all the available templates
      • swiftgen templates which <name> prints the path to the template named <name>
      • swiftgen templates cat <name> prints the content to the template named <name>
      • <name> here can be either a parser name like colors or a composed name colors-rawValue for a specific template.
    • πŸ›  Fix swift 3 renaming change in strings-swift3.stencil.
      Kilian Koeltzsch #150
    • πŸ›  Fix non-custom class, non-base view controller handling in storyboards-swift3.stencil.
      Syo Ikeda #152
    • βž• Add strongly typed initialViewController() overrides for storyboard templates if available.
      Syo Ikeda #153 #163
    • βž• Add support for font files containing multiple descriptors.
      Chris Ellsworth #156
    • ⚑️ Update deprecated usage of generics for Swift 3 / Xcode 8 beta 6.
      Chris Ellsworth #158
    • πŸ›  Fix case when missing positional parameters, which leads to parameters in the enum with unspecified type (undeterminable from the Localizable.strings format analysis) where reported as Any β€” which is not a CVarArgType. Now using UnsafePointer<()> arguments instead for such odd edge-cases that should never happen anyway.
      Olivier Halligon
    • πŸ“œ Now reports an error when it failed to parse a color in a color input file.
      Olivier Halligon #162
    • πŸ†• New Strings template (available via -t dot-syntax), allowing string keys containing dots (like to be organized as a hierarchy and accessible via dot syntax.
      Cihat GΓΌndΓΌz #159
    • ⚑️ Update Swift 3 templates to use lowercase enums.
      Olivier Halligon #166
    • πŸ†• New Strings template (available via -t dot-syntax-swift3), allowing keys with dots in Swift 3 (see above).
      Cihat GΓΌndΓΌz #168

    πŸ’‘ You can now create your custom templates more easier than ever, by cloning an existing template!

    0️⃣ > e.g. to clone the default strings-default.stencil template:

    • use swiftgen templates cat strings --output strings-custom.stencil πŸ‘― > * modify the cloned strings-custom.stencil template to your liking
    • use it with swiftgen strings … --templatePath strings-custom.stencil … in your projects!

    Important Notes

    • Some keys for various templates have changed to provide more flexibility and enable some new features in the templates. As a result, if you created your own custom templates, they might not all be totally compatible with SwiftGen 3.0.0 (hence the new major version). πŸ“š Please read the Custom Templates documentation to find out the new Stencil context keys and update your custom templates accordingly.

    ⚑️ If you're using one of the bundled templates, all of them have been updated appropriately.

    • Also if you use Swift 3, and thus use the -t swift3 flag to use the Swift 3 templates, be advised those has been modified to take the latest Swift 3 modifications into account (including naming convensions) so your code might need to be updated according to match the latest Swift 3 recommendations.
  • v2.0.0 Changes

    Note: The Stencil context keys (the name of the variables used in templates) for storyboard has changed a bit. πŸ‘€ Especially, class has been renamed into customClass (see #131) to better describe the intent (as this isn't defined if there is no custom class set in the Storyboard), and πŸ†• new keys isBaseViewController and baseType has been added.

    This means that if you did implement your own custom templates for storyboards (instead of using the bundled ones), you'll have to remplace {{class}} by {{customClass}} in those storyboard templates, otherwise they'll probably stop working as expected. That's the main reason why the version has been bumped to a major version 2.0.0.

  • v1.1.2 Changes

    • πŸ›  Fix issue introduced by 1.1.1 in storyboard templates not returning.
      Ben Chatelain #138
  • v1.1.1 Changes

    • βœ‚ Removed the last force-unwrap from storyboard templates.
      Olivier Halligon