SwiftGen 6.2.0

Created on 3 Mar 2019  Β·  15Comments  Β·  Source: SwiftGen/SwiftGen

After long delays, seems like we're getting the boulder to finally start rolling for a release. There are a few small PRs still open tagged for 6.2.0, besides those:

  • [x] XCAssets: check that #589 didn't break dynamic colors when traits change (dark/light mode)
  • [x] Strings: we may want to revisit #573. I think the localizeFunction should use a function as initially discussed, and not default to the macro NSLocalizedString. The latter gives issues with for example genstrings and has a bizarre parameter order. ➑️ #716
  • [x] Changelog: as we now have a "deprecations" section, check if other entries need to be moved to it. ➑️ #717

After those PRs are done (or we skip them), some general housekeeping:

  • [x] Check docs (again)
  • [x] Check playground code
  • [x] Maybe write a tiny migration guide for the (kinda) breaking changes: swift 3 deprecation, entityName (core data) and strings String --> Any ➑️ #717
  • [x] Update podspec
  • [x] Check brew changes, the output paths have changed again!

Most helpful comment

@djbe and @AliSoftware What's the status? Anything I can do to help?

All 15 comments

@AliSoftware Do you want to finish reviewing #614, or push it to 6.3.0?

Depending on what we choose to do, I can finish up the docs PR #612, and we should be able to release 6.2 this weekend.

614 is pretty ready to me so let's include it in the 6.2 πŸ‘

_(Side Note: I don't have a Mac at all until next Wednesday since I'm traveling and didn't take it with me, so all my reviews are gonna be in phone without a Mac nor Xcode nor a terminal until then)_

~Brewfile changes:~

See below for updated version!

@djbe Any news about 6.2.0 update?

@djbe I'd love to know as well, and the status of Swift 5 support.

@danielsaidi Sorry for the delay, I don't have much time to give to OSS lately with work getting in the way. I think we're very close but just lack the time to finish it and there's always something at work getting in the way of having time for that.

Note that the current version of SwiftGen already supposed Swift 5 by using the Swift 4 template, since the code generated by the build in Swift 4 template is compatible with Swift 5 (there's no change between Swift 4 and Swift 5 that affect the code that the built-in templates generate), so at least even if we still don't find the time to finish that release soon you can already use SwiftGen with Swift 5

I'll try to find some time this weekend to see this finished and published at last. 🀞

Same here, been meaning to finally publish this (the only remaining task is finish up the migration guide/docs), and make a release.

In September I'll have a ton of free time, so I'm definitely planning to pick up some issues/PRs then.

Hi! Sorry for the slow reply. I'm looking forward to it! πŸ‘

@djbe and @AliSoftware What's the status? Anything I can do to help?

@AliSoftware @djbe Any updates on the release of 6.2? Would love to start using this library, it looks awesome, but I'm worried about having an abandonware dependency in my project.

Brewfile changes
…

Notes:

  • We will likely use swift5 templates as the generated fixtures distributed to brew for tests, rather than swift4
  • if we merge #702 before the upcoming release of 6.2.0, we'll need to also add Tests/Fixtures/Generated/JSON/… entries to that list in the formula too

Updated Brewfile changes (only path changes, still needs xcode/macos/other changes):

diff --git a/swiftgen.rb b/swiftgen.rb
index d2d6987..7427691 100644
--- a/swiftgen.rb
+++ b/swiftgen.rb
@@ -27,22 +27,22 @@ class Swiftgen < Formula
     system "bundle", "exec", "rake", "cli:install[#{bin},#{lib},#{pkgshare}/templates]"

     fixtures = {
-      "Tests/Fixtures/Resources/Colors/colors.xml"                                   => "colors.xml",
-      "Tests/Fixtures/Resources/CoreData/Model.xcdatamodeld"                         => "Model.xcdatamodeld",
-      "Tests/Fixtures/Resources/Fonts"                                               => "Fonts",
-      "Tests/Fixtures/Resources/IB-iOS"                                              => "IB-iOS",
-      "Tests/Fixtures/Resources/Plist/good"                                          => "Plist",
-      "Tests/Fixtures/Resources/Strings/Localizable.strings"                         => "Localizable.strings",
-      "Tests/Fixtures/Resources/XCAssets"                                            => "XCAssets",
-      "Tests/Fixtures/Resources/YAML/good"                                           => "YAML",
-      "Tests/Fixtures/Generated/Colors/swift4-context-defaults.swift"                => "colors.swift",
-      "Tests/Fixtures/Generated/CoreData/swift4-context-defaults.swift"              => "coredata.swift",
-      "Tests/Fixtures/Generated/Fonts/swift4-context-defaults.swift"                 => "fonts.swift",
-      "Tests/Fixtures/Generated/IB-iOS/scenes-swift4-context-all.swift"              => "ib-scenes.swift",
-      "Tests/Fixtures/Generated/Plist/runtime-swift4-context-all.swift"              => "plists.swift",
-      "Tests/Fixtures/Generated/Strings/structured-swift4-context-localizable.swift" => "strings.swift",
-      "Tests/Fixtures/Generated/XCAssets/swift4-context-all.swift"                   => "xcassets.swift",
-      "Tests/Fixtures/Generated/YAML/inline-swift4-context-all.swift"                => "yaml.swift",
+      "Tests/Fixtures/Resources/Colors/colors.xml"                           => "colors.xml",
+      "Tests/Fixtures/Resources/CoreData/Model.xcdatamodeld"                 => "Model.xcdatamodeld",
+      "Tests/Fixtures/Resources/Fonts"                                       => "Fonts",
+      "Tests/Fixtures/Resources/IB-iOS"                                      => "IB-iOS",
+      "Tests/Fixtures/Resources/Plist/good"                                  => "Plist",
+      "Tests/Fixtures/Resources/Strings/Localizable.strings"                 => "Localizable.strings",
+      "Tests/Fixtures/Resources/XCAssets"                                    => "XCAssets",
+      "Tests/Fixtures/Resources/YAML/good"                                   => "YAML",
+      "Tests/Fixtures/Generated/Colors/swift5/defaults.swift"                => "colors.swift",
+      "Tests/Fixtures/Generated/CoreData/swift5/defaults.swift"              => "coredata.swift",
+      "Tests/Fixtures/Generated/Fonts/swift5/defaults.swift"                 => "fonts.swift",
+      "Tests/Fixtures/Generated/IB-iOS/scenes-swift5/all.swift"              => "ib-scenes.swift",
+      "Tests/Fixtures/Generated/Plist/runtime-swift5/all.swift"              => "plists.swift",
+      "Tests/Fixtures/Generated/Strings/structured-swift5/localizable.swift" => "strings.swift",
+      "Tests/Fixtures/Generated/XCAssets/swift5/all.swift"                   => "xcassets.swift",
+      "Tests/Fixtures/Generated/YAML/inline-swift5/all.swift"                => "yaml.swift",
     }
     (pkgshare/"fixtures").install fixtures
   end
@@ -52,40 +52,40 @@ class Swiftgen < Formula

     fixtures = pkgshare/"fixtures"

-    assert_equal shell_output("#{bin}/swiftgen colors --templatePath " \
-                              "#{pkgshare/"templates/colors/swift4.stencil"} #{fixtures}/colors.xml").strip,
-      (fixtures/"colors.swift").read.strip, "swiftgen colors failed"
+    assert_equal shell_output("#{bin}/swiftgen run colors --templatePath " \
+                              "#{pkgshare/"templates/colors/swift5.stencil"} #{fixtures}/colors.xml").strip,
+      (fixtures/"colors.swift").read.strip, "swiftgen run colors failed"

-    assert_equal shell_output("#{bin}/swiftgen coredata --templatePath " \
-                              "#{pkgshare/"templates/coredata/swift4.stencil"} #{fixtures}/Model.xcdatamodeld").strip,
-      (fixtures/"coredata.swift").read.strip, "swiftgen coredata failed"
+    assert_equal shell_output("#{bin}/swiftgen run coredata --templatePath " \
+                              "#{pkgshare/"templates/coredata/swift5.stencil"} #{fixtures}/Model.xcdatamodeld").strip,
+      (fixtures/"coredata.swift").read.strip, "swiftgen run coredata failed"

-    assert_equal shell_output("#{bin}/swiftgen fonts --templatePath " \
-                              "#{pkgshare/"templates/fonts/swift4.stencil"} #{fixtures}/Fonts").strip,
-      (fixtures/"fonts.swift").read.strip, "swiftgen fonts failed"
+    assert_equal shell_output("#{bin}/swiftgen run fonts --templatePath " \
+                              "#{pkgshare/"templates/fonts/swift5.stencil"} #{fixtures}/Fonts").strip,
+      (fixtures/"fonts.swift").read.strip, "swiftgen run fonts failed"

-    assert_equal shell_output("#{bin}/swiftgen ib --templatePath " \
-                              "#{pkgshare/"templates/ib/scenes-swift4.stencil"} --param module=SwiftGen " \
+    assert_equal shell_output("#{bin}/swiftgen run ib --templatePath " \
+                              "#{pkgshare/"templates/ib/scenes-swift5.stencil"} --param module=SwiftGen " \
                               "#{fixtures}/IB-iOS").strip,
-      (fixtures/"ib-scenes.swift").read.strip, "swiftgen ib failed"
+      (fixtures/"ib-scenes.swift").read.strip, "swiftgen run ib failed"

-    assert_equal shell_output("#{bin}/swiftgen plist --templatePath " \
-                              "#{pkgshare/"templates/plist/runtime-swift4.stencil"} #{fixtures}/Plist").strip,
-      (fixtures/"plists.swift").read.strip, "swiftgen plist failed"
+    assert_equal shell_output("#{bin}/swiftgen run plist --templatePath " \
+                              "#{pkgshare/"templates/plist/runtime-swift5.stencil"} #{fixtures}/Plist").strip,
+      (fixtures/"plists.swift").read.strip, "swiftgen run plist failed"

-    assert_equal shell_output("#{bin}/swiftgen strings --templatePath " \
-                              "#{pkgshare/"templates/strings/structured-swift4.stencil"} " \
+    assert_equal shell_output("#{bin}/swiftgen run strings --templatePath " \
+                              "#{pkgshare/"templates/strings/structured-swift5.stencil"} " \
                               "#{fixtures}/Localizable.strings").strip,
-      (fixtures/"strings.swift").read.strip, "swiftgen strings failed"
+      (fixtures/"strings.swift").read.strip, "swiftgen run strings failed"

-    assert_equal shell_output("#{bin}/swiftgen xcassets --templatePath " \
-                              "#{pkgshare/"templates/xcassets/swift4.stencil"} " \
+    assert_equal shell_output("#{bin}/swiftgen run xcassets --templatePath " \
+                              "#{pkgshare/"templates/xcassets/swift5.stencil"} " \
                               "#{fixtures}/XCAssets/*.xcassets").strip,
-      (fixtures/"xcassets.swift").read.strip, "swiftgen xcassets failed"
+      (fixtures/"xcassets.swift").read.strip, "swiftgen run xcassets failed"

-    assert_equal shell_output("#{bin}/swiftgen yaml --templatePath " \
-                              "#{pkgshare/"templates/yaml/inline-swift4.stencil"} --filter '.(json|ya?ml)$' " \
+    assert_equal shell_output("#{bin}/swiftgen run yaml --templatePath " \
+                              "#{pkgshare/"templates/yaml/inline-swift5.stencil"} --filter '.(json|ya?ml)$' " \
                               "#{fixtures}/YAML").strip,
-      (fixtures/"yaml.swift").read.strip, "swiftgen yaml failed"
+      (fixtures/"yaml.swift").read.strip, "swiftgen run yaml failed"
   end
 end
 πŸŽ‰  Congrats

 πŸš€  SwiftGen (6.2.0) successfully published
 πŸ“…  June 18th, 22:11
 🌎  https://cocoapods.org/pods/SwiftGen
 πŸ‘  Tell your friends!
--------------------------------------------------------------------------------

Next steps to finish this release:

  • [x] [release on homebrew](https://github.com/Homebrew/homebrew-core/pull/56507) [WIP]
  • [x] Merge stable branch back to develop, and delete the release/6.2.0 branch
  • [x] Delete the master branch (now replaced by stable)
  • [x] Run bundle exec rake changelog:reset on develop
  • [x] Profit!

Release is finally released on Homebrew too, so the release of 6.2.0 is now complete!

Time to celebrate 🍾 – https://twitter.com/aligatr/status/1274099234627883009?s=20

Congratulations on the release! Can’t wait to give it a try :)

Was this page helpful?
0 / 5 - 0 ratings