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
byswiftgen --version
.
Olivier Halligon
Internal Changes
- β‘οΈ Update StencilGenKit to 1.0.2 and update Circle CI to Xcode 8.3.
Diogo Tridapalli #295 - π· Switch from Travis CI to Circle CI, clean up the Rakefile in the process.
David Jennes Olivier Halligon #269 - π Fix remaining enum names not Swift 3 compliant.
Liquidsoul #297 - β Added the
CONTRIBUTING.md
file to help new contributors.
Olivier Halligon Cihat GΓΌndΓΌz #149 #298
- π Fix a bug in which the version of SwiftGen was reported as
-
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 foo.bar=1 --param foo.baz=2
). - You can then use them in your templates using e.g.
{{param.tabs}}
,{{param.foo.bar}}
&{{param.foo.baz}}
.
- This command-line option can be repeated at will and used to pass structured custom parameters (e.g.
- 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}}
.
- 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.
Notable new features from other SwiftGen repositories
- π Use an explicit bundle parameter to support frameworks for all templates.
@NachoSoto @djbe #255 SwiftGen/templates#17
π 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/MigrationGuide.md) for a list of deprecations and their replacements.
π Bug Fixes
π Notable bug fixes from other SwiftGen repositories
- Storyboards templates won't
import
your app module anymore, removing that annoying warning.
@djbe SwiftGen/templates#19
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.
- You can now pass custom parameters to your templates using the
-
v4.1.0 Changes
π New Features
- β Added a script reference to simplify and automate localization of existing non localized project.
HuguesBR - β 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
ordot-syntax
(for Swift 2.3).
David Jennes #206 - Reworked the "dot-syntax" and "structured" templates to use the new
macro
andcall
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 theextraImports
template variable. Instead use the the newmodules
variable, which offers the same functionality.
David Jennes #243 - π Support multiple input paths for some commands.
David Jennes #213fonts
accepts multiple input directories, all found fonts will be added to thefamilies
template variable.images
now supports multiple asset catalogs as input. Templates can now use thecatalogs
variable to access each individual catalog.storyboards
accepts multiple paths (to folders orstoryboard
files). All found storyboards will be available in thestoryboards
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
andcall
, 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
- β Added a script reference to simplify and automate localization of existing non localized project.
-
v4.0.1 Changes
π Bug Fixes
- Escape newlines again in .strings file keys.
ChristopherRogers #208 - π Fix broken
import
option added in 4.0.0.
David Jennes #214 - π Show an error when the provided path to the
images
command is not an asset catalog.
David Jennes #217 - Strings dot-syntax template: use
enum
s for namespacing instead ofstruct
s.
David Jennes #218
Internal changes
- Swift 3 migration.
ahtierney #201 - π Restructure the SwiftGen project to build as an
.app
during developement, for easier debugging in Xcode.
ahtierney #204 - Consolidate the use of PathKit internally.
David Jennes #212 - π Updated Stencil to 0.7.2.
Kyle Fuller #216
- Escape newlines again in .strings file keys.
-
v4.0.0 Changes
π₯ Breaking Changes
- π Change swift 3 storyboard segue template's sender from
AnyObject
toAny
.
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 thetr
function for Localized String in the Swift 3 template.
AndrewSB #190 - π The
swiftgen images
command now uses theactool
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 usingswiftgen 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
- π Change swift 3 storyboard segue template's sender from
-
v3.0.1 Changes
- β Add support for Xcode 8 and Swift 2.3.
(Should still compile in Xcode 7.3 but theRakefile
to build, install and release requires Xcode 8).
Valentin Knabel Ignacio Romero Zurbuchen HanxuanZhou Syo Ikeda
- β Add support for Xcode 8 and Swift 2.3.
-
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 Halligonswiftgen templates list
lists all the available templatesswiftgen 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 likecolors
or a composed namecolors-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 asAny
β which is not aCVarArgType
. Now usingUnsafePointer<()>
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 foo.bar.baz) 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 clonedstrings-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.
- β Add template that calls
-
v2.0.0 Changes
- π Fix issue with txt files bailing on comments.
Derek Ostrander #140 - β Added support for tvOS and watchOS in images, fonts and color templates.
Tom Baranes #145 - β Added enum-based structured identifiers via
-t structured
option.
Cihat GΓΌndΓΌz #148 - β Added support for OSX in storyboards.
Tom Baranes #131
Note: The
Stencil
context keys (the name of the variables used in templates) for storyboard has changed a bit. π Especially,class
has been renamed intocustomClass
(see #131) to better describe the intent (as this isn't defined if there is no custom class set in the Storyboard), and π new keysisBaseViewController
andbaseType
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. - π Fix issue with txt files bailing on comments.
-
v1.1.2 Changes
- π Fix issue introduced by 1.1.1 in storyboard templates not returning.
Ben Chatelain #138
- π Fix issue introduced by 1.1.1 in storyboard templates not returning.
-
v1.1.1 Changes
- β Removed the last force-unwrap from storyboard templates.
Olivier Halligon
- β Removed the last force-unwrap from storyboard templates.