SwiftGen v6.0.0 Release Notes
Release Date: 2018-09-29 // about 5 years ago-
๐ โ ๏ธ This major version is a big milestone in which a lot of refactoring and cleaning has been done. Many features added over previous releases have been reworked and unified, while also preparing SwiftGen for future additions. This means that you'll need to adapt your configuration files (or command line invocations) and custom templates to work with this new major version.
๐ Read the SwiftGen 6.0 Migration Guide for a list of changes you'll need to apply.
๐ Changes in other SwiftGen modules
๐ฅ Breaking Changes
- ๐ Don't normalize string keys while parsing, let all transformation be done on template side. This makes the developer responsible to keep the language file organized, duplications won't be removed.
Diego Chohfi
#257 - โ Remove Swift 2 support.
David Jennes
#420 - ๐ Renamed the
storyboards
command toib
, to better reflect it's purpose. An alias forstoryboards
still exists, but it will be removed at some point.
David Jennes
#423 - ๐ฑ XCAssets: the generated templates won't namespace groups by default anymore, use the
forceProvidesNamespaces
flag to enable this behaviour again.
jechris
#453 - ๐ฑ XCAssets: the templates won't generate any all-values accessors anymore by default. Use the
allValues
flag to enable this behaviour again. Note: this replaces the oldnoAllValues
flag (with an inverse behaviour).
David Jennes
#480 - ๐ฑ XCAssets: Dropped the deprecated
allValues
constant, use the type specific constants such asallColors
,allDataItems
andallImages
. The default value ofimageAlias
has also been changed fromImage
toAssetImageTypeAlias
, to be consistent with the other types.
David Jennes
#482 - ๐ Interface Builder: split up the storyboards template into 2 parts, one for scenes and one for segues.
David Jennes
#419
๐ New Features
- โ Add ability to list all custom fonts and register them using
FontFamily.registerAllCustomFonts
.
Olivier Halligon
#394 - โ Add support for Swift Package Manager and Mint.
Yonas Kolb
#411 - ๐ The
swiftgen.yml
config file now accepts multiple outputs for each command, allowing you to generate multiple outputs from the same files and content. This also means that theoutput
parameter is now deprecated, in favour of theoutputs
parameter, and it may be removed in a future version of SwiftGen. Similarly, thepaths
parameter has been renamed toinputs
for consistency. You can always useswiftgen config lint
to validate your configuration file.
David Jennes
#424
#510 - ๐ Use
swiftlint:disable all
in generated files to avoid interference with SwiftLint rules custom to the host project.
Frederick Pietschmann
David Jennes
#409
#506 - ๐ฑ XCAssets: Added support for
NSDataAssets
.
Oliver Jones
#444 - ๐ Organised the generated code in sections for better readability, with all generated constants at the top of the file.
David Jennes
Olivier Halligon
#456
#481 - โ Added support for JSON, Plist and YAML files using the
swiftgen json
,swiftgen plist
andswiftgen yaml
commands. The parsed contexts and the generated files for each command have been kept quite similar, for easier switching between file formats.
John T McIntosh
Toshihiro Suzuki
Peter Livesey
David Jennes
#379
#359
#288
#188
#493
#504 - โก๏ธ Updated the playgrounds with the new
json
,plist
andyaml
commands, and updated the other pages to reflect the template changes.
David Jennes
#495 - ๐ง We're deprecating the old
--template
CLI option in favor of--templateName
, to better match the naming of the other options and the configuration file. The old--template
option will remain until the next major version.
David Jennes
#509
๐ Bug Fixes
- ๐ Fix memory leak in generated code for Fonts.
Olivier Halligon
#394 - ๐ Interface Builder: ensure the templates handle
GLKViewController
,AVPlayerViewController
andNSPageController
correctly.
David Jennes
#404
#414 - ๐ Interface Builder: ensure the parser can handle files with and without "trait variations".
David Jennes
#367
#429 - ๐ Restrict
SceneType
andInitialSceneType
to UIViewController when not targeting AppKit. When targeting AppKit, remove superfluousAny
.
Darron Schall
#463
#464 - Fonts: disable a warning in generated font files for projects with
conditional_returns_on_newlines
SwiftLint rule enabled.
Ryan Davies
#436
#465 - ๐ Interface Builder: the parser and templates now handle the "Inherit module from target" setting.
David Jennes
#435
#485 - ๐ Strings: the parser now correctly handles formats such as
% d
and%#x
.
David Jennes
#502 - Strings: ensure strings without arguments are not processed using
String(format:)
.
David Jennes
#503
Internal Changes
- Migrated to CircleCI 2.0.
David Jennes
#403 - ๐ Switched to using SwiftLint via CocoaPods instead of our own install scripts.
David Jennes
#401 - ๐ Enabled some extra SwiftLint rules for better code consistency.
David Jennes
#402
#476 - โก๏ธ Updated to latest Xcode (10.0.0) and Swift 4.2.
David Jennes
#415
#498 - โก๏ธ Update to Stencil 0.13.0, and use some of it's new filters in our templates.
David Jennes
#416
#475
#498 - โ
Store testing contexts as YAML files instead of PLISTs.
David Jennes
#418
#461 - ๐จ Refactor the parsers as they're getting more complex.
David Jennes
#417
#422 - ๐ Disabled a SwiftLint rule for function parameter count.
Oleg Gorbatchev
#428 - ๐ Fix missing link in the README.
Takeshi Fujiki
#459
- ๐ Don't normalize string keys while parsing, let all transformation be done on template side. This makes the developer responsible to keep the language file organized, duplications won't be removed.