-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow remapping indexstores to multiple target names
This isn’t exercised yet. Incremental generation will use it. Signed-off-by: Brentley Jones <[email protected]>
- Loading branch information
1 parent
386feed
commit 41a7147
Showing
10 changed files
with
245 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Foundation | ||
|
||
extension ImportIndex { | ||
static func `import`( | ||
_ indexstores: Set<String>, | ||
into indexDataStoreDir: URL, | ||
arch: String, | ||
developerDir: String, | ||
indexImport: String, | ||
objectFilePrefix: String, | ||
projectDirPrefix: String, | ||
srcRoot: String, | ||
targetNameOverride: String?, | ||
xcodeExecutionRoot: String, | ||
xcodeOutputBase: String | ||
) throws { | ||
let filelistContent = indexstores | ||
.map { projectDirPrefix + $0 + "\n" } | ||
.joined() | ||
|
||
let filelist = try TemporaryFile() | ||
try filelistContent | ||
.write(to: filelist.url, atomically: true, encoding: .utf8) | ||
|
||
let remaps = remapArgs( | ||
arch: arch, | ||
developerDir: developerDir, | ||
objectFilePrefix: objectFilePrefix, | ||
srcRoot: srcRoot, | ||
targetNameOverride: targetNameOverride, | ||
xcodeExecutionRoot: xcodeExecutionRoot, | ||
xcodeOutputBase: xcodeOutputBase | ||
) | ||
|
||
try runSubProcess( | ||
indexImport, | ||
remaps + [ | ||
"-undo-rules_swift-renames", | ||
"-incremental", | ||
"@\(filelist.url.path)", | ||
indexDataStoreDir.path, | ||
] | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.