From e7f427fd7d497170a9fb74f43c86648ffea2332c Mon Sep 17 00:00:00 2001 From: Tom Lokhorst Date: Wed, 7 Dec 2022 16:56:31 +0100 Subject: [PATCH] Generate fully qualified names for Color/Data/Image resources Fixes https://github.com/mac-cain13/R.swift/issues/781 --- Sources/RswiftGenerators/AssetCatalog+Generator.swift | 6 +++--- Sources/RswiftGenerators/Storyboard+Generator.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/RswiftGenerators/AssetCatalog+Generator.swift b/Sources/RswiftGenerators/AssetCatalog+Generator.swift index a4363165..6f3c46ce 100644 --- a/Sources/RswiftGenerators/AssetCatalog+Generator.swift +++ b/Sources/RswiftGenerators/AssetCatalog+Generator.swift @@ -104,7 +104,7 @@ extension ColorResource: AssetCatalogContent { return VarGetter( comments: ["Color `\(fullname)`."], name: SwiftIdentifier(name: name), - typeReference: TypeReference(module: .host, rawName: "ColorResource"), + typeReference: TypeReference(module: .rswiftResources, rawName: "ColorResource"), valueCodeString: code ) } @@ -118,7 +118,7 @@ extension DataResource: AssetCatalogContent { return VarGetter( comments: ["Data asset `\(fullname)`."], name: SwiftIdentifier(name: name), - typeReference: TypeReference(module: .host, rawName: "DataResource"), + typeReference: TypeReference(module: .rswiftResources, rawName: "DataResource"), valueCodeString: code ) } @@ -133,7 +133,7 @@ extension ImageResource: AssetCatalogContent { return VarGetter( comments: ["Image `\(fullname)`."], name: SwiftIdentifier(name: name), - typeReference: TypeReference(module: .host, rawName: "ImageResource"), + typeReference: TypeReference(module: .rswiftResources, rawName: "ImageResource"), valueCodeString: code ) } diff --git a/Sources/RswiftGenerators/Storyboard+Generator.swift b/Sources/RswiftGenerators/Storyboard+Generator.swift index 991aae1b..1658acc4 100644 --- a/Sources/RswiftGenerators/Storyboard+Generator.swift +++ b/Sources/RswiftGenerators/Storyboard+Generator.swift @@ -202,7 +202,7 @@ private extension StoryboardResource.ViewController { VarGetter( name: SwiftIdentifier(name: identifier), typeReference: genericTypeReference, - valueCodeString: #"StoryboardViewControllerIdentifier(identifier: "\#(identifier.escapedStringLiteral)", storyboard: name, bundle: bundle)"# + valueCodeString: #".init(identifier: "\#(identifier.escapedStringLiteral)", storyboard: name, bundle: bundle)"# ) } }