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
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions ResourceApp/ResourceApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion Sources/RswiftCore/CallInformation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -59,6 +61,7 @@ public struct CallInformation {
self.developerDirURL = developerDirURL
self.sourceRootURL = sourceRootURL
self.sdkRootURL = sdkRootURL
self.platformURL = platformURL
}


Expand All @@ -72,6 +75,8 @@ public struct CallInformation {
return sdkRootURL
case .sourceRoot:
return sourceRootURL
case .platformDir:
return platformURL
}
}
}
6 changes: 5 additions & 1 deletion Sources/rswift/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.")
}


Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down