diff --git a/Package.resolved b/Package.resolved index efa056b4..c1e74864 100644 --- a/Package.resolved +++ b/Package.resolved @@ -24,8 +24,8 @@ "repositoryURL": "https://github.com/tomlokhorst/XcodeEdit", "state": { "branch": null, - "revision": "1055ca180cbea0405b2b98707e79872772b7fe7b", - "version": "2.5.0" + "revision": "90fd97fd8b298319edbb5093f5825b8b44e48680", + "version": "2.5.2" } } ] diff --git a/Package.swift b/Package.swift index 3fa567a8..79b45221 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.4.1") + .package(url: "https://github.com/tomlokhorst/XcodeEdit", from: "2.5.0") ], targets: [ .target( diff --git a/Podfile.lock b/Podfile.lock index e130c58b..0f5b06ad 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - R.swift.Library (5.0.0.alpha.2) + - R.swift.Library (5.0.0) - SWRevealViewController (2.3.0) DEPENDENCIES: @@ -16,11 +16,11 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: R.swift.Library: - :commit: cb11aec9943393c9903b3623068207b26c9e246b + :commit: 03b3f069f43cab162eaba6e395fd293b6787e022 :git: https://github.com/mac-cain13/R.swift.Library.git SPEC CHECKSUMS: - R.swift.Library: 3c21b823839bf5a6769dc7f96cb44479dab51b1b + R.swift.Library: 0bf390e729bc10bb2c9e4fb78bd043164a7be4ff SWRevealViewController: 6d3fd97f70112fd7cef9de14df4260eacce4c63a PODFILE CHECKSUM: dcf609a63a9cb222b7167b110c27de036120bae0 diff --git a/README.md b/README.md index d41b6fec..a6bd8093 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ _Tip:_ Add the `*.generated.swift` pattern to your `.gitignore` file to prevent R.swift is built using [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager). 1. Check out the code -2. Run `swift build -c release -Xswiftc -static-stdlib` from the root directory +2. Run `swift build -c release -Xswiftc -static-stdlib -Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.11"` from the root directory 3. Follow the manual installation steps with the binary you now have For developing on R.swift in Xcode, run `swift package generate-xcodeproj --xcconfig-overrides RswiftConfig.xcconfig`. diff --git a/RswiftConfig.xcconfig b/RswiftConfig.xcconfig index 4bbe7f6a..bb1a8145 100644 --- a/RswiftConfig.xcconfig +++ b/RswiftConfig.xcconfig @@ -14,3 +14,6 @@ CONFIGURATION_BUILD_DIR = $(SRCROOT)/build/$CONFIGURATION // The final product executables and other build products go here BUILT_PRODUCTS_DIR = $(SRCROOT)/build/$CONFIGURATION + +// Mac OS SDK 10.11 +MACOSX_DEPLOYMENT_TARGET = 10.11 diff --git a/Sources/RswiftCore/EnvironmentValidation.swift b/Sources/RswiftCore/EnvironmentValidation.swift index 4c37cdcb..ef3ae69d 100644 --- a/Sources/RswiftCore/EnvironmentValidation.swift +++ b/Sources/RswiftCore/EnvironmentValidation.swift @@ -14,6 +14,7 @@ public func validateRswiftEnvironment( scriptOutputFiles: [String], lastRunURL: URL, podsRoot: String?, + podsTargetSrcroot: String?, commandLineArguments: [String]) -> [String] { var errors: [String] = [] @@ -24,9 +25,11 @@ public func validateRswiftEnvironment( var error = "Output path must specify a file, it should not be a directory." if FileManager.default.directoryExists(atPath: outputURL.path) { let rswiftGeneratedFile = outputURL.appendingPathComponent("R.generated.swift").path + let commandParts = commandLineArguments - .map { $0.replacingOccurrences(of: podsRoot ?? "", with: "$PODS_ROOT") } .map { $0.replacingOccurrences(of: outputURL.path, with: rswiftGeneratedFile) } + .map { $0.replacingOccurrences(of: podsTargetSrcroot ?? "", with: "$PODS_TARGET_SRCROOT") } + .map { $0.replacingOccurrences(of: podsRoot ?? "", with: "$PODS_ROOT") } .map { $0.replacingOccurrences(of: sourceRootPath, with: "$SRCROOT") } .map { $0.contains(" ") ? "\"\($0)\"" : $0 } @@ -38,12 +41,16 @@ public func validateRswiftEnvironment( errors.append(error) } - if !scriptInputFiles.contains(lastRunURL.path) { + let scriptInputPaths = scriptInputFiles.map { URL(fileURLWithPath: $0).standardized.path } + if !scriptInputPaths.contains(lastRunURL.standardized.path) { errors.append("Build phase Intput Files does not contain '$TEMP_DIR/\(lastRunURL.lastPathComponent)'.") } - if !scriptOutputFiles.contains(outputURL.path) { - let path = outputFileForError.replacingOccurrences(of: sourceRootPath, with: "$SRCROOT") + let scriptOutputPaths = scriptOutputFiles.map { URL(fileURLWithPath: $0).standardized.path } + if !scriptOutputPaths.contains(outputURL.standardized.path) && !scriptOutputPaths.contains(outputFileForError) { + let path = outputFileForError + .replacingOccurrences(of: podsTargetSrcroot ?? "", with: "$PODS_TARGET_SRCROOT") + .replacingOccurrences(of: sourceRootPath, with: "$SRCROOT") errors.append("Build phase Output Files do not contain '\(path)'.") } diff --git a/Sources/rswift/main.swift b/Sources/rswift/main.swift index b59aeef8..7c7cc13a 100644 --- a/Sources/rswift/main.swift +++ b/Sources/rswift/main.swift @@ -139,6 +139,7 @@ let generate = command( scriptOutputFiles: scriptOutputFiles, lastRunURL: lastRunURL, podsRoot: processInfo.environment["PODS_ROOT"], + podsTargetSrcroot: processInfo.environment["PODS_TARGET_SRCROOT"], commandLineArguments: CommandLine.arguments) guard errors.isEmpty else { for error in errors {