-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add schema functionality to directives
- Loading branch information
1 parent
3b3df19
commit 67b3c2a
Showing
6 changed files
with
104 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import Foundation | ||
import OrionProcessor | ||
|
||
// NOTE: These fixtures double as the glue file for Hooks.x.swift | ||
// NOTE: These fixtures double as the glue file for the runtime tests | ||
|
||
let engine = OrionDiagnosticEngine() | ||
engine.addConsumer(.printing) | ||
// we want to scope this so that the objects' deinits are called | ||
do { | ||
let engine = OrionDiagnosticEngine() | ||
engine.addConsumer(.printing) | ||
|
||
let orionTests = URL(fileURLWithPath: #file).deletingLastPathComponent().appendingPathComponent("../../Tests/OrionTests") | ||
let orionTests = URL(fileURLWithPath: #filePath) | ||
.deletingLastPathComponent() | ||
.appendingPathComponent("../../Tests/OrionTests") | ||
|
||
let data = try OrionBatchParser(inputs: [orionTests], diagnosticEngine: engine).parse() | ||
let options = OrionGenerator.Options(emitSourceLocations: false) | ||
let generator = OrionGenerator(data: data, diagnosticEngine: engine, options: options) | ||
let glue = try generator.generate() | ||
let parserOptions = OrionParser.Options() | ||
let data = try OrionBatchParser(inputs: [orionTests], diagnosticEngine: engine, options: parserOptions).parse() | ||
let generatorOptions = OrionGenerator.Options(emitSourceLocations: false) | ||
let generator = OrionGenerator(data: data, diagnosticEngine: engine, options: generatorOptions) | ||
let glue = try generator.generate() | ||
|
||
let dest = orionTests.appendingPathComponent("Generated.xc.swift") | ||
try glue.write(to: dest, atomically: true, encoding: .utf8) | ||
let dest = orionTests.appendingPathComponent("Generated.xc.swift") | ||
try glue.write(to: dest, atomically: true, encoding: .utf8) | ||
|
||
print("Wrote glue file to \(dest.standardized.path)") | ||
print("Wrote glue file to \(dest.standardized.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
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