Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Plugin, Commit Generated Code #621

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sources/SwiftGodot/Generated linguist-generated=true
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Godot 4+ specific ignores
.godot/
.DS_Store
/.build
/.index-build
.build/
.index-build/
/Packages
/*.xcodeproj
xcuserdata/
Expand All @@ -17,6 +17,5 @@ build-docs.log
\#*
/libgodot.xcframework/
Package.resolved
/.vscode
.vscode
.swiftpm/xcode/xcshareddata/xcschemes
GeneratedForDebug/
Empty file added .no-swift-format
Empty file.
8 changes: 4 additions & 4 deletions Generator/Generator/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ var defaultExtensionApiJsonUrl: URL {

var defaultGeneratorOutputlUrl: URL {
rootUrl
.appendingPathComponent("GeneratedForDebug")
.appendingPathComponent("Sources")
.appendingPathComponent("SwiftGodot")
.appendingPathComponent("Generated")
}

var defaultDocRootUrl: URL {
rootUrl
.appendingPathComponent("GeneratedForDebug")
.appendingPathComponent("Docs")
}

Expand Down Expand Up @@ -138,8 +138,8 @@ for mo in jsonApi.builtinClassMemberOffsets {
}
}

let generatedBuiltinDir: String? = singleFile ? nil : (outputDir + "/generated-builtin/")
let generatedDir: String? = singleFile ? nil : (outputDir + "/generated/")
let generatedBuiltinDir: String? = singleFile ? nil : (outputDir + "/Builtin/")
let generatedDir: String? = singleFile ? nil : (outputDir + "/Api/")

if singleFile {
try! FileManager.default.createDirectory(atPath: outputDir, withIntermediateDirectories: true)
Expand Down
14 changes: 1 addition & 13 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var products: [Product] = [
"ExtensionApi",
"ExtensionApiJson"
]),
.plugin(name: "CodeGeneratorPlugin", targets: ["CodeGeneratorPlugin"]),
.plugin(name: "EntryPointGeneratorPlugin", targets: ["EntryPointGeneratorPlugin"])
]

Expand Down Expand Up @@ -93,14 +92,6 @@ var targets: [Target] = [
]
),

// This is a build-time plugin that invokes the generator and produces
// the bindings that are compiled into SwiftGodot
.plugin(
name: "CodeGeneratorPlugin",
capability: .buildTool(),
dependencies: ["Generator"]
),

.plugin(
name: "EntryPointGeneratorPlugin",
capability: .buildTool(),
Expand All @@ -112,8 +103,6 @@ var targets: [Target] = [
name: "GDExtension"),
]

var swiftGodotPlugins: [Target.PluginUsage] = ["CodeGeneratorPlugin"]

// Macros aren't supported on Windows before 5.9.1
#if !(os(Windows) && swift(<5.9.1))
targets.append(contentsOf: [
Expand All @@ -133,7 +122,6 @@ targets.append(contentsOf: [
exclude: ["SwiftSprite.gdextension", "README.md"]),
//linkerSettings: linkerSettings),
])
swiftGodotPlugins.append("SwiftGodotMacroLibrary")
#endif

// Macro tests don't work on Windows yet
Expand Down Expand Up @@ -214,7 +202,7 @@ targets.append(contentsOf: [
swiftSettings: [
.define("CUSTOM_BUILTIN_IMPLEMENTATIONS")
],
plugins: swiftGodotPlugins
plugins: ["SwiftGodotMacroLibrary"]
),

// General purpose cross-platform tests
Expand Down
Loading