-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor generic project support, closes #778
- Loading branch information
Showing
37 changed files
with
376 additions
and
335 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 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 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 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 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 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 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 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,41 @@ | ||
import Foundation | ||
import Shared | ||
import SourceGraph | ||
|
||
public struct IndexPipeline { | ||
private let plan: IndexPlan | ||
private let graph: SourceGraph | ||
private let logger: ContextualLogger | ||
|
||
public init(plan: IndexPlan, graph: SourceGraph, logger: ContextualLogger) { | ||
self.plan = plan | ||
self.graph = graph | ||
self.logger = logger | ||
} | ||
|
||
public func perform() throws { | ||
try SwiftIndexer( | ||
sourceFiles: plan.sourceFiles, | ||
graph: graph, | ||
logger: logger | ||
).perform() | ||
|
||
if !plan.plistPaths.isEmpty { | ||
try InfoPlistIndexer(infoPlistFiles: plan.plistPaths, graph: graph).perform() | ||
} | ||
|
||
if !plan.xibPaths.isEmpty { | ||
try XibIndexer(xibFiles: plan.xibPaths, graph: graph).perform() | ||
} | ||
|
||
if !plan.xcDataModelPaths.isEmpty { | ||
try XCDataModelIndexer(files: plan.xcDataModelPaths, graph: graph).perform() | ||
} | ||
|
||
if !plan.xcMappingModelPaths.isEmpty { | ||
try XCMappingModelIndexer(files: plan.xcMappingModelPaths, graph: graph).perform() | ||
} | ||
|
||
graph.indexingComplete() | ||
} | ||
} |
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,25 @@ | ||
import Foundation | ||
import SystemPackage | ||
import SourceGraph | ||
|
||
public struct IndexPlan { | ||
public let sourceFiles: [SourceFile : [IndexUnit]] | ||
public let plistPaths: Set<FilePath> | ||
public let xibPaths: Set<FilePath> | ||
public let xcDataModelPaths: Set<FilePath> | ||
public let xcMappingModelPaths: Set<FilePath> | ||
|
||
public init( | ||
sourceFiles: [SourceFile : [IndexUnit]], | ||
plistPaths: Set<FilePath> = [], | ||
xibPaths: Set<FilePath> = [], | ||
xcDataModelPaths: Set<FilePath> = [], | ||
xcMappingModelPaths: Set<FilePath> = [] | ||
) { | ||
self.sourceFiles = sourceFiles | ||
self.plistPaths = plistPaths | ||
self.xibPaths = xibPaths | ||
self.xcDataModelPaths = xcDataModelPaths | ||
self.xcMappingModelPaths = xcMappingModelPaths | ||
} | ||
} |
Oops, something went wrong.