diff --git a/Package.resolved b/Package.resolved index 4ca1b8cf..89519532 100644 --- a/Package.resolved +++ b/Package.resolved @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/tomlokhorst/XcodeEdit", "state": { "branch": null, - "revision": "327900c5253a695120469d58374ee157e498e1c2", - "version": "2.3.0" + "revision": "5c73385537c8546816f0b5c04bb4060e40711046", + "version": "2.4.1" } } ] diff --git a/Package.swift b/Package.swift index ed9ed360..bf70f1a3 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", from: "0.8.0"), - .package(url: "https://github.com/tomlokhorst/XcodeEdit", from: "2.3.0") + .package(url: "https://github.com/tomlokhorst/XcodeEdit", from: "2.4.1") ], targets: [ .target( diff --git a/ResourceApp/ResourceApp.xcodeproj/project.pbxproj b/ResourceApp/ResourceApp.xcodeproj/project.pbxproj index 6641ca94..596bb5d2 100644 --- a/ResourceApp/ResourceApp.xcodeproj/project.pbxproj +++ b/ResourceApp/ResourceApp.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - DEADBEEFDEADBEEFDEADBEEF /* Dummy build file that is'nt used */ = {isa = PBXBuildFile; fileRef = C0FEFEC0FEFEC0FEFEC0FEFE /* Localizable.strings */; }; 5D1AFAB11C858637003FE7AB /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5D1AFAAF1C858637003FE7AB /* Localizable.strings */; }; 5D9E41341C96918E002172D3 /* StringsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D9E41331C96918E002172D3 /* StringsTests.swift */; }; 8A0FBCE6E8FF0950B8821B0B /* Pods_Shared_ResourceApp_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EF513940333862726B930435 /* Pods_Shared_ResourceApp_tvOS.framework */; }; @@ -813,10 +812,11 @@ ); name = R.swift; outputPaths = ( + "$(SRCROOT)/R.generated.swift", ); 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\"\n"; }; DEF559A61CA487D6009B8C51 /* R.swift */ = { isa = PBXShellScriptBuildPhase; diff --git a/Sources/RswiftCore/CallInformation.swift b/Sources/RswiftCore/CallInformation.swift index 43641271..5b93f1f7 100644 --- a/Sources/RswiftCore/CallInformation.swift +++ b/Sources/RswiftCore/CallInformation.swift @@ -26,6 +26,7 @@ public struct CallInformation { private let developerDirURL: URL private let sourceRootURL: URL private let sdkRootURL: URL + private let platformURL: URL public init( outputURL: URL, @@ -42,7 +43,8 @@ public struct CallInformation { buildProductsDirURL: URL, developerDirURL: URL, sourceRootURL: URL, - sdkRootURL: URL + sdkRootURL: URL, + platformURL: URL ) { self.outputURL = outputURL self.rswiftIgnoreURL = rswiftIgnoreURL @@ -59,6 +61,7 @@ public struct CallInformation { self.developerDirURL = developerDirURL self.sourceRootURL = sourceRootURL self.sdkRootURL = sdkRootURL + self.platformURL = platformURL } @@ -72,6 +75,8 @@ public struct CallInformation { return sdkRootURL case .sourceRoot: return sourceRootURL + case .platformDir: + return platformURL } } } diff --git a/Sources/rswift/main.swift b/Sources/rswift/main.swift index 9b529e24..d29fa9f1 100644 --- a/Sources/rswift/main.swift +++ b/Sources/rswift/main.swift @@ -52,6 +52,7 @@ struct EnvironmentKeys { static let developerDir = SourceTreeFolder.developerDir.rawValue static let sourceRoot = SourceTreeFolder.sourceRoot.rawValue static let sdkRoot = SourceTreeFolder.sdkRoot.rawValue + static let platformDir = SourceTreeFolder.platformDir.rawValue } // Options grouped in struct for readability @@ -69,6 +70,7 @@ struct CommanderOptions { static let developerDir = Option("developerDir", default: EnvironmentKeys.developerDir, description: "Developer folder that Xcode uses during build.") static let sourceRoot = Option("sourceRoot", default: EnvironmentKeys.sourceRoot, description: "Source root folder that Xcode uses during build.") static let sdkRoot = Option("sdkRoot", default: EnvironmentKeys.sdkRoot, description: "SDK root folder that Xcode uses during build.") + static let platformDir = Option("platformDir", default: EnvironmentKeys.platformDir, description: "Platform folder folder that Xcode uses during build.") } @@ -107,6 +109,7 @@ let generate = command( let developerDirPath = try info.value(from: developerDir, name: "developerDir", key: EnvironmentKeys.developerDir) let sourceRootPath = try info.value(from: sourceRoot, name: "sourceRoot", key: EnvironmentKeys.sourceRoot) let sdkRootPath = try info.value(from: sdkRoot, name: "sdkRoot", key: EnvironmentKeys.sdkRoot) + let platformPath = try info.value(from: sdkRoot, name: "platformDir", key: EnvironmentKeys.platformDir) let outputURL = URL(fileURLWithPath: outputDir).appendingPathComponent(Rswift.resourceFileName, isDirectory: false) @@ -133,7 +136,8 @@ let generate = command( buildProductsDirURL: URL(fileURLWithPath: buildProductsDirPath), developerDirURL: URL(fileURLWithPath: developerDirPath), sourceRootURL: URL(fileURLWithPath: sourceRootPath), - sdkRootURL: URL(fileURLWithPath: sdkRootPath) + sdkRootURL: URL(fileURLWithPath: sdkRootPath), + platformURL: URL(fileURLWithPath: platformPath) ) try RswiftCore.run(callInformation)