SwiftGen-Colors v6.2.0 Release Notes
Release Date: 2020-06-18 // almost 4 years ago-
π§ β οΈ This minor version contains a lot of deprecations that may apply to your configuration and how you use SwiftGen. With the exception of
swift3
templates (which have been removed), everything should still work as before. But be warned that all features marked as deprecated will be removed in SwiftGen 7.0.π Read the [SwiftGen 6.2 Migration Guide](Documentation/MigrationGuide.md#migrating-to-swiftgen-62) for a list of changes you'll need to apply.
π₯ Breaking Changes
- As Swift 3 is officially no longer maintained, we're obsoleting the Swift 3 templates and they are no longer included with SwiftGen. You can still use the old swift 3 templates by getting them from older SwiftGen versions, or from GitHub by browsing older tags.
David Jennes #601 #691
π Deprecations
- π XCAssets: the
colorAliasName
andimageAliasName
template parameters are now deprecated and will be removed in the next major release.
David Jennes #614 - π The use of
swiftgen <parser>
(e.g.swiftgen strings
,swiftgen xcassets
, β¦) command line for running individual parsers is now deprecated in favor ofswiftgen run <parser>
. See "New Features" below.
Olivier Halligon #705 - π The subcommand
swiftgen templates
has been renamedswiftgen template
(singular); the plural form of the command has been deprecated and will be removed in next major version.
Olivier Halligon #697 - π The ability for SwiftGen to search custom named templates in
~/Library/Application Support
has been deprecated and will be removed in SwiftGen 7.0. This little known feature made SwiftGen dependent on the machine it was running on. UsetemplatePath
to reference custom templates by path instead.
Olivier Halligon #717
π New Features
- π Invoking individual parsers from the command line is now done via
swiftgen run <parser>
. We still highly recommend to use a configuration file for flexibility and performance reasons in your projects, and only useswiftgen run <parser>
for things like quick iterations when writing your own custom templates.
Olivier Halligon #705 - You can now easily create a new config file using
swiftgen config init
. This will create an example and commented config file and open it to let you edit it to your needs. Note that the generated config file is static content which doesn't take the user's project into account (though that might change in the future).
Olivier Halligon #694 - π You can now use
swiftgen template doc [parser] [templateName]
on the command line to quickly open the documentation for templates on GitHub directly from your terminal.
Olivier Halligon #697 - π Each parser now accepts an
options
dictionary, with which you can set internal parser settings to change its behaviour. See the parser's specific documentation for available options.
David Jennes #587 #597 - π Strings: the parser now accepts a
separator
option, used to split keys into structured components. The default separator remains.
. For more information, check the [parser's documentation](Documentation/Parsers/strings.md#customization).
David Jennes #576 #588 - π Core Data: the built-in templates now support an optional
extraImports
parameter. With this you can provide a list of modules to additionally import, for when you have properties with types from external modules. For more information, check the [template's documentation](Documentation/templates/coredata/swift4.md#customization).
David Jennes #591 #592 - π Core Data: the built-in templates now support
RawRepresentable
attributes (such asenum
,OptionSet
, β¦). They'll check the "User Info" of an attribute for aRawType
key, which should be set to the type name you want to use for that attribute. To avoid optional attributes, you can also add theunwrapOptional
user info key. For more information, check the [template's documentation](Documentation/templates/coredata/swift4.md#userinfo-keys).
David Jennes #566 #609 #593 #610 - π Strings: the built-in templates now accept a parameter
lookupFunction
for customizing the localization function, check the [template documentation](Documentation/templates/strings/) for more information.
Steven Magdy 426 468 573 716 - π Strings: templates to generate Objective-C. Please check [the template's documentation](Documentation/templates/strings/objc.md) for more information.
Eric Slosser SwiftGen/SwiftGen#378 - π± XCAssets: the parser now supports AR Resource Groups, together with reference images and objects.
David Jennes #614 - π Templates: Bundle now use static property on BundleToken for better performance.
shuoli84 #623 - π All parsers now have built-in Swift 5 templates.
David Jennes #595 #600 - Most templates now accept a parameter to force having the file name used as namespace (
enum <FileName>
) in generated code even if there's only one single input file.
Viktoras LaukeviΔius #669 Olivier Halligon #693
π Bug Fixes
- π SwiftGen now properly shows a better help message and the command usage when running an incomplete command, instead of complaining about a config file.
Olivier Halligon #706 - π XCAssets: improved the performance for color assets by caching the resolved colors.
David Jennes #578 #589 - Core Data:
entityName
is now correctly aclass var
instead of aclass func
.
David Jennes #590 - Strings: we now correctly generate the type
Any
(instead ofString
) for%@
placeholders.
David Jennes 620 - π Colors: Reduce initializer type inference for improved compilation performance.
Markus FaΓbender #663 - π Config Lint: fix config lint not processing relative paths containing ".." correctly.
Wolfgang Lutz #688 - Core Data: the generated code was missing
,
(comma) for fetch requests with multiple arguments.
David Jennes #692 - β Colors: Fix compile time warning when long expression type checking is enabled.
Ryan Mason-Davies #704 #710
Internal Changes
- π The main branch of the repository has been renamed from
master
tostable
. If you pointed yourPodfile
or dependency managment tool tomaster
instead of an official release/tag, you will have to update the branch name in your dependency file.
Olivier Halligon #714 - π Documentation: Improved doc for creating custom templates, and added a Documentation Table of Contents.
Olivier Halligon #713 - π¨ Refactoring: Reduce globals & rearrange CLI code.
Olivier Halligon #586 - π Moved generated test output files into subdirectories per template.
David Jennes #598 - π§ Compile generated output using configuration files for easier management.
David Jennes #365 #599 - π± XCAssets: renamed the catalogs we use for sample code & testing to avoid some confusion.
David Jennes #613 - β‘οΈ Update SwiftLint and enable some extra SwiftLint rules.
David Jennes #617 - π· Some CI fixes related to software versions.
Patrick Nollet #645 - β‘οΈ Updated to CocoaPods 1.9.0.
David Jennes #619 - β‘οΈ Updated Pods and Gems dependencies.
David Jennes #684
- As Swift 3 is officially no longer maintained, we're obsoleting the Swift 3 templates and they are no longer included with SwiftGen. You can still use the old swift 3 templates by getting them from older SwiftGen versions, or from GitHub by browsing older tags.