From 08137d9fa94aa759ae017a35a9533f82675ccf2f Mon Sep 17 00:00:00 2001 From: David Jennes Date: Sun, 12 Feb 2017 23:47:51 +0100 Subject: [PATCH] Compile output files (#16) --- .gitignore | 1 + .travis.yml | 2 ++ Contexts/Colors/customname.plist | 16 ---------- Contexts/Colors/defaults.plist | 16 ---------- Contexts/Storyboards-macOS/all.plist | 6 ++-- Contexts/Storyboards-macOS/customname.plist | 6 ++-- Fixtures/Colors/colors.clr | Bin 256 -> 647 bytes Fixtures/Colors/colors.json | 1 - Fixtures/Colors/colors.xml | 1 - .../AdditionalImport.storyboard | 4 +-- Fixtures/stub-env/Definitions.swift | 15 +++++++++ Fixtures/stub-env/Modules/CustomSegue.swift | 4 +++ .../stub-env/Modules/LocationPicker.swift | 4 +++ .../Modules/PrefsWindowController.swift | 4 +++ .../Modules/SlackTextViewController.swift | 4 +++ Fixtures/stub-env/swift2.3/.gitkeep | 0 Fixtures/stub-env/swift3/.gitkeep | 0 Scripts/compile-modules.sh | 30 ++++++++++++++++++ Scripts/compile-output.sh | 21 ++++++++++++ .../Colors/default-context-customname.swift | 5 --- .../Colors/default-context-defaults.swift | 5 --- .../Colors/rawValue-context-customname.swift | 3 -- .../Colors/rawValue-context-defaults.swift | 3 -- .../Colors/swift3-context-customname.swift | 5 --- .../Colors/swift3-context-defaults.swift | 5 --- .../dot-syntax-context-customname.swift | 6 ++-- .../Images/dot-syntax-context-defaults.swift | 6 ++-- ...dot-syntax-swift3-context-customname.swift | 6 ++-- .../dot-syntax-swift3-context-defaults.swift | 6 ++-- .../default-context-all.swift | 8 ++--- .../default-context-customname.swift | 8 ++--- .../lowercase-context-all.swift | 8 ++--- .../lowercase-context-customname.swift | 8 ++--- .../swift3-context-all.swift | 8 ++--- .../swift3-context-customname.swift | 8 ++--- templates/images-dot-syntax-swift3.stencil | 6 ++-- templates/images-dot-syntax.stencil | 6 ++-- 37 files changed, 135 insertions(+), 110 deletions(-) create mode 100644 Fixtures/stub-env/Definitions.swift create mode 100644 Fixtures/stub-env/Modules/CustomSegue.swift create mode 100644 Fixtures/stub-env/Modules/LocationPicker.swift create mode 100644 Fixtures/stub-env/Modules/PrefsWindowController.swift create mode 100644 Fixtures/stub-env/Modules/SlackTextViewController.swift create mode 100644 Fixtures/stub-env/swift2.3/.gitkeep create mode 100644 Fixtures/stub-env/swift3/.gitkeep create mode 100755 Scripts/compile-modules.sh create mode 100755 Scripts/compile-output.sh diff --git a/.gitignore b/.gitignore index 2c22487..e1b4bbc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ ## Build generated build/ DerivedData/ +Fixtures/stub-env/**/*.swiftmodule ## Various settings *.pbxuser diff --git a/.travis.yml b/.travis.yml index bb64b6b..7da4dff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,3 +10,5 @@ env: script: - rake "$RAKETASK" + - Scripts/compile-modules.sh + - Scripts/compile-output.sh diff --git a/Contexts/Colors/customname.plist b/Contexts/Colors/customname.plist index 0a81b9a..b281ad6 100644 --- a/Contexts/Colors/customname.plist +++ b/Contexts/Colors/customname.plist @@ -52,22 +52,6 @@ rgba 33fe66ff - - alpha - ff - blue - cc - green - 66 - name - Cyan-Color - red - ff - rgb - ff66cc - rgba - ff66ccff - alpha cc diff --git a/Contexts/Colors/defaults.plist b/Contexts/Colors/defaults.plist index 1a91dd2..9af9772 100644 --- a/Contexts/Colors/defaults.plist +++ b/Contexts/Colors/defaults.plist @@ -52,22 +52,6 @@ rgba 33fe66ff - - alpha - ff - blue - cc - green - 66 - name - Cyan-Color - red - ff - rgb - ff66cc - rgba - ff66ccff - alpha cc diff --git a/Contexts/Storyboards-macOS/all.plist b/Contexts/Storyboards-macOS/all.plist index 76905c5..b8cf877 100644 --- a/Contexts/Storyboards-macOS/all.plist +++ b/Contexts/Storyboards-macOS/all.plist @@ -4,11 +4,11 @@ extraImports - DBPrefsWindowController + PrefsWindowController modules - DBPrefsWindowController + PrefsWindowController sceneEnumName StoryboardScene @@ -25,7 +25,7 @@ customClass DBPrefsWindowController customModule - DBPrefsWindowController + PrefsWindowController identifier Preferences diff --git a/Contexts/Storyboards-macOS/customname.plist b/Contexts/Storyboards-macOS/customname.plist index f223729..11f350a 100644 --- a/Contexts/Storyboards-macOS/customname.plist +++ b/Contexts/Storyboards-macOS/customname.plist @@ -4,11 +4,11 @@ extraImports - DBPrefsWindowController + PrefsWindowController modules - DBPrefsWindowController + PrefsWindowController sceneEnumName XCTStoryboardsScene @@ -25,7 +25,7 @@ customClass DBPrefsWindowController customModule - DBPrefsWindowController + PrefsWindowController identifier Preferences diff --git a/Fixtures/Colors/colors.clr b/Fixtures/Colors/colors.clr index 15ddf6544d7117ea44228e2b4c23fa6fa5257de3..09bdd4283848ff2a9f52dc90c2d70f8f378dc4d9 100644 GIT binary patch literal 647 zcmZWmOK;Oa5S~ffG)W6}8y=}@%Ii>Y5KcpADv;x@z~Fj=?I7h+ z?Fl4)0|x{}a4Bc5NQg5EJ#c^{9FR~|A%wW$*MZ0EVP^K5@0;1#X3NlRM-VnK($m`) z%@^wYJ!089HS0WW-X@x3U*lCvyQRC=RoZbn{C7B z#uEeFlB{GxUX9lb)wb6MckCQu5!SIr8 z4rx>^)wGSaMog!>XYc5~r9jbCS4lkxiG5vGF0~!CX^^sIshy{zW2vjM;>UGasrXND zCp*BcA3T&k%wjCT2G}5rzULoM-V(hO8gUX zV<~7PiX{lja$Z?dOnc`a*xjA1ERYUaDTiOxElQ=6?gIS5?3$0-te+voU>L?=9A+R3 zMK}iwa2XoVgqxtl9aselcVP`4!XtPA8}JHV!#mi7kMJ43!WL}9clZH6;THl%F^O|{ r3Qyx%yoeR7;Tkf0fY0zbzQi~97C+!8{DR+b3w(=U;9)NGp~LOpCd;iI literal 256 zcmZSKE-oobP0TH+EJ#ghe8Jqpn910}#{TNslWTUgS7fU)`PnKO1k!pEMm4X7TdD7d63GcTQSN(-Ylmvd!eo-Wvcwka)> zr!&p~skCeU|F6y-tP!YZ+AJQ&qLR$yoYaualAKf&bB(^NMpylT-6b+5o?qY2g3> diff --git a/Fixtures/Colors/colors.json b/Fixtures/Colors/colors.json index a79d95e..473c9d8 100644 --- a/Fixtures/Colors/colors.json +++ b/Fixtures/Colors/colors.json @@ -1,5 +1,4 @@ { - "Cyan-Color" : "0xff66ccff", "ArticleTitle" : "#33fe66", "ArticleBody" : "339666", "ArticleFootnote" : "ff66ccff", diff --git a/Fixtures/Colors/colors.xml b/Fixtures/Colors/colors.xml index e2c1525..f4fc3d6 100644 --- a/Fixtures/Colors/colors.xml +++ b/Fixtures/Colors/colors.xml @@ -1,6 +1,5 @@ - #ff66cc #33fe66 #339666 #ff66ccff diff --git a/Fixtures/Storyboards-macOS/AdditionalImport.storyboard b/Fixtures/Storyboards-macOS/AdditionalImport.storyboard index d8a543a..aa5ab9b 100644 --- a/Fixtures/Storyboards-macOS/AdditionalImport.storyboard +++ b/Fixtures/Storyboards-macOS/AdditionalImport.storyboard @@ -1,5 +1,5 @@ - + @@ -7,7 +7,7 @@ - + diff --git a/Fixtures/stub-env/Definitions.swift b/Fixtures/stub-env/Definitions.swift new file mode 100644 index 0000000..56e27bf --- /dev/null +++ b/Fixtures/stub-env/Definitions.swift @@ -0,0 +1,15 @@ +#if os(iOS) || os(tvOS) || os(watchOS) + import UIKit + + class CreateAccViewController: UIViewController { + } + class XXPickerViewController: UIViewController { + } +#elseif os(OSX) + import Cocoa + + class CustomTabViewController: NSWindowController { + } + class NSControllerPlaceholder: NSWindowController { + } +#endif diff --git a/Fixtures/stub-env/Modules/CustomSegue.swift b/Fixtures/stub-env/Modules/CustomSegue.swift new file mode 100644 index 0000000..4b3bd5b --- /dev/null +++ b/Fixtures/stub-env/Modules/CustomSegue.swift @@ -0,0 +1,4 @@ +import UIKit + +public class CustomSegue: UIStoryboardSegue { +} diff --git a/Fixtures/stub-env/Modules/LocationPicker.swift b/Fixtures/stub-env/Modules/LocationPicker.swift new file mode 100644 index 0000000..36ed86b --- /dev/null +++ b/Fixtures/stub-env/Modules/LocationPicker.swift @@ -0,0 +1,4 @@ +import UIKit + +public class LocationPickerViewController: UIViewController { +} diff --git a/Fixtures/stub-env/Modules/PrefsWindowController.swift b/Fixtures/stub-env/Modules/PrefsWindowController.swift new file mode 100644 index 0000000..c687234 --- /dev/null +++ b/Fixtures/stub-env/Modules/PrefsWindowController.swift @@ -0,0 +1,4 @@ +import Cocoa + +public class DBPrefsWindowController: NSWindowController { +} diff --git a/Fixtures/stub-env/Modules/SlackTextViewController.swift b/Fixtures/stub-env/Modules/SlackTextViewController.swift new file mode 100644 index 0000000..52c2757 --- /dev/null +++ b/Fixtures/stub-env/Modules/SlackTextViewController.swift @@ -0,0 +1,4 @@ +import UIKit + +public class SLKTextViewController: UIViewController { +} diff --git a/Fixtures/stub-env/swift2.3/.gitkeep b/Fixtures/stub-env/swift2.3/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Fixtures/stub-env/swift3/.gitkeep b/Fixtures/stub-env/swift3/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Scripts/compile-modules.sh b/Scripts/compile-modules.sh new file mode 100755 index 0000000..89ca2a4 --- /dev/null +++ b/Scripts/compile-modules.sh @@ -0,0 +1,30 @@ +INPUT_PATH="Fixtures/stub-env/Modules" +OUTPUT_PATH="Fixtures/stub-env" + +SWIFT2_TOOLCHAIN="--toolchain com.apple.dt.toolchain.Swift_2_3" +SWIFT3_TOOLCHAIN="" + +# compile macos modules +SDK=$(xcrun --show-sdk-path --sdk macosx) +TARGET="x86_64-apple-macosx10.12" +MODULES=( "PrefsWindowController" ) + +for m in ${MODULES[@]}; do + echo "Compiling module ${m}… (macos)" + xcrun $SWIFT3_TOOLCHAIN swiftc -emit-module "$INPUT_PATH/$m.swift" -sdk $SDK -module-name "$m" -emit-module-path "$OUTPUT_PATH/swift3" -target $TARGET + xcrun $SWIFT2_TOOLCHAIN swiftc -emit-module "$INPUT_PATH/$m.swift" -sdk $SDK -module-name "$m" -emit-module-path "$OUTPUT_PATH/swift2.3" -target $TARGET +done + +#compile ios modules +SDK=$(xcrun --show-sdk-path --sdk iphoneos) +TARGET="armv7s-apple-ios10.0" +MODULES=( "CustomSegue" "LocationPicker" "SlackTextViewController" ) + +for m in ${MODULES[@]}; do + echo "Compiling module ${m}… (ios)" + xcrun $SWIFT3_TOOLCHAIN swiftc -emit-module "$INPUT_PATH/$m.swift" -sdk $SDK -module-name "$m" -emit-module-path "$OUTPUT_PATH/swift3" -target $TARGET + xcrun $SWIFT2_TOOLCHAIN swiftc -emit-module "$INPUT_PATH/$m.swift" -sdk $SDK -module-name "$m" -emit-module-path "$OUTPUT_PATH/swift2.3" -target $TARGET +done + +# don't need this +rm $OUTPUT_PATH/*.swiftdoc diff --git a/Scripts/compile-output.sh b/Scripts/compile-output.sh new file mode 100755 index 0000000..758f3a6 --- /dev/null +++ b/Scripts/compile-output.sh @@ -0,0 +1,21 @@ +for f in `find "Tests/Expected" -name '*.swift'` +do + if [[ $f == *"swift3"* ]]; then + TOOLCHAIN="" + MODULES="Fixtures/stub-env/swift3" + else + TOOLCHAIN="--toolchain com.apple.dt.toolchain.Swift_2_3" + MODULES="Fixtures/stub-env/swift2.3" + fi + + if [[ $f == *"macOS"* ]]; then + SDK="macosx" + TARGET="x86_64-apple-macosx10.12" + else + SDK="iphoneos" + TARGET="armv7s-apple-ios10.0" + fi + + echo "Checking $f template-generated fixture for build errors…" + xcrun $TOOLCHAIN -sdk $SDK swiftc -parse -target $TARGET -I $MODULES "Fixtures/stub-env/Definitions.swift" "$f" +done diff --git a/Tests/Expected/Colors/default-context-customname.swift b/Tests/Expected/Colors/default-context-customname.swift index 5301253..62329d6 100644 --- a/Tests/Expected/Colors/default-context-customname.swift +++ b/Tests/Expected/Colors/default-context-customname.swift @@ -33,9 +33,6 @@ enum XCTColors { /// /// Alpha: 100%
(0x33fe66ff) case ArticleTitle - /// - /// Alpha: 100%
(0xff66ccff) - case Cyan_Color /// /// Alpha: 80%
(0xffffffcc) case Translucent @@ -48,8 +45,6 @@ enum XCTColors { return 0xff66ccff case .ArticleTitle: return 0x33fe66ff - case .Cyan_Color: - return 0xff66ccff case .Translucent: return 0xffffffcc } diff --git a/Tests/Expected/Colors/default-context-defaults.swift b/Tests/Expected/Colors/default-context-defaults.swift index 2fe28a6..342d114 100644 --- a/Tests/Expected/Colors/default-context-defaults.swift +++ b/Tests/Expected/Colors/default-context-defaults.swift @@ -33,9 +33,6 @@ enum ColorName { /// /// Alpha: 100%
(0x33fe66ff) case ArticleTitle - /// - /// Alpha: 100%
(0xff66ccff) - case Cyan_Color /// /// Alpha: 80%
(0xffffffcc) case Translucent @@ -48,8 +45,6 @@ enum ColorName { return 0xff66ccff case .ArticleTitle: return 0x33fe66ff - case .Cyan_Color: - return 0xff66ccff case .Translucent: return 0xffffffcc } diff --git a/Tests/Expected/Colors/rawValue-context-customname.swift b/Tests/Expected/Colors/rawValue-context-customname.swift index 2f71fac..f1161b9 100644 --- a/Tests/Expected/Colors/rawValue-context-customname.swift +++ b/Tests/Expected/Colors/rawValue-context-customname.swift @@ -33,9 +33,6 @@ enum XCTColors: UInt32 { /// /// Alpha: 100%
(0x33fe66ff) case ArticleTitle = 0x33fe66ff - /// - /// Alpha: 100%
(0xff66ccff) - case Cyan_Color = 0xff66ccff /// /// Alpha: 80%
(0xffffffcc) case Translucent = 0xffffffcc diff --git a/Tests/Expected/Colors/rawValue-context-defaults.swift b/Tests/Expected/Colors/rawValue-context-defaults.swift index d6153e7..e61223b 100644 --- a/Tests/Expected/Colors/rawValue-context-defaults.swift +++ b/Tests/Expected/Colors/rawValue-context-defaults.swift @@ -33,9 +33,6 @@ enum ColorName: UInt32 { /// /// Alpha: 100%
(0x33fe66ff) case ArticleTitle = 0x33fe66ff - /// - /// Alpha: 100%
(0xff66ccff) - case Cyan_Color = 0xff66ccff /// /// Alpha: 80%
(0xffffffcc) case Translucent = 0xffffffcc diff --git a/Tests/Expected/Colors/swift3-context-customname.swift b/Tests/Expected/Colors/swift3-context-customname.swift index 43870e4..da78bd1 100644 --- a/Tests/Expected/Colors/swift3-context-customname.swift +++ b/Tests/Expected/Colors/swift3-context-customname.swift @@ -33,9 +33,6 @@ enum XCTColors { /// /// Alpha: 100%
(0x33fe66ff) case articleTitle - /// - /// Alpha: 100%
(0xff66ccff) - case cyanColor /// /// Alpha: 80%
(0xffffffcc) case translucent @@ -48,8 +45,6 @@ enum XCTColors { return 0xff66ccff case .articleTitle: return 0x33fe66ff - case .cyanColor: - return 0xff66ccff case .translucent: return 0xffffffcc } diff --git a/Tests/Expected/Colors/swift3-context-defaults.swift b/Tests/Expected/Colors/swift3-context-defaults.swift index 04dd614..97c22fe 100644 --- a/Tests/Expected/Colors/swift3-context-defaults.swift +++ b/Tests/Expected/Colors/swift3-context-defaults.swift @@ -33,9 +33,6 @@ enum ColorName { /// /// Alpha: 100%
(0x33fe66ff) case articleTitle - /// - /// Alpha: 100%
(0xff66ccff) - case cyanColor /// /// Alpha: 80%
(0xffffffcc) case translucent @@ -48,8 +45,6 @@ enum ColorName { return 0xff66ccff case .articleTitle: return 0x33fe66ff - case .cyanColor: - return 0xff66ccff case .translucent: return 0xffffffcc } diff --git a/Tests/Expected/Images/dot-syntax-context-customname.swift b/Tests/Expected/Images/dot-syntax-context-customname.swift index 16f762c..2be0223 100644 --- a/Tests/Expected/Images/dot-syntax-context-customname.swift +++ b/Tests/Expected/Images/dot-syntax-context-customname.swift @@ -19,15 +19,15 @@ struct XCTImagesType: StringLiteralConvertible { return UIImage(asset: self) } - public init(stringLiteral value: String) { + init(stringLiteral value: String) { self.value = value } - public init(extendedGraphemeClusterLiteral value: String) { + init(extendedGraphemeClusterLiteral value: String) { self.init(stringLiteral: value) } - public init(unicodeScalarLiteral value: String) { + init(unicodeScalarLiteral value: String) { self.init(stringLiteral: value) } } diff --git a/Tests/Expected/Images/dot-syntax-context-defaults.swift b/Tests/Expected/Images/dot-syntax-context-defaults.swift index 29963ed..fa3a51a 100644 --- a/Tests/Expected/Images/dot-syntax-context-defaults.swift +++ b/Tests/Expected/Images/dot-syntax-context-defaults.swift @@ -19,15 +19,15 @@ struct AssetType: StringLiteralConvertible { return UIImage(asset: self) } - public init(stringLiteral value: String) { + init(stringLiteral value: String) { self.value = value } - public init(extendedGraphemeClusterLiteral value: String) { + init(extendedGraphemeClusterLiteral value: String) { self.init(stringLiteral: value) } - public init(unicodeScalarLiteral value: String) { + init(unicodeScalarLiteral value: String) { self.init(stringLiteral: value) } } diff --git a/Tests/Expected/Images/dot-syntax-swift3-context-customname.swift b/Tests/Expected/Images/dot-syntax-swift3-context-customname.swift index 4025a0b..11f4398 100644 --- a/Tests/Expected/Images/dot-syntax-swift3-context-customname.swift +++ b/Tests/Expected/Images/dot-syntax-swift3-context-customname.swift @@ -19,15 +19,15 @@ struct XCTImagesType: ExpressibleByStringLiteral { return UIImage(asset: self) } - public init(stringLiteral value: String) { + init(stringLiteral value: String) { self.value = value } - public init(extendedGraphemeClusterLiteral value: String) { + init(extendedGraphemeClusterLiteral value: String) { self.init(stringLiteral: value) } - public init(unicodeScalarLiteral value: String) { + init(unicodeScalarLiteral value: String) { self.init(stringLiteral: value) } } diff --git a/Tests/Expected/Images/dot-syntax-swift3-context-defaults.swift b/Tests/Expected/Images/dot-syntax-swift3-context-defaults.swift index df4df39..2f7923d 100644 --- a/Tests/Expected/Images/dot-syntax-swift3-context-defaults.swift +++ b/Tests/Expected/Images/dot-syntax-swift3-context-defaults.swift @@ -19,15 +19,15 @@ struct AssetType: ExpressibleByStringLiteral { return UIImage(asset: self) } - public init(stringLiteral value: String) { + init(stringLiteral value: String) { self.value = value } - public init(extendedGraphemeClusterLiteral value: String) { + init(extendedGraphemeClusterLiteral value: String) { self.init(stringLiteral: value) } - public init(unicodeScalarLiteral value: String) { + init(unicodeScalarLiteral value: String) { self.init(stringLiteral: value) } } diff --git a/Tests/Expected/Storyboards-macOS/default-context-all.swift b/Tests/Expected/Storyboards-macOS/default-context-all.swift index e7c0444..b93e1e9 100644 --- a/Tests/Expected/Storyboards-macOS/default-context-all.swift +++ b/Tests/Expected/Storyboards-macOS/default-context-all.swift @@ -2,7 +2,7 @@ import Foundation import Cocoa -import DBPrefsWindowController +import PrefsWindowController // swiftlint:disable file_length // swiftlint:disable line_length @@ -54,10 +54,10 @@ enum StoryboardScene { static let storyboardName = "AdditionalImport" case PreferencesScene = "Preferences" - static func instantiatePreferences() -> DBPrefsWindowController.DBPrefsWindowController { - guard let vc = StoryboardScene.AdditionalImport.PreferencesScene.controller() as? DBPrefsWindowController.DBPrefsWindowController + static func instantiatePreferences() -> PrefsWindowController.DBPrefsWindowController { + guard let vc = StoryboardScene.AdditionalImport.PreferencesScene.controller() as? PrefsWindowController.DBPrefsWindowController else { - fatalError("ViewController 'Preferences' is not of the expected class DBPrefsWindowController.DBPrefsWindowController.") + fatalError("ViewController 'Preferences' is not of the expected class PrefsWindowController.DBPrefsWindowController.") } return vc } diff --git a/Tests/Expected/Storyboards-macOS/default-context-customname.swift b/Tests/Expected/Storyboards-macOS/default-context-customname.swift index 9ef817d..6b3eaa5 100644 --- a/Tests/Expected/Storyboards-macOS/default-context-customname.swift +++ b/Tests/Expected/Storyboards-macOS/default-context-customname.swift @@ -2,7 +2,7 @@ import Foundation import Cocoa -import DBPrefsWindowController +import PrefsWindowController // swiftlint:disable file_length // swiftlint:disable line_length @@ -54,10 +54,10 @@ enum XCTStoryboardsScene { static let storyboardName = "AdditionalImport" case PreferencesScene = "Preferences" - static func instantiatePreferences() -> DBPrefsWindowController.DBPrefsWindowController { - guard let vc = XCTStoryboardsScene.AdditionalImport.PreferencesScene.controller() as? DBPrefsWindowController.DBPrefsWindowController + static func instantiatePreferences() -> PrefsWindowController.DBPrefsWindowController { + guard let vc = XCTStoryboardsScene.AdditionalImport.PreferencesScene.controller() as? PrefsWindowController.DBPrefsWindowController else { - fatalError("ViewController 'Preferences' is not of the expected class DBPrefsWindowController.DBPrefsWindowController.") + fatalError("ViewController 'Preferences' is not of the expected class PrefsWindowController.DBPrefsWindowController.") } return vc } diff --git a/Tests/Expected/Storyboards-macOS/lowercase-context-all.swift b/Tests/Expected/Storyboards-macOS/lowercase-context-all.swift index 22c9e2e..d0f79d0 100644 --- a/Tests/Expected/Storyboards-macOS/lowercase-context-all.swift +++ b/Tests/Expected/Storyboards-macOS/lowercase-context-all.swift @@ -2,7 +2,7 @@ import Foundation import Cocoa -import DBPrefsWindowController +import PrefsWindowController // swiftlint:disable file_length // swiftlint:disable line_length @@ -54,10 +54,10 @@ enum StoryboardScene { static let storyboardName = "AdditionalImport" case preferencesScene = "Preferences" - static func instantiatePreferences() -> DBPrefsWindowController.DBPrefsWindowController { - guard let vc = StoryboardScene.AdditionalImport.preferencesScene.controller() as? DBPrefsWindowController.DBPrefsWindowController + static func instantiatePreferences() -> PrefsWindowController.DBPrefsWindowController { + guard let vc = StoryboardScene.AdditionalImport.preferencesScene.controller() as? PrefsWindowController.DBPrefsWindowController else { - fatalError("ViewController 'Preferences' is not of the expected class DBPrefsWindowController.DBPrefsWindowController.") + fatalError("ViewController 'Preferences' is not of the expected class PrefsWindowController.DBPrefsWindowController.") } return vc } diff --git a/Tests/Expected/Storyboards-macOS/lowercase-context-customname.swift b/Tests/Expected/Storyboards-macOS/lowercase-context-customname.swift index 3dc5a5d..daa0147 100644 --- a/Tests/Expected/Storyboards-macOS/lowercase-context-customname.swift +++ b/Tests/Expected/Storyboards-macOS/lowercase-context-customname.swift @@ -2,7 +2,7 @@ import Foundation import Cocoa -import DBPrefsWindowController +import PrefsWindowController // swiftlint:disable file_length // swiftlint:disable line_length @@ -54,10 +54,10 @@ enum XCTStoryboardsScene { static let storyboardName = "AdditionalImport" case preferencesScene = "Preferences" - static func instantiatePreferences() -> DBPrefsWindowController.DBPrefsWindowController { - guard let vc = XCTStoryboardsScene.AdditionalImport.preferencesScene.controller() as? DBPrefsWindowController.DBPrefsWindowController + static func instantiatePreferences() -> PrefsWindowController.DBPrefsWindowController { + guard let vc = XCTStoryboardsScene.AdditionalImport.preferencesScene.controller() as? PrefsWindowController.DBPrefsWindowController else { - fatalError("ViewController 'Preferences' is not of the expected class DBPrefsWindowController.DBPrefsWindowController.") + fatalError("ViewController 'Preferences' is not of the expected class PrefsWindowController.DBPrefsWindowController.") } return vc } diff --git a/Tests/Expected/Storyboards-macOS/swift3-context-all.swift b/Tests/Expected/Storyboards-macOS/swift3-context-all.swift index 0bfbc99..cd51de0 100644 --- a/Tests/Expected/Storyboards-macOS/swift3-context-all.swift +++ b/Tests/Expected/Storyboards-macOS/swift3-context-all.swift @@ -2,7 +2,7 @@ import Foundation import Cocoa -import DBPrefsWindowController +import PrefsWindowController // swiftlint:disable file_length // swiftlint:disable line_length @@ -54,10 +54,10 @@ enum StoryboardScene { static let storyboardName = "AdditionalImport" case preferencesScene = "Preferences" - static func instantiatePreferences() -> DBPrefsWindowController.DBPrefsWindowController { - guard let vc = StoryboardScene.AdditionalImport.preferencesScene.controller() as? DBPrefsWindowController.DBPrefsWindowController + static func instantiatePreferences() -> PrefsWindowController.DBPrefsWindowController { + guard let vc = StoryboardScene.AdditionalImport.preferencesScene.controller() as? PrefsWindowController.DBPrefsWindowController else { - fatalError("ViewController 'Preferences' is not of the expected class DBPrefsWindowController.DBPrefsWindowController.") + fatalError("ViewController 'Preferences' is not of the expected class PrefsWindowController.DBPrefsWindowController.") } return vc } diff --git a/Tests/Expected/Storyboards-macOS/swift3-context-customname.swift b/Tests/Expected/Storyboards-macOS/swift3-context-customname.swift index 9bb1d22..1f1d7b9 100644 --- a/Tests/Expected/Storyboards-macOS/swift3-context-customname.swift +++ b/Tests/Expected/Storyboards-macOS/swift3-context-customname.swift @@ -2,7 +2,7 @@ import Foundation import Cocoa -import DBPrefsWindowController +import PrefsWindowController // swiftlint:disable file_length // swiftlint:disable line_length @@ -54,10 +54,10 @@ enum XCTStoryboardsScene { static let storyboardName = "AdditionalImport" case preferencesScene = "Preferences" - static func instantiatePreferences() -> DBPrefsWindowController.DBPrefsWindowController { - guard let vc = XCTStoryboardsScene.AdditionalImport.preferencesScene.controller() as? DBPrefsWindowController.DBPrefsWindowController + static func instantiatePreferences() -> PrefsWindowController.DBPrefsWindowController { + guard let vc = XCTStoryboardsScene.AdditionalImport.preferencesScene.controller() as? PrefsWindowController.DBPrefsWindowController else { - fatalError("ViewController 'Preferences' is not of the expected class DBPrefsWindowController.DBPrefsWindowController.") + fatalError("ViewController 'Preferences' is not of the expected class PrefsWindowController.DBPrefsWindowController.") } return vc } diff --git a/templates/images-dot-syntax-swift3.stencil b/templates/images-dot-syntax-swift3.stencil index ad3a68a..2add6c6 100644 --- a/templates/images-dot-syntax-swift3.stencil +++ b/templates/images-dot-syntax-swift3.stencil @@ -20,15 +20,15 @@ struct {{enumName}}Type: ExpressibleByStringLiteral { return UIImage(asset: self) } - public init(stringLiteral value: String) { + init(stringLiteral value: String) { self.value = value } - public init(extendedGraphemeClusterLiteral value: String) { + init(extendedGraphemeClusterLiteral value: String) { self.init(stringLiteral: value) } - public init(unicodeScalarLiteral value: String) { + init(unicodeScalarLiteral value: String) { self.init(stringLiteral: value) } } diff --git a/templates/images-dot-syntax.stencil b/templates/images-dot-syntax.stencil index 0c2b931..025190e 100644 --- a/templates/images-dot-syntax.stencil +++ b/templates/images-dot-syntax.stencil @@ -20,15 +20,15 @@ struct {{enumName}}Type: StringLiteralConvertible { return UIImage(asset: self) } - public init(stringLiteral value: String) { + init(stringLiteral value: String) { self.value = value } - public init(extendedGraphemeClusterLiteral value: String) { + init(extendedGraphemeClusterLiteral value: String) { self.init(stringLiteral: value) } - public init(unicodeScalarLiteral value: String) { + init(unicodeScalarLiteral value: String) { self.init(stringLiteral: value) } }