From 19b59147ee6fddbe9cf26c748a98c8d9c630d27c Mon Sep 17 00:00:00 2001 From: cooler333 Date: Fri, 19 Oct 2018 16:16:52 +0300 Subject: [PATCH 1/4] fix bundle for uiimage check for storyboard --- .gitignore | 1 + Package.resolved | 6 +-- Package.swift | 2 +- Podfile | 4 +- Podfile.lock | 21 ++++---- .../ResourceApp.xcodeproj/project.pbxproj | 50 +------------------ .../Generators/StoryboardGenerator.swift | 2 +- 7 files changed, 19 insertions(+), 67 deletions(-) diff --git a/.gitignore b/.gitignore index 59e79107..0a2525ff 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ rswift.xcarchive rswift.xcodeproj .build build +DerivedData \ No newline at end of file diff --git a/Package.resolved b/Package.resolved index 1888c767..7a291caf 100644 --- a/Package.resolved +++ b/Package.resolved @@ -23,9 +23,9 @@ "package": "XcodeEdit", "repositoryURL": "https://github.com/tomlokhorst/XcodeEdit", "state": { - "branch": "release/2.0", - "revision": "f9ce2c414f69bd3d309938b75dd0c4af7a815dbe", - "version": null + "branch": null, + "revision": "6886b16eceb937056f756720c95191677a0f3543", + "version": "2.0.0" } } ] diff --git a/Package.swift b/Package.swift index 8c3ff730..3dfa9f24 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,7 @@ let package = Package( name: "rswift", dependencies: [ .package(url: "https://github.com/kylef/Commander.git", .upToNextMinor(from: "0.6.0")), - .package(url: "https://github.com/tomlokhorst/XcodeEdit", .branch("release/2.0")) + .package(url: "https://github.com/tomlokhorst/XcodeEdit", .upToNextMinor(from: "2.0.0")) ], targets: [ .target( diff --git a/Podfile b/Podfile index 65fc92fe..a0d49abb 100644 --- a/Podfile +++ b/Podfile @@ -5,8 +5,8 @@ project 'ResourceApp/ResourceApp' abstract_target 'Shared' do - pod 'R.swift.Library', :git => 'git@github.com:mac-cain13/R.swift.Library.git' # for CI builds - # pod 'R.swift.Library', :path => '../R.swift.Library' # for development + # pod 'R.swift.Library', :git => 'git@github.com:mac-cain13/R.swift.Library.git' # for CI builds + pod 'R.swift.Library', :path => '../R.swift.Library' # for development target 'ResourceApp' do pod 'SWRevealViewController' diff --git a/Podfile.lock b/Podfile.lock index 759a5a78..8ee89777 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,24 +1,23 @@ PODS: - - R.swift.Library (4.0.0.alpha.2) + - R.swift.Library (4.0.0) - SWRevealViewController (2.3.0) DEPENDENCIES: - - R.swift.Library (from `git@github.com:mac-cain13/R.swift.Library.git`) + - R.swift.Library (from `../R.swift.Library`) - SWRevealViewController -EXTERNAL SOURCES: - R.swift.Library: - :git: git@github.com:mac-cain13/R.swift.Library.git +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - SWRevealViewController -CHECKOUT OPTIONS: +EXTERNAL SOURCES: R.swift.Library: - :commit: 151210a33b3bceeec343719065fa6ee1916a5182 - :git: git@github.com:mac-cain13/R.swift.Library.git + :path: "../R.swift.Library" SPEC CHECKSUMS: - R.swift.Library: cb1ffb8ad84a275486e72b834e6d4bf48b59d11b + R.swift.Library: c9d5f6032346bf8c8048aaf1466490e168b0cd70 SWRevealViewController: 6d3fd97f70112fd7cef9de14df4260eacce4c63a -PODFILE CHECKSUM: 57ee52d68f28b860809cf246049602c22acf39d2 +PODFILE CHECKSUM: 3012d75ad10294fc7b77de5c6ffd5aa00e841cc6 -COCOAPODS: 1.3.1 +COCOAPODS: 1.5.3 diff --git a/ResourceApp/ResourceApp.xcodeproj/project.pbxproj b/ResourceApp/ResourceApp.xcodeproj/project.pbxproj index 64102fef..f3943898 100644 --- a/ResourceApp/ResourceApp.xcodeproj/project.pbxproj +++ b/ResourceApp/ResourceApp.xcodeproj/project.pbxproj @@ -502,7 +502,6 @@ D55C6CB51B5D757300301B0D /* Frameworks */, D55C6CB61B5D757300301B0D /* Resources */, 89BF8D4EC08D38DB6564C369 /* [CP] Embed Pods Frameworks */, - ADB91CF666C6624CD5A00F13 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -522,7 +521,6 @@ D55C6CCC1B5D757300301B0D /* Frameworks */, D55C6CCD1B5D757300301B0D /* Resources */, 45EF1C0CF8F1496731872E16 /* [CP] Embed Pods Frameworks */, - 7291DEE28E5CA956526A9741 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -544,7 +542,6 @@ DEF559941CA4873D009B8C51 /* Frameworks */, DEF559951CA4873D009B8C51 /* Resources */, 21DD8AD3CCA3AFB82438FB4E /* [CP] Embed Pods Frameworks */, - 0085D428CB6B6989667E7846 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -721,21 +718,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0085D428CB6B6989667E7846 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Shared-ResourceApp-tvOS/Pods-Shared-ResourceApp-tvOS-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 21DD8AD3CCA3AFB82438FB4E /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -774,21 +756,6 @@ shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Shared-ResourceAppTests/Pods-Shared-ResourceAppTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 7291DEE28E5CA956526A9741 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Shared-ResourceAppTests/Pods-Shared-ResourceAppTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 89BF8D4EC08D38DB6564C369 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -827,21 +794,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - ADB91CF666C6624CD5A00F13 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Shared-ResourceApp/Pods-Shared-ResourceApp-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; C0FE64906E443AEB878A317C /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -872,7 +824,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$SRCROOT/../build/debug/rswift\" generate \"--import\" \"SWRevealViewController\" \"$SRCROOT\" > \"$SRCROOT/rswift.log\""; + shellScript = "\"$SRCROOT/../.build/debug/rswift\" generate \"--import\" \"SWRevealViewController\" \"$SRCROOT\" > \"$SRCROOT/rswift.log\""; }; DEF559A61CA487D6009B8C51 /* R.swift */ = { isa = PBXShellScriptBuildPhase; diff --git a/Sources/RswiftCore/Generators/StoryboardGenerator.swift b/Sources/RswiftCore/Generators/StoryboardGenerator.swift index 69de58c7..08267e78 100644 --- a/Sources/RswiftCore/Generators/StoryboardGenerator.swift +++ b/Sources/RswiftCore/Generators/StoryboardGenerator.swift @@ -160,7 +160,7 @@ struct StoryboardStructGenerator: StructGenerator { // Validation let validateImagesLines = Set(storyboard.usedImageIdentifiers) .map { - "if UIKit.UIImage(named: \"\($0)\") == nil { throw Rswift.ValidationError(description: \"[R.swift] Image named '\($0)' is used in storyboard '\(storyboard.name)', but couldn't be loaded.\") }" + "if UIKit.UIImage(named: \"\($0)\", in: R.hostingBundle, compatibleWith: nil) == nil { throw Rswift.ValidationError(description: \"[R.swift] Image named '\($0)' is used in storyboard '\(storyboard.name)', but couldn't be loaded.\") }" } let validateViewControllersLines = groupedViewControllersWithIdentifier.uniques .flatMap { arg -> String? in From 8fae110d5820859033480762c4728c70b6debcb3 Mon Sep 17 00:00:00 2001 From: cooler333 Date: Fri, 19 Oct 2018 16:26:22 +0300 Subject: [PATCH 2/4] fix podfile --- Podfile | 4 ++-- Podfile.lock | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Podfile b/Podfile index a0d49abb..1f047445 100644 --- a/Podfile +++ b/Podfile @@ -5,8 +5,8 @@ project 'ResourceApp/ResourceApp' abstract_target 'Shared' do - # pod 'R.swift.Library', :git => 'git@github.com:mac-cain13/R.swift.Library.git' # for CI builds - pod 'R.swift.Library', :path => '../R.swift.Library' # for development + pod 'R.swift.Library', :git => 'https://github.com/mac-cain13/R.swift.Library.git', :tag => 'v4.0.0' # for CI builds + # pod 'R.swift.Library', :path => '../R.swift.Library' # for development target 'ResourceApp' do pod 'SWRevealViewController' diff --git a/Podfile.lock b/Podfile.lock index 8ee89777..fbfacce8 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -3,7 +3,7 @@ PODS: - SWRevealViewController (2.3.0) DEPENDENCIES: - - R.swift.Library (from `../R.swift.Library`) + - R.swift.Library (from `https://github.com/mac-cain13/R.swift.Library.git`, tag `v4.0.0`) - SWRevealViewController SPEC REPOS: @@ -12,12 +12,18 @@ SPEC REPOS: EXTERNAL SOURCES: R.swift.Library: - :path: "../R.swift.Library" + :git: https://github.com/mac-cain13/R.swift.Library.git + :tag: v4.0.0 + +CHECKOUT OPTIONS: + R.swift.Library: + :git: https://github.com/mac-cain13/R.swift.Library.git + :tag: v4.0.0 SPEC CHECKSUMS: - R.swift.Library: c9d5f6032346bf8c8048aaf1466490e168b0cd70 + R.swift.Library: fedcb387c96aa18a70f40ff9be6c32474fc90bc3 SWRevealViewController: 6d3fd97f70112fd7cef9de14df4260eacce4c63a -PODFILE CHECKSUM: 3012d75ad10294fc7b77de5c6ffd5aa00e841cc6 +PODFILE CHECKSUM: e329a68efbd431489b9cded5637ba3e99f59b903 COCOAPODS: 1.5.3 From 83749b08cb8597fb9d8a23a85803df0dc5b9560b Mon Sep 17 00:00:00 2001 From: cooler333 Date: Mon, 12 Nov 2018 11:34:47 +0300 Subject: [PATCH 3/4] revert podfile --- Podfile | 2 +- Podfile.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Podfile b/Podfile index 9b2872db..2567b543 100644 --- a/Podfile +++ b/Podfile @@ -6,7 +6,7 @@ project 'ResourceApp/ResourceApp' abstract_target 'Shared' do inhibit_all_warnings! - pod 'R.swift.Library', :git => 'https://github.com/mac-cain13/R.swift.Library.git', :tag => 'v4.0.0' # for CI builds + pod 'R.swift.Library', :git => 'https://github.com/mac-cain13/R.swift.Library.git' # for CI builds # pod 'R.swift.Library', :path => '../R.swift.Library' # for development target 'ResourceApp' do diff --git a/Podfile.lock b/Podfile.lock index 0602cd1f..e130c58b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - R.swift.Library (5.0.0.alpha.1) + - R.swift.Library (5.0.0.alpha.2) - SWRevealViewController (2.3.0) DEPENDENCIES: - - "R.swift.Library (from `git@github.com:mac-cain13/R.swift.Library.git`)" + - R.swift.Library (from `https://github.com/mac-cain13/R.swift.Library.git`) - SWRevealViewController SPEC REPOS: @@ -12,17 +12,17 @@ SPEC REPOS: EXTERNAL SOURCES: R.swift.Library: - :git: "git@github.com:mac-cain13/R.swift.Library.git" + :git: https://github.com/mac-cain13/R.swift.Library.git CHECKOUT OPTIONS: R.swift.Library: - :commit: b6d4ccb5042f933b9b7acb2fb1d424f93512033e - :git: "git@github.com:mac-cain13/R.swift.Library.git" + :commit: cb11aec9943393c9903b3623068207b26c9e246b + :git: https://github.com/mac-cain13/R.swift.Library.git SPEC CHECKSUMS: - R.swift.Library: 50421682fe36726a830ad2b727c5362b8959cc1e + R.swift.Library: 3c21b823839bf5a6769dc7f96cb44479dab51b1b SWRevealViewController: 6d3fd97f70112fd7cef9de14df4260eacce4c63a -PODFILE CHECKSUM: 60ef58c3328649cce6ac12481f40d26d722e5079 +PODFILE CHECKSUM: dcf609a63a9cb222b7167b110c27de036120bae0 COCOAPODS: 1.5.3 From 78069c33a458f24e6f6fcdb98c1ec81e18cc0644 Mon Sep 17 00:00:00 2001 From: cooler333 Date: Mon, 12 Nov 2018 12:26:57 +0300 Subject: [PATCH 4/4] add fix for colors --- Sources/RswiftCore/Generators/NibStructGenerator.swift | 2 +- Sources/RswiftCore/Generators/StoryboardGenerator.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/RswiftCore/Generators/NibStructGenerator.swift b/Sources/RswiftCore/Generators/NibStructGenerator.swift index fbe432fc..58dcf9cc 100644 --- a/Sources/RswiftCore/Generators/NibStructGenerator.swift +++ b/Sources/RswiftCore/Generators/NibStructGenerator.swift @@ -204,7 +204,7 @@ struct NibStructGenerator: StructGenerator { } let validateColorLines = nib.usedColorResources.uniqueAndSorted() .map { - "if UIKit.UIColor(named: \"\($0)\") == nil { throw Rswift.ValidationError(description: \"[R.swift] Color named '\($0)' is used in storyboard '\(nib.name)', but couldn't be loaded.\") }" + "if UIKit.UIColor(named: \"\($0)\", in: R.hostingBundle, compatibleWith: nil) == nil { throw Rswift.ValidationError(description: \"[R.swift] Color named '\($0)' is used in storyboard '\(nib.name)', but couldn't be loaded.\") }" } let validateColorLinesWithAvailableIf = ["if #available(iOS 11.0, *) {"] + validateColorLines.map { $0.indent(with: " ") } + diff --git a/Sources/RswiftCore/Generators/StoryboardGenerator.swift b/Sources/RswiftCore/Generators/StoryboardGenerator.swift index f7629bbd..c52940fd 100644 --- a/Sources/RswiftCore/Generators/StoryboardGenerator.swift +++ b/Sources/RswiftCore/Generators/StoryboardGenerator.swift @@ -164,7 +164,7 @@ struct StoryboardStructGenerator: StructGenerator { } let validateColorLines = storyboard.usedColorResources.uniqueAndSorted() .map { - "if UIKit.UIColor(named: \"\($0)\") == nil { throw Rswift.ValidationError(description: \"[R.swift] Color named '\($0)' is used in storyboard '\(storyboard.name)', but couldn't be loaded.\") }" + "if UIKit.UIColor(named: \"\($0)\", in: R.hostingBundle, compatibleWith: nil) == nil { throw Rswift.ValidationError(description: \"[R.swift] Color named '\($0)' is used in storyboard '\(storyboard.name)', but couldn't be loaded.\") }" } let validateColorLinesWithAvailableIf = ["if #available(iOS 11.0, *) {"] + validateColorLines.map { $0.indent(with: " ") } +