Add CLI and Swift Package Manager Plugin#4
Conversation
This reverts commit 90b920e.
…StandAloneGeneratorPlugin and SwiftLibraryGeneratorPlugin
|
Inside of this P/R I noticed a problem with how inherited node own types were being resolved. Given the following lexicon:
A test has been added to ensure this case is covered await root["user", "id"].is(root["db", "collection", "id"]) == true |
|
You can validate the plugins via this test package: // swift-tools-version: 5.6
import PackageDescription
let package = Package(
name: "Test",
platforms: [.macOS(.v11)],
products: [
.library(name: "Test", targets: ["Test"])
],
dependencies: [
.package(url: "https://github.com/thousandyears/Lexicon", branch: "oliver/swift-package-manager-plugin")
],
targets: [
.target(
name: "Test",
resources: [
.copy("example.taskpaper")
],
plugins: [
.plugin(name: "SwiftStandAloneGeneratorPlugin", package: "Lexicon")
]
)
]
) |
|
I've tested the plugin on macOS 13.0 Beta and XCode 14.0 Beta and it works 👍. |
1 similar comment
|
I've tested the plugin on macOS 13.0 Beta and XCode 14.0 Beta and it works 👍. |
screensailor
left a comment
There was a problem hiding this comment.
Minor questions about naming conventions...
Wonderful to have the command line tool and the plugins!
And super important to also have the fix for the types of inherited nodes!
Thank you Ollie
|
@screensailor I also added the ability to pass a http URL to the generator, possibly useful in certain scenarios: lexicon-generate https://raw.githubusercontent.com/thousandyears/MindFlare/trunk/App/Library/Sources/Library/Resources/Test.lexicon --output /tmp/test --type swift |
|
URL argument is a lovely option Ollie 👍 |
NoahKnudsen
left a comment
There was a problem hiding this comment.
Excellent work Ollie! This is a huge improvement to workflows!
Add
lexicon-generateCLI and a Swift Package Manager Plugin for automatically generating swift identifiers from lexicon documents.CLI
Plugin