Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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', :git => 'git@github.com:mac-cain13/R.swift.Library.git', :branch => 'color-asset-resource' # for CI builds
# pod 'R.swift.Library', :path => '../R.swift.Library' # for development

target 'ResourceApp' do
Expand Down
7 changes: 4 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ PODS:
- SWRevealViewController (2.3.0)

DEPENDENCIES:
- R.swift.Library (from `git@github.com:mac-cain13/R.swift.Library.git`)
- R.swift.Library (from `git@github.com:mac-cain13/R.swift.Library.git`, branch `color-asset-resource`)
- SWRevealViewController

EXTERNAL SOURCES:
R.swift.Library:
:branch: color-asset-resource
:git: git@github.com:mac-cain13/R.swift.Library.git

CHECKOUT OPTIONS:
R.swift.Library:
:commit: 594965c3c1d42d9a4390eec3ecf159ab8210cb78
:commit: ce03cde8d0edd9658c36a971a0bc8fde390a8b43
:git: git@github.com:mac-cain13/R.swift.Library.git

SPEC CHECKSUMS:
R.swift.Library: fbdec16c9802ad104fc1ba53415dc190e6ec5c73
SWRevealViewController: 6d3fd97f70112fd7cef9de14df4260eacce4c63a

PODFILE CHECKSUM: 57ee52d68f28b860809cf246049602c22acf39d2
PODFILE CHECKSUM: 29323947ca32a3f3344cd006a8b44a36ffb886f0

COCOAPODS: 1.2.1
12 changes: 8 additions & 4 deletions ResourceApp/ResourceApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,17 @@
E2156B6C1CC4293000F341DC /* Duplicate#.strings in Resources */ = {isa = PBXBuildFile; fileRef = E2156B6B1CC4293000F341DC /* Duplicate#.strings */; };
E2156B6E1CC42B6700F341DC /* @@.strings in Resources */ = {isa = PBXBuildFile; fileRef = E2156B6D1CC42B6700F341DC /* @@.strings */; };
E22070771C92E137007A090B /* WhitespaceReuseIdentifer.xib in Resources */ = {isa = PBXBuildFile; fileRef = E22070761C92E137007A090B /* WhitespaceReuseIdentifer.xib */; };
E22A62091E8AE788009B7F9F /* Display P3.clr in Resources */ = {isa = PBXBuildFile; fileRef = E22A62081E8AE788009B7F9F /* Display P3.clr */; };
E24720CE1C96B71B00DF291D /* ColorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E24720CD1C96B71B00DF291D /* ColorsTests.swift */; };
E2562CD61EE70C68007D8938 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E2562CD51EE70C68007D8938 /* Media.xcassets */; };
E2762AC01CCCDFDA0009BCAA /* Settings.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = E2762AC21CCCDFDA0009BCAA /* Settings.stringsdict */; };
E2762AE01CCE62CC0009BCAA /* Generic.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = E2762ADF1CCE62CC0009BCAA /* Generic.stringsdict */; };
E29693581CAD64B500401D53 /* __FILE__ in Resources */ = {isa = PBXBuildFile; fileRef = E29693571CAD64B500401D53 /* __FILE__ */; };
E296935A1CAD64D100401D53 /* associatedtype in Resources */ = {isa = PBXBuildFile; fileRef = E29693591CAD64D100401D53 /* associatedtype */; };
E296935C1CAD666200401D53 /* #column in Resources */ = {isa = PBXBuildFile; fileRef = E296935B1CAD666200401D53 /* #column */; };
E2A10EF81CD13779006BFC63 /* RelativeToProject.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2A10EF71CD13779006BFC63 /* RelativeToProject.xib */; };
E2CA68DE1EE74585009C4DB4 /* Display P3.clr in Resources */ = {isa = PBXBuildFile; fileRef = E22A62081E8AE788009B7F9F /* Display P3.clr */; };
E2CA68DF1EE74585009C4DB4 /* My R.swift colors.clr in Resources */ = {isa = PBXBuildFile; fileRef = E2F268B01C92BFE00093995D /* My R.swift colors.clr */; };
E2CD68671D7CADEA00BEBE59 /* hello.txt in Resources */ = {isa = PBXBuildFile; fileRef = E2CD68641D7CACC100BEBE59 /* hello.txt */; };
E2F268B11C92BFE00093995D /* My R.swift colors.clr in Resources */ = {isa = PBXBuildFile; fileRef = E2F268B01C92BFE00093995D /* My R.swift colors.clr */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -196,6 +197,7 @@
E22070761C92E137007A090B /* WhitespaceReuseIdentifer.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WhitespaceReuseIdentifer.xib; sourceTree = "<group>"; };
E22A62081E8AE788009B7F9F /* Display P3.clr */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = "Display P3.clr"; sourceTree = "<group>"; };
E24720CD1C96B71B00DF291D /* ColorsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsTests.swift; sourceTree = "<group>"; };
E2562CD51EE70C68007D8938 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; };
E2762AC11CCCDFDA0009BCAA /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = Base; path = Base.lproj/Settings.stringsdict; sourceTree = "<group>"; };
E2762AC31CCCDFE10009BCAA /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = nl; path = nl.lproj/Settings.stringsdict; sourceTree = "<group>"; };
E2762ADF1CCE62CC0009BCAA /* Generic.stringsdict */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.stringsdict; path = Generic.stringsdict; sourceTree = "<group>"; };
Expand Down Expand Up @@ -342,6 +344,7 @@
D55C6CBF1B5D757300301B0D /* FirstViewController.swift */,
D5CBCE481B7682B800C5D96B /* MyViewController.swift */,
D55C6CC11B5D757300301B0D /* SecondViewController.swift */,
E2562CD51EE70C68007D8938 /* Media.xcassets */,
D55C6CC61B5D757300301B0D /* Images.xcassets */,
CCBC9CB81EC4809D002F3D0E /* Images2.xcassets */,
D5AD5C9C1B7A901F00A8B96C /* ADuplicateCellView.xib */,
Expand Down Expand Up @@ -634,11 +637,11 @@
D5AD5C9B1B7A8F4300A8B96C /* CellView.xib in Resources */,
D5159E9E1BBC33680013F52A /* Colors@2x.jpg in Resources */,
D5E513BA1B8E111A0035ECAA /* AveriaLibre-B.ttf in Resources */,
E2562CD61EE70C68007D8938 /* Media.xcassets in Resources */,
D50175BE1B5FEFD000DB8314 /* Secondary.storyboard in Resources */,
D5AD5C911B78FC0500A8B96C /* duplicate.xib in Resources */,
D575E25D1B766CD800C22F0B /* My View.xib in Resources */,
D5AD5C941B78FC4E00A8B96C /* Duplicate.xib in Resources */,
E22A62091E8AE788009B7F9F /* Display P3.clr in Resources */,
E2CD68671D7CADEA00BEBE59 /* hello.txt in Resources */,
D55C6CC51B5D757300301B0D /* Main.storyboard in Resources */,
E29693581CAD64B500401D53 /* __FILE__ in Resources */,
Expand All @@ -647,18 +650,19 @@
E2156B681CC41EB400F341DC /* Generic.strings in Resources */,
E296935A1CAD64D100401D53 /* associatedtype in Resources */,
D51E60C71BB1E600004BB376 /* User@white@3x.png in Resources */,
E2CA68DE1EE74585009C4DB4 /* Display P3.clr in Resources */,
D5B799851C1B8DB6009EA901 /* Settings.bundle in Resources */,
D5B799871C1B8DD2009EA901 /* Specials.storyboard in Resources */,
D5E513BD1B8E111A0035ECAA /* AveriaLibre.ttf in Resources */,
D52725FE1C4BB6BC0005C8D4 /* References.storyboard in Resources */,
E2F268B11C92BFE00093995D /* My R.swift colors.clr in Resources */,
E2156B6A1CC4292600F341DC /* Duplicate.strings in Resources */,
E2762AE01CCE62CC0009BCAA /* Generic.stringsdict in Resources */,
D5159EA01BBC37BC0013F52A /* Colors@3x.jpg in Resources */,
D5F05D3F1BB3CDF3003AE55E /* The App Icon.png in Resources */,
5D1AFAB11C858637003FE7AB /* Localizable.strings in Resources */,
D5E513BC1B8E111A0035ECAA /* AveriaLibre-L.ttf in Resources */,
D51E60C51BB1E600004BB376 /* User@white.png in Resources */,
E2CA68DF1EE74585009C4DB4 /* My R.swift colors.clr in Resources */,
D55C6CCA1B5D757300301B0D /* LaunchScreen.xib in Resources */,
C378DD7A1C68C2BF003598B8 /* SupplementaryElement.xib in Resources */,
E2762AC01CCCDFDA0009BCAA /* Settings.stringsdict in Resources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "display-p3",
"components" : {
"red" : 0.8784313725,
"alpha" : 1,
"blue" : 0,
"green" : 0.4392156863
}
}
}
]
}
6 changes: 6 additions & 0 deletions ResourceApp/ResourceApp/Media.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
9 changes: 9 additions & 0 deletions ResourceApp/ResourceApp/Media.xcassets/Folder/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"provides-namespace" : true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : 0.7860491071,
"alpha" : 1,
"blue" : 1,
"green" : 1
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : 0.2313725490196079,
"alpha" : 1,
"blue" : 0.9882352941176471,
"green" : 0.6
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "display-p3",
"components" : {
"red" : 0.7215686274999999,
"alpha" : 1,
"blue" : 0.1019607843,
"green" : 0.02745098039
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "display-p3",
"components" : {
"red" : 1,
"alpha" : 1,
"blue" : 1,
"green" : 0.7767578125
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "extended-gray",
"components" : {
"white" : 0,
"alpha" : 0.4
}
}
}
]
}
6 changes: 3 additions & 3 deletions ResourceApp/ResourceAppTests/ColorsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import XCTest
class ColorsTests: XCTestCase {

func testNoNilColors() {
XCTAssertNotNil(R.color.myRSwiftColors.allIsAOK())
XCTAssertNotNil(R.color.myRSwiftColors.severeError())
XCTAssertNotNil(R.color.myRSwiftColors.seeThroughGray)
XCTAssertNotNil(R.clr.myRSwiftColors.allIsAOK())
XCTAssertNotNil(R.clr.myRSwiftColors.severeError())
XCTAssertNotNil(R.clr.myRSwiftColors.seeThroughGray)
}

}
7 changes: 6 additions & 1 deletion ResourceApp/ResourceAppTests/ResourceAppTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ResourceAppTests: XCTestCase {
"warning: [R.swift] Skipping 2 view controllers because symbol 'validationClash' would be generated for all of these view controller identifiers: Validation clash, ValidationClash",
"warning: [R.swift] Skipping 1 reuseIdentifier because no swift identifier can be generated for reuseIdentifier: ' '",
"warning: [R.swift] Skipping 2 colors in palette 'My R.swift colors' because symbol 'black' would be generated for all of these colors: Black, Black?",
"warning: [R.swift] Skipping 2 colors because symbol 'myRed' would be generated for all of these colors: My Red, My Red",

"warning: [R.swift] Skipping 2 strings files because symbol 'duplicate' would be generated for all of these files: Duplicate, Duplicate#",
"warning: [R.swift] Skipping 1 strings file because no swift identifier can be generated for file: '@@'",
Expand Down Expand Up @@ -59,12 +60,16 @@ class ResourceAppTests: XCTestCase {

do {
let logContent = try String(contentsOf: logURL)
let logLines = logContent.components(separatedBy: "\n")
let logLines = logContent.components(separatedBy: "\n").filter { !$0.isEmpty }

for warning in expectedWarnings {
XCTAssertTrue(logLines.contains(warning), "Warning is not logged: '\(warning)'")
}

for logLine in logLines {
XCTAssertTrue(expectedWarnings.contains(logLine), "Warning was not expected: '\(logLine)'")
}

XCTAssertEqual(logLines.count, expectedWarnings.count, "There are more/less warnings then expected")
} catch {
XCTFail("Failed to read rswift.log")
Expand Down
2 changes: 2 additions & 0 deletions Sources/RswiftCore/Generators/AggregatedStructGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class AggregatedStructGenerator: StructGenerator {
.reduce(StructGeneratorResultCollector()) { collector, result in collector.appending(result) }

let externalStruct = Struct(
availables: [],
comments: ["This `\(qualifiedName)` struct is generated and contains references to static resources."],
accessModifier: externalAccessLevel,
type: Type(module: .host, name: structName),
Expand All @@ -38,6 +39,7 @@ class AggregatedStructGenerator: StructGenerator {
)

let internalStruct = Struct(
availables: [],
comments: [],
accessModifier: externalAccessLevel,
type: Type(module: .host, name: internalStructName),
Expand Down
37 changes: 37 additions & 0 deletions Sources/RswiftCore/Generators/AssetSubfolders.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// AssetSubfolders.swift
// Spectre
//
// Created by Tom Lokhorst on 2017-06-06.
//

import Foundation

struct AssetSubfolders {
let folders: [NamespacedAssetSubfolder]
let duplicates: [NamespacedAssetSubfolder]

init(all subfolders: [NamespacedAssetSubfolder], assetIdentifiers: [SwiftIdentifier]) {
var dict: [SwiftIdentifier: NamespacedAssetSubfolder] = [:]

for subfolder in subfolders {
let name = SwiftIdentifier(name: subfolder.name)
if let duplicate = dict[name] {
duplicate.subfolders += subfolder.subfolders
duplicate.imageAssets += subfolder.imageAssets
} else {
dict[name] = subfolder
}
}

self.folders = dict.values.filter { !assetIdentifiers.contains(SwiftIdentifier(name: $0.name)) }
self.duplicates = dict.values.filter { assetIdentifiers.contains(SwiftIdentifier(name: $0.name)) }
}

func printWarningsForDuplicates() {
for subfolder in duplicates {
warn("Skipping asset subfolder because symbol '\(subfolder.name)' would conflict with image: \(subfolder.name)")
}
}
}

Loading