Swiftpack.co - Swift Packages by SwiftGen

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.

Packages published by SwiftGen

SwiftGen/SwiftGen 6.6.3
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!
⭐️ 9,095
🕓 7 weeks ago
🔖 Release Notes

Releases

The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
6.6.3
7 weeks ago
### Breaking Changes _None_ ### New Features * CLI: Added support for `--quiet` and `--verbose` flags to `swiftgen run`. [John Szumski](https://github.com/jszumski) [#1007](https://github.com/SwiftGen/SwiftGen/issues/1007) [#1008](https://github.com/SwiftGen/SwiftGen/pull/1008) ### Bug Fixes * Build: Fixed the `rake cli:install` command and with it the Homebrew formula. [Liquidsoul](https://github.com/liquidsoul) [#1030](https://github.com/SwiftGen/SwiftGen/issues/1030) [#1104](https://github.com/SwiftGen/SwiftGen/issues/1104) [#1105](https://github.com/SwiftGen/SwiftGen/pull/1105) ### Internal Changes _None_
6.6.2
1 year ago
### Changes in core dependencies of SwiftGen * [StencilSwiftKit 2.10.1](https://github.com/SwiftGen/StencilSwiftKit/blob/2.10.1/CHANGELOG.md) ### Bug Fixes * Strings: correctly handle translations containing `\t` (tabs) and other escape sequences. [David Jennes](https://github.com/djbe) [#985](https://github.com/SwiftGen/SwiftGen/issues/985) [#986](https://github.com/SwiftGen/SwiftGen/issues/986) [#988](https://github.com/SwiftGen/SwiftGen/pull/988) [#998](https://github.com/SwiftGen/SwiftGen/pull/998) * Strings: fix the Objective-C template. [David Jennes](https://github.com/djbe) [#990](https://github.com/SwiftGen/SwiftGen/issues/990) [#991](https://github.com/SwiftGen/SwiftGen/pull/991) ### Internal Changes * Strings: greatly improve the performance of the new comments parser. [David Jennes](https://github.com/djbe) [#987](https://github.com/SwiftGen/SwiftGen/issues/987) [#989](https://github.com/SwiftGen/SwiftGen/pull/989)
6.6.1
1 year ago
### Changes in core dependencies of SwiftGen * [Stencil 0.15.1](https://github.com/kylef/Stencil/blob/0.15.1/CHANGELOG.md) ### Bug Fixes * CLI: fixed `run parser` when no `params` or `options` are provided (broken in 6.6.0). [David Jennes](https://github.com/djbe) [#983](https://github.com/SwiftGen/SwiftGen/pull/983) * JSON/Plist/YAML: fixed code generation (broken in 6.6.0). [David Jennes](https://github.com/djbe) [#983](https://github.com/SwiftGen/SwiftGen/pull/983)
6.6.0
1 year ago
### Changes in core dependencies of SwiftGen * [StencilSwiftKit 2.10.0](https://github.com/SwiftGen/StencilSwiftKit/blob/2.10.0/CHANGELOG.md) * [Stencil 0.15.0](https://github.com/kylef/Stencil/blob/0.15.0/CHANGELOG.md) ### Breaking Changes * Strings: due to the bugfix for fallback translations, custom `lookupFunction`s will need to accept 3 arguments (table, key and value), up from 2 arguments (table and key). [David Jennes](https://github.com/djbe) [#964](https://github.com/SwiftGen/SwiftGen/pull/964) ### Deprecations * The Swift 4 templates are now deprecated. This means we will no longer test if the generated output is valid Swift code. We will still try to keep these up-to-date with context changes. [David Jennes](https://github.com/djbe) [#955](https://github.com/SwiftGen/SwiftGen/pull/955) * Our spacing & trimming "hack" is now considered deprecated, and in the next major version we'll switch to Stencil's new "smart" trimming behaviour (see [Stencil documentation](https://stencil.fuller.li/en/latest/templates.html#whitespace-control) for more information). Our built-in templates have already switched to this modern behaviour, you can try it with your own templates by using the `--experimental-modern-spacing` flag. [David Jennes](https://github.com/djbe) [#977](https://github.com/SwiftGen/SwiftGen/pull/977) * XCAssets: some old properties & parameters are being deprecated. Read the migration guides for more information. [David Jennes](https://github.com/djbe) [#978](https://github.com/SwiftGen/SwiftGen/pull/978) ### New Features * Added support for `--quiet/-q` flag, to suppress all logs (except errors). [Andre113](https://github.com/Andre113) [#823](https://github.com/SwiftGen/SwiftGen/issues/823) [#846](https://github.com/SwiftGen/SwiftGen/pull/846) * CoreData: ensure generated classes are `final` when model isn't abstract. [grsouza](https://github.com/grsouza) [#940](https://github.com/SwiftGen/SwiftGen/pull/940) * Added `.artifactbundle` release uploads to support SE-0325 Swift Plugins. [nicorichard](https://github.com/nicorichard) [#913](https://github.com/SwiftGen/SwiftGen/issues/913) [#926](https://github.com/SwiftGen/SwiftGen/pull/926) * Strings: added support for `.strings` files comments. The built-in templates will now use them for comments instead of the translation of a key. [CraigSiemens](https://github.com/CraigSiemens) [#563](https://github.com/SwiftGen/SwiftGen/issues/563) [#813](https://github.com/SwiftGen/SwiftGen/pull/813) * CoreData: support derived attributes. [David Jennes](https://github.com/djbe) [#928](https://github.com/SwiftGen/SwiftGen/issues/928) [#961](https://github.com/SwiftGen/SwiftGen/pull/961) * Added an experimental flag `--experimental-modern-spacing` to enable modern spacing control, see [Stencil documentation](https://stencil.fuller.li/en/latest/templates.html#whitespace-control) for more information. It will disable our own trimming "hack", and enable Stencil's "smart" trimming. [David Jennes](https://github.com/djbe) [#977](https://github.com/SwiftGen/SwiftGen/pull/977) * XCAssets & Fonts: added support for SwiftUI. You can now easily access colors images, symbols and custom fonts from your SwiftUI code. [David Jennes](https://github.com/djbe) [#979](https://github.com/SwiftGen/SwiftGen/pull/979) ### Bug Fixes * CoreData: ensure fetched properties use the right class name. [David Jennes](https://github.com/djbe) [#936](https://github.com/SwiftGen/SwiftGen/issues/936) [#960](https://github.com/SwiftGen/SwiftGen/pull/960) * CoreData: now correctly generate code for `OptionSet` attributes by setting the "User Info" key `nonOptionalInit` to true. [David Jennes](https://github.com/djbe) [#727](https://github.com/SwiftGen/SwiftGen/issues/727) [#965](https://github.com/SwiftGen/SwiftGen/pull/965) * Fonts: fix file-type check in sandboxed environments. [David Jennes](https://github.com/djbe) [#952](https://github.com/SwiftGen/SwiftGen/issues/952) [#967](https://github.com/SwiftGen/SwiftGen/pull/967) * Fixed Stencil tags that can refer to other templates, such as the `include` tag. [David Jennes](https://github.com/djbe) [#950](https://github.com/SwiftGen/SwiftGen/issues/950) [#959](https://github.com/SwiftGen/SwiftGen/pull/959) * Strings: now correctly provides the default translation as fallback. [David Jennes](https://github.com/djbe) [#381](https://github.com/SwiftGen/SwiftGen/issues/381) [#937](https://github.com/SwiftGen/SwiftGen/issues/937) [#964](https://github.com/SwiftGen/SwiftGen/pull/964) ### Internal Changes * Updated GitHub Actions to use macOS 12. [David Jennes](https://github.com/djbe) [#956](https://github.com/SwiftGen/SwiftGen/pull/956) * Update dependencies such as SwiftLint (and enable some extra rules). [David Jennes](https://github.com/djbe) [#968](https://github.com/SwiftGen/SwiftGen/pull/968) [#970](https://github.com/SwiftGen/SwiftGen/pull/970) * Implement automatic publication using GitHub Actions. [David Jennes](https://github.com/djbe) [#969](https://github.com/SwiftGen/SwiftGen/pull/969) * Switched from [Commander](https://github.com/kylef/Commander) to Swift's own [ArgumentParser](https://github.com/apple/swift-argument-parser) library. [David Jennes](https://github.com/djbe) [#966](https://github.com/SwiftGen/SwiftGen/pull/966) * Updated to Stencil 0.15 and StencilSwiftKit 2.10. [David Jennes](https://github.com/djbe) [#977](https://github.com/SwiftGen/SwiftGen/pull/977) * Added `Difference` library for easier testing of context differences. [David Jennes](https://github.com/djbe) [#981](https://github.com/SwiftGen/SwiftGen/pull/981)
6.5.1
2 years ago
### Bug Fixes * Workaround for Mint that does not yet support the SPM resource bundle. [@tid-kijyun](https://github.com/tid-kijyun) [#883](https://github.com/SwiftGen/SwiftGen/issues/883) [#885](https://github.com/SwiftGen/SwiftGen/pull/885) ### Internal Changes * Tweak release script to handle both universal & slim builds. [David Jennes](https://github.com/djbe) [#884](https://github.com/SwiftGen/SwiftGen/pull/884)
6.5.0
2 years ago
### Changes in core dependencies of SwiftGen * [StencilSwiftKit 2.8.0](https://github.com/SwiftGen/StencilSwiftKit/blob/2.8.0/CHANGELOG.md) * [Stencil 0.14.1](https://github.com/kylef/Stencil/blob/0.14.1/CHANGELOG.md) ### New Features * XCAssets: the parser now supports Symbol sets, so you can safely use custom symbols. [David Jennes](https://github.com/djbe) [#788](https://github.com/SwiftGen/SwiftGen/pull/788) * XCAssets: you can now provide a trait collection when initializing a color or image asset (on iOS/tvOS). [David Jennes](https://github.com/djbe) [#790](https://github.com/SwiftGen/SwiftGen/pull/790) * Files: Add new parser for accessing loose files in your project. [Mike Gray](https://github.com/mgray88) [David Jennes](https://github.com/djbe) [#665](https://github.com/SwiftGen/SwiftGen/issues/665) [#734](https://github.com/SwiftGen/SwiftGen/pull/734) * Colors: The XML parser now supports Android color aliases (using `@color/...`). [David Jennes](https://github.com/djbe) [#562](https://github.com/SwiftGen/SwiftGen/issues/562) [#797](https://github.com/SwiftGen/SwiftGen/pull/797) * Support M1 and Intel devices (universal binary). [David Jennes](https://github.com/djbe) [#805](https://github.com/SwiftGen/SwiftGen/issues/805) [#880](https://github.com/SwiftGen/SwiftGen/pull/880) ### Bug Fixes * XCAssets: fixed some availability annotations that were incorrect. [David Jennes](https://github.com/djbe) [#789](https://github.com/SwiftGen/SwiftGen/pull/789) * Strings: `objc-h` template now emits valid documentation comments. [@szotp](https://github.com/szotp) [#822](https://github.com/SwiftGen/SwiftGen/pull/822) * Generate `xcfilelist`: Adds the template file path to the inputs `xcfilelist` (for custom templates). [Craig Siemens](https://github.com/CraigSiemens) [#815](https://github.com/SwiftGen/SwiftGen/pull/815) * Strings: built-in templates now have better handling of multi-line translations. [@mrackwitz](https://github.com/mrackwitz) [#774](https://github.com/SwiftGen/SwiftGen/pull/774) ### Internal Changes * Switch to GitHub Actions. [#794](https://github.com/SwiftGen/SwiftGen/pull/794) [David Jennes](https://github.com/djbe) * Switched the whole project over to use Swift Package Manager, restructuring some of the internals in the process. [David Jennes](https://github.com/djbe) [#793](https://github.com/SwiftGen/SwiftGen/pull/793) * Updated dependencies and gems, particularyly PathKit to support Xcode 13. [David Jennes](https://github.com/djbe) [Jared Sorge](https://github.com/jsorge) [#827](https://github.com/SwiftGen/SwiftGen/pull/827) [#874](https://github.com/SwiftGen/SwiftGen/pull/874) [#879](https://github.com/SwiftGen/SwiftGen/pull/879)
6.4.0
3 years ago
### New Features * The built-in templates will now correctly handle Swift Package Manager resources, using `Bundle.module` if it's available. As before, you can override the used `Bundle` using the `bundle` or `lookupFunction` template parameters. [Arnaud Dorgans](https://github.com/arnauddorgans) [#763](https://github.com/SwiftGen/SwiftGen/pull/763) * Added `config generate-xcfilelist` subcommand to generate input and output `xcfilelist`s based on your configuration file. These files should then be used in an Xcode build step that executes `swiftgen config run`. Don't forget to regenerate the file lists after adding/removing resources in your project in a way that might impact them. [@CraigSiemens](https://github.com/CraigSiemens) [#441](https://github.com/SwiftGen/SwiftGen/issues/441) * Colors: the XML parser now accepts a `colorFormat` option, used to change the color format. The default format is `rgba`. [@kevinstier](https://github.com/kevinstier) [#562](https://github.com/SwiftGen/SwiftGen/issues/562) [#768](https://github.com/SwiftGen/SwiftGen/pull/768) * IB: Added support for instantiating scenes while providing a `creator` block, commonly used for dependency injection. This feature is available in generated code starting from iOS 13, tvOS 13 and macOS 10.15. [@matsune](https://github.com/matsune) [David Jennes](https://github.com/djbe) [#778](https://github.com/SwiftGen/SwiftGen/pull/778) ### Bug Fixes * Plist: Update the parsing strategy (using `Codable`) to fix parsing of `Bool` values as `Integer` in some cases. [@fortmarek](https://github.com/fortmarek) [Olivier Halligon](https://github.com/AliSoftware) [#779](https://github.com/SwiftGen/SwiftGen/pull/779) * JSON/Plist/YAML: fixed issue with `inline` templates which incorrectly generated `1`/`0` as values, instead of `true`/`false` as expected. [David Jennes](https://github.com/djbe) [#779](https://github.com/SwiftGen/SwiftGen/pull/779) [#783](https://github.com/SwiftGen/SwiftGen/pull/783) * JSON: the parser now correctly recognizes `0` and `1` as `Int` (instead of `Bool`). [David Jennes](https://github.com/djbe) [#786](https://github.com/SwiftGen/SwiftGen/pull/786) ### Internal Changes * Update the Swift version in `.swift-version` so that the right version is used when building manually (using `swiftenv`). [@cfiken](https://github.com/cfiken) [#764](https://github.com/SwiftGen/SwiftGen/issues/764) * Update Yams from `3.0.0` to `4.0.0`. [@hungrxyz](https://github.com/hungrxyz) [#772](https://github.com/SwiftGen/SwiftGen/issues/772) * Updated Pods and Gems dependencies, and Xcode 12. [David Jennes](https://github.com/djbe) [#782](https://github.com/SwiftGen/SwiftGen/pull/782)
6.3.0
3 years ago
### Deprecations * Fonts: the generated `Font` typealias (to `UIFont`/`NSFont`) is deprecated and will be removed in the next major release. [David Jennes](https://github.com/djbe) [#728](https://github.com/SwiftGen/SwiftGen/pull/728) ### New Features * Strings: support for plurals declared in `.stringsdict` files. [Florian Fittschen](https://github.com/ffittschen) [#184](https://github.com/SwiftGen/SwiftGen/issues/184) [#634](https://github.com/SwiftGen/SwiftGen/pull/634) * Fonts: the templates now support a new `fontTypeName` template parameter that you can use to change the name of the `struct` representing a font to something else. [David Jennes](https://github.com/djbe) [#728](https://github.com/SwiftGen/SwiftGen/pull/728) * Fonts: the templates now support a new `fontAliasName` that you can use to change the `typealias`'s name from `Font` to something else. For example: this is useful when working with SwiftUI which already defines a `Font` type. Note that as this `typealias` is deprecated (see deprecations above), this template parameter will also be removed in the next major release. [David Jennes](https://github.com/djbe) [#647](https://github.com/SwiftGen/SwiftGen/issues/647) [#728](https://github.com/SwiftGen/SwiftGen/pull/728) * CoreData: Deprecates `fetchRequest()` and adds `makeFetchRequest()` to avoid ambiguous function usage. [David Rothera](https://github.com/davidrothera) [#726](https://github.com/SwiftGen/SwiftGen/pull/726) * XCAssets: image assets now load faster on macOS if they're in the `main` bundle. MacOS only provides a caching mechanism for images in the `main` bundle, for other cases you may need to provide your own caching mechanism as needed. [David Jennes](https://github.com/djbe) [#648](https://github.com/SwiftGen/SwiftGen/issues/648) [#733](https://github.com/SwiftGen/SwiftGen/pull/733) * Fonts/IB/JSON/Plist/Strings/XCAssets: all templates that load data at runtime from a bundle now support a `bundle` template parameter, which you can use to override the bundle from which resources are loaded. Check out the [template specific documentation](Documentation/templates/) for more information. For an in-depth explanation, also check the [customize loading of resources](Documentation/Articles/Customize-loading-of-resources.md) article. [David Jennes](https://github.com/djbe) [#737](https://github.com/SwiftGen/SwiftGen/pull/737) * Fonts/IB/JSON/Plist: Similar to the `strings` templates, these templates now support a `lookupFunction` template parameter, which allows you to provide your own resource lookup mechanism at runtime. Check the [template specific documentation](Documentation/templates/) for more information. For an in-depth explanation, also check the [customize loading of resources](Documentation/Articles/Customize-loading-of-resources.md) article. [David Jennes](https://github.com/djbe) [#738](https://github.com/SwiftGen/SwiftGen/pull/738) ### Bug Fixes * Strings: fix incorrect interpretation of format placeholders when there were missing positional parameters (e.g. `"%2$@"` without a `%1$…` defined). [@AliSoftware](https://github.com/AliSoftware) [#634](https://github.com/SwiftGen/SwiftGen/pull/634)
6.2.1
3 years ago
There are no major changes in this release, although JSON & Plist template writers may want to read the [small migration guide](Documentation/SwiftGenKit%20Contexts/MigrationGuide.md##swiftgen-621-migration-guide) to prepare for upcoming context changes. ### Deprecations * JSON & Plist: if you wrote your own templates, know that the `documents` property of a file has been deprecated in favour of `document`. The old `documents` property will be removed in the next major release. [David Jennes](https://github.com/djbe) [#702](https://github.com/SwiftGen/SwiftGen/pull/702) [#732](https://github.com/SwiftGen/SwiftGen/pull/732) ### Bug Fixes * Prevent generating `default.profraw` (code coverage) files. [David Jennes](https://github.com/djbe) [#722](https://github.com/SwiftGen/SwiftGen/pull/722) * JSON/Plist/YAML: Fix issue with homogeneous `Array`s in the Inline templates (such as `[String`]). [#687](https://github.com/SwiftGen/SwiftGen/pull/687) [@fjtrujy](https://github.com/fjtrujy) * Avoid breaking the system swift installation when installing SwiftGen via Homebrew on macOS 10.14.4 or higher. [David Jennes](https://github.com/djbe) [#686](https://github.com/SwiftGen/SwiftGen/issue/686) [#730](https://github.com/SwiftGen/SwiftGen/pull/730) ### Internal Changes * Parsers are now executed in parallel, making SwiftGen faster when multiple parsers are used. Note: only applies when using a configuration file. [Marcelo Fabri](https://github.com/marcelofabri) [#699](https://github.com/SwiftGen/SwiftGen/issues/699) * Use `JSONSerialization` instead of `Yams` for parsing JSONs, making the `json` parser faster. [Marcelo Fabri](https://github.com/marcelofabri) [#698](https://github.com/SwiftGen/SwiftGen/issues/698) * JSON/Plist/YAML: Lazily evaluate `metadata` of documents, making SwiftGen faster if the `metadata` field is never used in a template. [Marcelo Fabri](https://github.com/marcelofabri) [#700](https://github.com/SwiftGen/SwiftGen/issues/700)
6.2.0
3 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](https://github.com/djbe) [#601](https://github.com/SwiftGen/SwiftGen/pull/601) [#691](https://github.com/SwiftGen/SwiftGen/pull/691) ### Deprecations * XCAssets: the `colorAliasName` and `imageAliasName` template parameters are now deprecated and will be removed in the next major release. [David Jennes](https://github.com/djbe) [#614](https://github.com/SwiftGen/SwiftGen/pull/614) * The use of `swiftgen <parser>` (e.g. `swiftgen strings`, `swiftgen xcassets`, …) command line for running individual parsers is now deprecated in favor of `swiftgen run <parser>`. See "New Features" below. [@AliSoftware](https://github.com/AliSoftware) [#705](https://github.com/SwiftGen/SwiftGen/pull/705) * The subcommand `swiftgen templates` has been renamed `swiftgen template` (singular); the plural form of the command has been deprecated and will be removed in next major version. [@AliSoftware](https://github.com/AliSoftware) [#697](https://github.com/SwiftGen/SwiftGen/pull/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. Use `templatePath` to reference custom templates by path instead. [@AliSoftware](https://github.com/AliSoftware) [#717](https://github.com/SwiftGen/SwiftGen/pull/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 use `swiftgen run <parser>` for things like quick iterations when writing your own custom templates. [@AliSoftware](https://github.com/AliSoftware) [#705](https://github.com/SwiftGen/SwiftGen/pull/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)_. [@AliSoftware](https://github.com/AliSoftware) [#694](https://github.com/SwiftGen/SwiftGen/pull/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. [@AliSoftware](https://github.com/AliSoftware) [#697](https://github.com/SwiftGen/SwiftGen/pull/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](https://github.com/djbe) [#587](https://github.com/SwiftGen/SwiftGen/pull/587) [#597](https://github.com/SwiftGen/SwiftGen/pull/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](https://github.com/djbe) [#576](https://github.com/SwiftGen/SwiftGen/issues/576) [#588](https://github.com/SwiftGen/SwiftGen/pull/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](https://github.com/djbe) [#591](https://github.com/SwiftGen/SwiftGen/issues/591) [#592](https://github.com/SwiftGen/SwiftGen/pull/592) * Core Data: the built-in templates now support `RawRepresentable` attributes (such as `enum`, `OptionSet`, …). They'll check the "User Info" of an attribute for a `RawType` key, which should be set to the type name you want to use for that attribute. To avoid optional attributes, you can also add the `unwrapOptional` user info key. For more information, check the [template's documentation](Documentation/templates/coredata/swift4.md#userinfo-keys). [David Jennes](https://github.com/djbe) [#566](https://github.com/SwiftGen/SwiftGen/issues/566) [#609](https://github.com/SwiftGen/SwiftGen/issues/609) [#593](https://github.com/SwiftGen/SwiftGen/pull/593) [#610](https://github.com/SwiftGen/SwiftGen/pull/610) * Strings: the built-in templates now accept a parameter `lookupFunction` for customizing the localization function, check the [template documentation](Documentation/templates/string/) for more information. [Steven Magdy](https://github.com/StevenMagdy) [426](https://github.com/SwiftGen/SwiftGen/issues/426) [468](https://github.com/SwiftGen/SwiftGen/issues/468) [573](https://github.com/SwiftGen/SwiftGen/pull/573) [716](https://github.com/SwiftGen/SwiftGen/pull/716) * Strings: templates to generate Objective-C. Please check [the template's documentation](Documentation/templates/string/objc.md) for more information. [Eric Slosser](https://github.com/Mr-Fixit) [SwiftGen/SwiftGen#378](https://github.com/SwiftGen/SwiftGen/pull/378) * XCAssets: the parser now supports AR Resource Groups, together with reference images and objects. [David Jennes](https://github.com/djbe) [#614](https://github.com/SwiftGen/SwiftGen/pull/614) * Templates: Bundle now use static property on BundleToken for better performance. [shuoli84](https://github.com/shuoli84) [#623](https://github.com/SwiftGen/SwiftGen/issues/623) * All parsers now have built-in Swift 5 templates. [David Jennes](https://github.com/djbe) [#595](https://github.com/SwiftGen/SwiftGen/issues/595) [#600](https://github.com/SwiftGen/SwiftGen/pull/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](https://github.com/viktorasl) [#669](https://github.com/SwiftGen/SwiftGen/issues/669) [@AliSoftware](https://github.com/AliSoftware) [#693](https://github.com/SwiftGen/SwiftGen/pull/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. [@AliSoftware](https://github.com/AliSoftware) [#706](https://github.com/SwiftGen/SwiftGen/pull/706) * XCAssets: improved the performance for color assets by caching the resolved colors. [David Jennes](https://github.com/djbe) [#578](https://github.com/SwiftGen/SwiftGen/issues/578) [#589](https://github.com/SwiftGen/SwiftGen/pull/589) * Core Data: `entityName` is now correctly a `class var` instead of a `class func`. [David Jennes](https://github.com/djbe) [#590](https://github.com/SwiftGen/SwiftGen/pull/590) * Strings: we now correctly generate the type `Any` (instead of `String`) for `%@` placeholders. [David Jennes](https://github.com/djbe) [620](https://github.com/SwiftGen/SwiftGen/issues/620) * Colors: Reduce initializer type inference for improved compilation performance. [Markus Faßbender](https://github.com/dermaaarkus) [#663](https://github.com/SwiftGen/SwiftGen/issues/663) * Config Lint: fix config lint not processing relative paths containing ".." correctly. [Wolfgang Lutz](https://github.com/Lutzifer) [#688](https://github.com/SwiftGen/SwiftGen/issues/688) * Core Data: the generated code was missing `,` (comma) for fetch requests with multiple arguments. [David Jennes](https://github.com/djbe) [#692](https://github.com/SwiftGen/SwiftGen/pull/692) * Colors: Fix compile time warning when long expression type checking is enabled. [Ryan Mason-Davies](https://github.com/iotize) [#704](https://github.com/SwiftGen/SwiftGen/issues/704) [#710](https://github.com/SwiftGen/SwiftGen/pull/710) ### Internal Changes * The main branch of the repository has been renamed from `master` to `stable`. If you pointed your `Podfile` or dependency managment tool to `master` instead of an official release/tag, you will have to update the branch name in your dependency file. [@AliSoftware](https://github.com/AliSoftware) [#714](https://github.com/SwiftGen/SwiftGen/pull/714) * Documentation: Improved doc for creating custom templates, and added a Documentation Table of Contents. [@AliSoftware](https://github.com/AliSoftware) [#713](https://github.com/SwiftGen/SwiftGen/pull/713) * Refactoring: Reduce globals & rearrange CLI code. [@AliSoftware](https://github.com/AliSoftware) [#586](https://github.com/SwiftGen/SwiftGen/pull/586) * Moved generated test output files into subdirectories per template. [David Jennes](https://github.com/djbe) [#598](https://github.com/SwiftGen/SwiftGen/pull/598) * Compile generated output using configuration files for easier management. [David Jennes](https://github.com/djbe) [#365](https://github.com/SwiftGen/SwiftGen/issues/365) [#599](https://github.com/SwiftGen/SwiftGen/pull/599) * XCAssets: renamed the catalogs we use for sample code & testing to avoid some confusion. [David Jennes](https://github.com/djbe) [#613](https://github.com/SwiftGen/SwiftGen/pull/613) * Update SwiftLint and enable some extra SwiftLint rules. [David Jennes](https://github.com/djbe) [#617](https://github.com/SwiftGen/SwiftGen/pull/617) * Some CI fixes related to software versions. [Patrick Nollet](https://github.com/PatrickNLT) [#645](https://github.com/SwiftGen/SwiftGen/pull/645) * Updated to CocoaPods 1.9.0. [David Jennes](https://github.com/djbe) [#619](https://github.com/SwiftGen/SwiftGen/pull/619) * Updated Pods and Gems dependencies. [David Jennes](https://github.com/djbe) [#684](https://github.com/SwiftGen/SwiftGen/pull/684)
macOS
SwiftGen/StencilSwiftKit 2.10.1
A framework bringing additional nodes & filters to Stencil dedicated to Swift code generation
⭐️ 285
🕓 1 year ago
🔖 Release Notes

Releases

The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
2.10.1
1 year ago
### Internal Changes * Pin `Komondor` to 1.1.3, to avoid issues with SPM for other packages depending on this package. [redryerye](https://github.com/redryerye) [#162](https://github.com/SwiftGen/StencilSwiftKit/pull/162)
2.10.0
1 year ago
### Breaking Changes * With the Stencil update, we're deprecating our `StencilSwiftTemplate` template class which contained a workaround that's no longer needed. It will also no longer be set by default by the `stencilSwiftEnvironment` builder. [David Jennes](https://github.com/djbe) [#159](https://github.com/SwiftGen/StencilSwiftKit/pull/159) * With the Stencil update, we're deprecating our `removeNewlines` filter, as this can now be achieved by the built-in Stencil syntax. [David Jennes](https://github.com/djbe) [#159](https://github.com/SwiftGen/StencilSwiftKit/pull/159) ### New Features * Updated to Stencil 0.15.0, which contains many improvements, chief amongst them is whitespace behaviour control. [David Jennes](https://github.com/djbe) [#159](https://github.com/SwiftGen/StencilSwiftKit/pull/159) * Added an `import` tag for reusing macro's in multiple templates from a common imported file. [David Jennes](https://github.com/djbe) [#111](https://github.com/SwiftGen/StencilSwiftKit/pull/111) * The `swiftIdentifier` now supports a `valid` mode, where it will do the bare minimum to get a valid identifier. I.e. it will not change the case of characters at all (compared to `normal` mode). [David Jennes](https://github.com/djbe) [#160](https://github.com/SwiftGen/StencilSwiftKit/pull/160) ### Internal Changes * Add `Danger` to check pull requests. [David Jennes](https://github.com/djbe) [#158](https://github.com/SwiftGen/StencilSwiftKit/pull/158)
2.9.0
1 year ago
### New Features * `stencilSwiftEnvironment` now accepts a list of paths (for the template loader) & extensions. [David Jennes](https://github.com/djbe) [#154](https://github.com/SwiftGen/StencilSwiftKit/pull/154) [#156](https://github.com/SwiftGen/StencilSwiftKit/pull/156) * The string filter `replace` can now accept an optional parameter `regex` to enable regular expressions, see the [documentation](Documentation/filters-strings.md) for more information. [David Jennes](https://github.com/djbe) [JanGorman](https://github.com/JanGorman) [#123](https://github.com/SwiftGen/StencilSwiftKit/pull/123) [#155](https://github.com/SwiftGen/StencilSwiftKit/pull/155) ### Internal Changes * Update to SwiftLint 0.47.1 and enable some extra SwiftLint rules. [David Jennes](https://github.com/djbe) [#140](https://github.com/SwiftGen/StencilSwiftKit/pull/140) [#153](https://github.com/SwiftGen/StencilSwiftKit/pull/153)
2.8.0
3 years ago
### New Features * Added support for Swift 5. [David Jennes](https://github.com/djbe) [@fortmarek](https://github.com/fortmarek) [#119](https://github.com/SwiftGen/StencilSwiftKit/pull/119) [#122](https://github.com/SwiftGen/StencilSwiftKit/pull/122) [#125](https://github.com/SwiftGen/StencilSwiftKit/pull/125) [#127](https://github.com/SwiftGen/StencilSwiftKit/pull/127) * Updated Stencil to the latest version (0.14). [@fortmarek](https://github.com/fortmarek) [#127](https://github.com/SwiftGen/StencilSwiftKit/pull/127) ### Bug Fixes * Fix crash with the `lowerFirstWord` filter when running on empty strings. [@fortmarek](https://github.com/fortmarek) [#127](https://github.com/SwiftGen/StencilSwiftKit/pull/127) ### Internal Changes * Update to SwiftLint 0.42.0 and enable some extra SwiftLint rules. [David Jennes](https://github.com/djbe) [@fortmarek](https://github.com/fortmarek) [#116](https://github.com/SwiftGen/StencilSwiftKit/pull/116) [#127](https://github.com/SwiftGen/StencilSwiftKit/pull/127) [#137](https://github.com/SwiftGen/StencilSwiftKit/pull/137) * Switch from CircleCI to GitHub Actions. [David Jennes](https://github.com/djbe) [#128](https://github.com/SwiftGen/StencilSwiftKit/pull/128) * Dropped support for Swift 4.2. [David Jennes](https://github.com/djbe) [#132](https://github.com/SwiftGen/StencilSwiftKit/pull/132) * Switched the whole project over to use Swift Package Manager, restructuring some of the internals in the process. [David Jennes](https://github.com/djbe) [#130](https://github.com/SwiftGen/StencilSwiftKit/pull/130) * Made the filter implementations public, so they can be used in other libraries. [David Jennes](https://github.com/djbe) [#136](https://github.com/SwiftGen/StencilSwiftKit/pull/136)
2.7.2
5 years ago
### Bug Fixes * `Parameters`: ensure the `flatten` function correctly handles a flag with a `false` value. [David Jennes](https://github.com/djbe) [#108](https://github.com/SwiftGen/StencilSwiftKit/pull/108) ### Internal Changes * Update to SwiftLint 0.30.1 and enable some extra SwiftLint rules. [David Jennes](https://github.com/djbe) [#112](https://github.com/SwiftGen/StencilSwiftKit/pull/112) [#114](https://github.com/SwiftGen/StencilSwiftKit/pull/114)
2.7.1
5 years ago
### Bug Fixes * `swiftIdentifier`: fix crash on empty string. [David Jennes](https://github.com/djbe) [#105](https://github.com/SwiftGen/StencilSwiftKit/pull/105)
2.7.0
5 years ago
### New Features * Updated Stencil to the latest version (0.13). [David Jennes](https://github.com/djbe) [#103](https://github.com/SwiftGen/StencilSwiftKit/pull/103) ### Internal Changes * Improved the documentation of string filters a bit for a better overview of the inputs & outputs. [David Jennes](https://github.com/djbe) [#102](https://github.com/AliSoftware/SwiftGen/pull/102) * Updated to latest Xcode (10.0). [David Jennes](https://github.com/djbe) [#103](https://github.com/SwiftGen/StencilSwiftKit/pull/103)
2.6.0
5 years ago
### Bug fixes * Fixed using filter expression in call node. [Ilya Puchka](https://github.com/ilyapuchka) [#85](https://github.com/SwiftGen/StencilSwiftKit/pull/85) * Fixed compilation issue with Xcode 10 & Swift 4.2 by adding hints to help the compiler. [Olivier Halligon](https://github.com/AliSoftware) [#93](https://github.com/SwiftGen/StencilSwiftKit/pull/93) * Migrated to PathKit for url filters. The dirname will return '.' for a filename without base directory. [Rahul Katariya](https://github.com/RahulKatariya) [Philip Jander](https://github.com/janderit) [#94](https://github.com/SwiftGen/StencilSwiftKit/pull/94) ### New Features * The `set` tag can now directly accept an expression as value, see the [documentation](https://github.com/SwiftGen/StencilSwiftKit/blob/master/Documentation/tag-set.md) for an explanation on how this differs with the normal `set`/`endset` pair. [David Jennes](https://github.com/djbe) [#247](https://github.com/AliSoftware/SwiftGen/pull/247) * Updated Stencil to the latest version (0.12.1). [David Jennes](https://github.com/djbe) [#95](https://github.com/SwiftGen/StencilSwiftKit/pull/95) [#99](https://github.com/SwiftGen/StencilSwiftKit/pull/99) ### Internal Changes * Updated to latest Xcode (9.3.0). [David Jennes](https://github.com/djbe) [#86](https://github.com/SwiftGen/StencilSwiftKit/pull/86) * Update to SwiftLint 0.27 and enable some extra SwiftLint rules. [David Jennes](https://github.com/djbe) [#96](https://github.com/SwiftGen/StencilSwiftKit/pull/96) * Test Linux SPM support in CI. [David Jennes](https://github.com/janderit) [#90](https://github.com/SwiftGen/StencilSwiftKit/pull/90)
2.5.0
5 years ago
### New Features * Updated Stencil to the latest version (0.11.0). [David Jennes](https://github.com/djbe) [#83](https://github.com/SwiftGen/StencilSwiftKit/pull/83) ### Internal Changes * Switched to using SwiftLint via CocoaPods instead of our own install scripts. [David Jennes](https://github.com/djbe) [#78](https://github.com/SwiftGen/StencilSwiftKit/pull/78) * Enabled some extra SwiftLint rules for better code consistency. [David Jennes](https://github.com/djbe) [#79](https://github.com/SwiftGen/StencilSwiftKit/pull/79) * Migrated to CircleCI 2.0. [David Jennes](https://github.com/djbe) [#81](https://github.com/SwiftGen/StencilSwiftKit/pull/81) * Migrated to Swift 4, and dropped support for Swift 3. [David Jennes](https://github.com/djbe) [#80](https://github.com/SwiftGen/StencilSwiftKit/pull/80)
2.4.0
6 years ago
### New Features * Add `!` counterpart for strings boolean filters. [Antondomashnev](https://github.com/antondomashnev) [#68](https://github.com/SwiftGen/StencilSwiftKit/pull/68) * Updated Stencil to the latest version (0.10.1). [Ilya Puchka](https://github.com/ilyapuchka) [#73](https://github.com/SwiftGen/StencilSwiftKit/pull/73)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics