1
0
Fork 0
gobject-generator/Sources/SwiftGtkGenCore/CodeGen.swift
Brendan Szymanski c20015be48 Complete Phase E4 tier-5 Gtk pointer-hiding and smoke coverage
Hides pointer storage/init behind @_spi(SGTKInternal) across boxed records
and interface Ref wrappers, marks interface Ref classes @MainActor,
threads boxed-record hasCopyFunction through GValue ops, and qualifies
re-exported dependency imports @_spi(SGTKInternal). Adds the tier-5
GtkSmoke display-free runtime smoke suite.
2026-07-20 21:58:51 -04:00

27 lines
1.1 KiB
Swift

import Foundation
/// Minimal shim keeping the scaffolding extensions (`CodeGen+Scaffolding.swift`)
/// compilable. The old code-generation engine was deleted in B7; only the
/// Package.swift / module-map / umbrella-header generation survives here.
public struct CodeGenerator {
public init() {}
// MARK: - Re-export umbrella files
/// Generates `@_exported import` umbrella files so every dependency is
/// available through a single import of this module.
static func generateReexportUmbrellas(analysis: MultiPackageAnalysis) -> [String: String] {
var files: [String: String] = [:]
let header = "// Generated by SwiftGtkGen. DO NOT EDIT.\n\n"
for (moduleName, transitive) in analysis.transitiveDependencies {
guard !transitive.isEmpty else { continue }
var content = header
for dep in transitive.sorted() {
content += "@_spi(SGTKInternal) @_exported import \(dep)\n"
}
content += "\n"
files["Sources/\(moduleName)/\(moduleName).swift"] = content
}
return files
}
}