Skip to content

Commit

Permalink
Merge pull request mac-cain13#459 from cooler333/fix-images-validatio…
Browse files Browse the repository at this point in the history
…n-bundle-issue

Fix images validation bundle issue
  • Loading branch information
tomlokhorst authored Nov 15, 2018
2 parents f7608ab + 78069c3 commit d39c5dd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ rswift.xcarchive
rswift.xcodeproj
.build
build
DerivedData
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project 'ResourceApp/ResourceApp'
abstract_target 'Shared' do
inhibit_all_warnings!

pod 'R.swift.Library', :git => 'git@github.com:mac-cain13/R.swift.Library.git' # 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
Expand Down
14 changes: 7 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion Sources/RswiftCore/Generators/NibStructGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: " ") } +
Expand Down
4 changes: 2 additions & 2 deletions Sources/RswiftCore/Generators/StoryboardGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ struct StoryboardStructGenerator: StructGenerator {
// Validation
let validateImagesLines = storyboard.usedImageIdentifiers.uniqueAndSorted()
.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 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: " ") } +
Expand Down

0 comments on commit d39c5dd

Please sign in to comment.