Noob question - how to run the TrivialSample
hyouuu opened this issue · comments
If I do swift main.swift
then I get:
main.swift:10:8: error: no such module 'SwiftGodot'
import SwiftGodot
Do I create a Package.swift within the same folder or did I get this wrong completely?
Thanks!
Yes you need to have a Package.swift that references this module.
Could you provide an example file? I tried this:
// swift-tools-version:5.8
import PackageDescription
let package = Package(
name: "Banban",
platforms: [
.macOS(.v12),
],
dependencies: [
.package(url: "https://github.com/migueldeicaza/SwiftGodotKit.git", branch: "main")
],
targets: [
.target(name: "App", dependencies: [
.product(name: "SwiftGodotKit", package: "SwiftGodotKit"),
]),
.executableTarget(name: "Run", dependencies: [
.target(name: "App"),
]),
]
)
And calling swift Package.swift
gives Package.swift:2:8: error: no such module 'PackageDescription'
For context I only have the main.swift
& Package.swift
in the folder
Sorry I have only used Xcode's built in way to create projects and run them
You Can also create a sample Mac app, then reference this module and get started. Or use “swift package init”
I added a standalone example to show how it works:
https://github.com/migueldeicaza/SwiftGodotKit/tree/main/StandaloneExample
And I packed a sample program with Xcode here:
Perfect thank you so much!!