Skip to content

Commit b34e66f

Browse files
authored
Merge pull request SwiftGen#546 from SwiftGen/release/6.0.2
Release/6.0.2
2 parents a282336 + 0edff5a commit b34e66f

File tree

52 files changed

+507
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+507
-235
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
* [ ] I've started my branch from the `develop` branch (gitflow)
2-
* [ ] I've added an entry in the `CHANGELOG.md` file to explain my changes and credit myself
2+
* [ ] I've added an entry in the `CHANGELOG.md` file to explain my changes and credit myself
3+
_(or added `#trivial` to the PR title if I think it doesn't warrant a mention in the CHANGELOG)_
34
* [ ] Add the entry in the appropriate section (Bug Fix / New Feature / Breaking Change / Internal Change)
45
* [ ] Add a period and 2 spaces at the end of your short entry description
56
* [ ] Add links to your GitHub profile to credit yourself and to the related PR and issue after your description

CHANGELOG.md

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
---
44

5+
## 6.0.2
6+
7+
### Changes in other SwiftGen modules
8+
9+
* [StencilSwiftKit 2.7.1](https://github.com/SwiftGen/StencilSwiftKit/blob/2.7.1/CHANGELOG.md)
10+
* [Stencil 0.13.1](https://github.com/kylef/Stencil/blob/0.13.1/CHANGELOG.md)
11+
12+
### Bug Fixes
13+
14+
* Strings: rolled back the changes in #503, to ensure `%%` is correctly unescaped.
15+
[David Jennes](https://github.com/djbe)
16+
[#542](https://github.com/SwiftGen/SwiftGen/pull/542)
17+
* Strings: generate the correct types for `%c` and `%p`.
18+
[David Jennes](https://github.com/djbe)
19+
[#543](https://github.com/SwiftGen/SwiftGen/pull/543)
20+
* SPM/Mint: SwiftGen now provides correct version information, instead of "0.0".
21+
[David Jennes](https://github.com/djbe)
22+
[#544](https://github.com/SwiftGen/SwiftGen/pull/544)
23+
524
## 6.0.1
625

726
### Changes in other SwiftGen modules
@@ -22,15 +41,17 @@
2241
* SPM/Mint: Update the Stencil version to 0.13.1.
2342
[David Jennes](https://github.com/djbe)
2443
[#527](https://github.com/SwiftGen/SwiftGen/pull/527)
25-
* Ensure the `templates` subcommand properly works with the deprecated `storyboards` subcommand.
44+
* Ensure the `templates` subcommand properly works with the deprecated `storyboards` subcommand.
2645
[David Jennes](https://github.com/djbe)
27-
[#529](https://github.com/SwiftGen/SwiftGen/pull/529)
46+
[#525](https://github.com/SwiftGen/SwiftGen/issues/525)
47+
[#530](https://github.com/SwiftGen/SwiftGen/pull/530)
2848
* Ensure configuration file errors show as red in Xcode.
2949
[Olivier Halligon](https://github.com/AliSoftware)
30-
[#533](https://github.com/SwiftGen/SwiftGen/pull/533)
3150
[#516](https://github.com/SwiftGen/SwiftGen/issues/516)
51+
[#533](https://github.com/SwiftGen/SwiftGen/pull/533)
3252
* Strings: Ensure the parser correctly handles keys ending with a `.` and empty key components.
3353
[David Jennes](https://github.com/djbe)
54+
[#528](https://github.com/SwiftGen/SwiftGen/issues/528)
3455
[#531](https://github.com/SwiftGen/SwiftGen/pull/531)
3556

3657
### Internal Changes
@@ -163,20 +184,20 @@ Read the [SwiftGen 6.0 Migration Guide](Documentation/MigrationGuide.md#swiftgen
163184
[#402](https://github.com/SwiftGen/SwiftGen/pull/402)
164185
[#476](https://github.com/SwiftGen/SwiftGen/pull/476)
165186
* Updated to latest Xcode (10.0.0) and Swift 4.2.
166-
[David Jennes](https://github.com/djbe)
187+
[David Jennes](https://github.com/djbe)
167188
[#415](https://github.com/SwiftGen/SwiftGen/pull/415)
168189
[#498](https://github.com/SwiftGen/SwiftGen/pull/498)
169190
* Update to Stencil 0.13.0, and use some of it's new filters in our templates.
170-
[David Jennes](https://github.com/djbe)
191+
[David Jennes](https://github.com/djbe)
171192
[#416](https://github.com/SwiftGen/SwiftGen/pull/416)
172193
[#475](https://github.com/SwiftGen/SwiftGen/pull/475)
173194
[#498](https://github.com/SwiftGen/SwiftGen/pull/498)
174195
* Store testing contexts as YAML files instead of PLISTs.
175-
[David Jennes](https://github.com/djbe)
196+
[David Jennes](https://github.com/djbe)
176197
[#418](https://github.com/SwiftGen/SwiftGen/pull/418)
177198
[#461](https://github.com/SwiftGen/SwiftGen/pull/461)
178199
* Refactor the parsers as they're getting more complex.
179-
[David Jennes](https://github.com/djbe)
200+
[David Jennes](https://github.com/djbe)
180201
[#417](https://github.com/SwiftGen/SwiftGen/pull/417)
181202
[#422](https://github.com/SwiftGen/SwiftGen/pull/422)
182203
* Disabled a SwiftLint rule for function parameter count.
@@ -232,7 +253,7 @@ Read the [SwiftGen 6.0 Migration Guide](Documentation/MigrationGuide.md#swiftgen
232253

233254
### Changes in other SwiftGen modules
234255

235-
* [SwiftGenKit 2.1.1](https://github.com/SwiftGen/SwiftGenKit/blob/2.1.1/CHANGELOG.md)
256+
* [SwiftGenKit 2.1.1](https://github.com/SwiftGen/SwiftGenKit/blob/2.1.1/CHANGELOG.md)
236257
* [StencilSwiftKit 2.3.0](https://github.com/SwiftGen/StencilSwiftKit/blob/2.3.0/CHANGELOG.md)
237258
* [templates 2.2.0](https://github.com/SwiftGen/templates/blob/2.2.0/CHANGELOG.md)
238259

@@ -501,7 +522,7 @@ Note: The next minor version will focus on bringing more documentation for all t
501522
which offers the same functionality.
502523
[David Jennes](https://github.com/djbe)
503524
[#243](https://github.com/SwiftGen/SwiftGen/pull/243)
504-
* Support multiple input paths for some commands:
525+
* Support multiple input paths for some commands.
505526
[David Jennes](https://github.com/djbe)
506527
[#213](https://github.com/SwiftGen/SwiftGen/pull/213)
507528
* `fonts` accepts multiple input directories, all found fonts will be added
@@ -569,7 +590,7 @@ Note: The next minor version will focus on bringing more documentation for all t
569590
developement, for easier debugging in Xcode.
570591
[ahtierney](https://github.com/ahtierney)
571592
[#204](https://github.com/SwiftGen/SwiftGen/pull/204)
572-
* Consolidate the use of PathKit internally.
593+
* Consolidate the use of PathKit internally.
573594
[David Jennes](https://github.com/djbe)
574595
[#212](https://github.com/SwiftGen/SwiftGen/pull/212)
575596
* Updated Stencil to [0.7.2](https://github.com/kylef/Stencil/releases/tag/0.7.0).
@@ -593,7 +614,7 @@ Note: The next minor version will focus on bringing more documentation for all t
593614
ensuring that the parser correctly handles namespaced folders.
594615
 ⚠️ Note that you now have to specify the exact path to your `.xcassets` assets catalogs
595616
 when using `swiftgen images` (and not just a directory to parse).
596-
 [David Jennes](https://github.com/djbe)
617+
[David Jennes](https://github.com/djbe)
597618
[#199](https://github.com/SwiftGen/SwiftGen/pull/199)
598619

599620
### New Features
@@ -612,7 +633,7 @@ Note: The next minor version will focus on bringing more documentation for all t
612633
## 3.0.1
613634

614635
* Add support for Xcode 8 and Swift 2.3.
615-
_(Should still compile in Xcode 7.3 but the `Rakefile` to build, install and release requires Xcode 8)._
636+
_(Should still compile in Xcode 7.3 but the `Rakefile` to build, install and release requires Xcode 8)_.
616637
[Valentin Knabel](https://github.com/vknabel)
617638
[Ignacio Romero Zurbuchen](https://github.com/dzenbot)
618639
[HanxuanZhou](https://github.com/GenoZhou)
@@ -660,7 +681,7 @@ Note: The next minor version will focus on bringing more documentation for all t
660681
* Now reports an error when it failed to parse a color in a color input file.
661682
[Olivier Halligon](https://github.com/AliSoftware)
662683
[#162](https://github.com/SwiftGen/SwiftGen/issues/162)
663-
* 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.
684+
* 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.
664685
[Cihat Gündüz](https://github.com/Dschee)
665686
[#159](https://github.com/SwiftGen/SwiftGen/pull/159)
666687
* Update Swift 3 templates to use lowercase enums.
@@ -680,14 +701,12 @@ Note: The next minor version will focus on bringing more documentation for all t
680701
681702
### Important Notes
682703

683-
* 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).
704+
- 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).
684705
Please read the [Custom Templates documentation](documentation/Templates.md) to find out the new Stencil context keys and update your custom templates accordingly.
685706

686707
_If you're using one of the bundled templates, all of them have been updated appropriately._
687708

688-
* 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
689-
to take the latest Swift 3 modifications into account (including naming convensions) so your code might need to be updated
690-
according to match the latest Swift 3 recommendations.
709+
- 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.
691710

692711
## 2.0.0
693712

@@ -752,10 +771,10 @@ stop working as expected. That's the main reason why the version has been bumped
752771
* Added support for TXT (`colors.txt`) files to have named value.
753772
[Derek Ostrander](https://github.com/dostrander)
754773
[#118](https://github.com/SwiftGen/SwiftGen/pull/118)
755-
* Restructured image templates to work around an LLVM issue with nested types.
774+
* Restructured image templates to work around an LLVM issue with nested types.
756775
[Ken Grigsby](https://github.com/kgrigsby59)
757776
[#112](https://github.com/SwiftGen/SwiftGen/issues/112)
758-
* Added Swift 3 templates for storyboards and strings.
777+
* Added Swift 3 templates for storyboards and strings.
759778
[Andrew Breckenridge](https://github.com/AndrewSB)
760779
[#117](https://github.com/SwiftGen/SwiftGen/pull/117)
761780

@@ -832,10 +851,10 @@ stop working as expected. That's the main reason why the version has been bumped
832851

833852
#### Enhancements
834853

835-
* Adding comments to generated color enums which allow you to see the color in the QuickHelp documentation
854+
* Adding comments to generated color enums which allow you to see the color in the QuickHelp documentation.
836855

837856
* The default translation of strings are now added as documentation comments to the enum cases.
838-
_You can add translations to your own templates by using the `string.translation` variable._
857+
_You can add translations to your own templates by using the `string.translation` variable_.
839858
[@MrAlek](https://github.com/MrAlek)
840859
[#58](https://github.com/SwiftGen/SwiftGen/issues/58)
841860
[#60](https://github.com/SwiftGen/SwiftGen/pull/60)
@@ -884,7 +903,8 @@ SwiftGen now comes bundled with some alternate templates, especially `colors-raw
884903
[Viacheslav Karamov](https://github.com/vkaramov/)
885904
[#48](https://github.com/SwiftGen/SwiftGen/issues/48)
886905
* Introduced an `image-allvalues` template that exposes the list of all images in a `static let allValues` array.
887-
[Ahmed Mseddi](https://github.com/amseddi) & Guillaume Lagorce
906+
[Ahmed Mseddi](https://github.com/amseddi)
907+
& Guillaume Lagorce
888908
[#44](https://github.com/SwiftGen/SwiftGen/pull/44)
889909
* Fix issue with Storyboards without any StoryboardID (all scenes being anonymous) not extending `StoryboardScene`.
890910
[#36](https://github.com/SwiftGen/SwiftGen/issues/36)
@@ -894,8 +914,8 @@ SwiftGen now comes bundled with some alternate templates, especially `colors-raw
894914
### New Features: Templates
895915

896916
* `SwiftGen` now uses [Stencil](https://github.com/kylef/Stencil) template engine to produce the generated code.
897-
* This means that the generate code will be easier to improve
898-
* This also means that **you can use your own templates** to generate code that better suits your needs and preferences, using `swiftgen … --template FILE …`
917+
* This means that the generate code will be easier to improve.
918+
* This also means that **you can use your own templates** to generate code that better suits your needs and preferences, using `swiftgen … --template FILE …`.
899919

900920
### Fixes
901921

@@ -935,7 +955,7 @@ SwiftGen now comes bundled with some alternate templates, especially `colors-raw
935955
936956
#### Fixes
937957

938-
* Fix color parsing with absent alpha
958+
* Fix color parsing with absent alpha.
939959
[@Igor-Palaguta](https://github.com/Igor-Palaguta)
940960
[#28](https://github.com/SwiftGen/SwiftGen/pull/28)
941961

Dangerfile

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
require_relative 'rakelib/check_changelog'
2+
13
# Welcome message
2-
markdown("Hey 👋 I'm Eve, the friendly bot watching over SwiftGen 🤖\nThanks a lot for your contribution!")
4+
markdown [
5+
"Hey 👋 I'm Eve, the friendly bot watching over SwiftGen 🤖",
6+
"Thanks a lot for your contribution!",
7+
'', '---', ''
8+
]
39

410
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
511
warn('PR is classed as Work in Progress') if github.pr_title.include? '[WIP]'
@@ -9,11 +15,6 @@ warn('Big PR') if git.lines_of_code > 500
915

1016
need_fixes = []
1117

12-
# Check for a CHANGELOG entry
13-
declared_trivial = github.pr_title.include? '#trivial'
14-
has_changelog = git.modified_files.include?('CHANGELOG.md') || declared_trivial
15-
need_fixes << warn('Please add a CHANGELOG entry to credit your work') unless has_changelog
16-
1718
# Check for correct base branch
1819
is_release = github.branch_for_head.start_with?('release/')
1920
to_develop = github.branch_for_base == 'develop'
@@ -31,7 +32,7 @@ if is_release
3132
'',
3233
stdout
3334
]
34-
need_fixes << warn('Please fix the CHANGELOG errors') unless status.success?
35+
need_fixes << fail('Please fix the CHANGELOG errors') unless status.success?
3536

3637
stdout, _, status = Open3.capture3('bundle', 'exec', 'rake', 'release:check_versions')
3738
markdown [
@@ -40,9 +41,9 @@ if is_release
4041
'',
4142
stdout
4243
]
43-
need_fixes << warn('Please fix the versions inconsistencies') unless status.success?
44+
need_fixes << fail('Please fix the versions inconsistencies') unless status.success?
4445
elsif !to_develop
45-
need_fixes << warn("Feature branches should start from and be merged into 'develop', " \
46+
need_fixes << fail("Feature branches should start from and be merged into 'develop', " \
4647
"not #{github.branch_for_base}")
4748
end
4849

@@ -53,11 +54,47 @@ if podfile_changed ^ package_changed
5354
need_fixes << warn("You should make sure that `Podfile.lock` and `Package.resolved` are changed in sync")
5455
end
5556

57+
58+
# Check for a CHANGELOG entry
59+
declared_trivial = github.pr_title.include? '#trivial'
60+
has_changelog = git.modified_files.include?('CHANGELOG.md')
61+
changelog_msg = ''
62+
unless has_changelog || declared_trivial
63+
repo_url = github.pr_json['head']['repo']['html_url']
64+
pr_title = github.pr_title
65+
pr_title += '.' unless pr_title.end_with?('.')
66+
pr_number = github.pr_json['number']
67+
pr_url = github.pr_json['html_url']
68+
pr_author = github.pr_author
69+
pr_author_url = "https://github.com/#{pr_author}"
70+
71+
need_fixes = fail("Please include a CHANGELOG entry to credit your work. \nYou can find it at [CHANGELOG.md](#{repo_url}/blob/master/CHANGELOG.md).")
72+
73+
changelog_msg = <<-CHANGELOG_FORMAT.gsub(/^ *\|/,'')
74+
|📝 We use the following format for CHANGELOG entries:
75+
|```
76+
| * #{pr_title}
77+
| [##{pr_number}](#{pr_url})
78+
| [@#{pr_author}](#{pr_author_url})
79+
|```
80+
|:bulb: Don't forget to end the line describing your changes by a period and two spaces.
81+
CHANGELOG_FORMAT
82+
# changelog_msg is printed during the "Encouragement message" section, see below
83+
end
84+
85+
changelog_warnings = check_changelog()
86+
unless changelog_warnings.empty?
87+
need_fixes << warn('Found some warnings in CHANGELOG.md')
88+
changelog_warnings.each do |warning|
89+
warn(warning[:message], file: 'CHANGELOG.md', line: warning[:line])
90+
end
91+
end
92+
5693
# Encouragement message
57-
markdown ['', '---', '']
5894
if need_fixes.empty?
5995
markdown('Seems like everything is in order 👍 You did a good job here! 🤝')
6096
else
6197
markdown('Once you fix those tiny nitpickings above, we should be good to go! 🙌')
62-
markdown('_Note: I will update this comment as you add new commits_')
98+
markdown(changelog_msg) unless changelog_msg.empty?
99+
markdown('ℹ️ _I will update this comment as you add new commits_')
63100
end

Package.resources

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
templates
2+
Resources/Stencil-Info.plist
3+
Resources/StencilSwiftKit-Info.plist
4+
Resources/SwiftGen-Info.plist
5+
Resources/SwiftGenKit-Info.plist

Podfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@ target 'SwiftGenKit' do
2929
inherit! :complete
3030
end
3131
end
32+
33+
post_install do | installer |
34+
require 'fileutils'
35+
36+
# copy Info.plist files
37+
pods_with_info_plist = %w(Stencil StencilSwiftKit)
38+
pods_with_info_plist.each do |pod|
39+
FileUtils.cp_r("Pods/Target Support Files/#{pod}/Info.plist", "Resources/#{pod}-Info.plist")
40+
end
41+
end

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ SPEC CHECKSUMS:
3636
SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073
3737
Yams: 572f625a8b719b73e0b57fd313c680f3e2161fe9
3838

39-
PODFILE CHECKSUM: 8e3111566e6b6e5511458f90b27ca65d39072e1f
39+
PODFILE CHECKSUM: 5014c284f8c125f798aaf9f345c7fd79c645f4e9
4040

4141
COCOAPODS: 1.5.3

Pods/Manifest.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/Stencil-Info.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>${EXECUTABLE_NAME}</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>${PRODUCT_NAME}</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>0.13.1</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>${CURRENT_PROJECT_VERSION}</string>
23+
<key>NSPrincipalClass</key>
24+
<string></string>
25+
</dict>
26+
</plist>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>${EXECUTABLE_NAME}</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>${PRODUCT_NAME}</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>2.7.1</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>${CURRENT_PROJECT_VERSION}</string>
23+
<key>NSPrincipalClass</key>
24+
<string></string>
25+
</dict>
26+
</plist>

0 commit comments

Comments
 (0)