diff --git a/.gitignore b/.gitignore index 3c2d917..405c589 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,10 @@ Package.resolved # Xcode DerivedData/ build/ +# A-6: generated by `xcodegen generate` from project.yml (the source of truth). Regenerate, don't commit. +*.xcodeproj/ +Support/Info.plist +Support/DSApp.entitlements *.xcodeproj/project.xcworkspace/xcuserdata/ *.xcodeproj/xcuserdata/ *.xcworkspace/xcuserdata/ diff --git a/Sources/DSApp/DSApp.swift b/App/DSApp.swift similarity index 100% rename from Sources/DSApp/DSApp.swift rename to App/DSApp.swift diff --git a/Package.swift b/Package.swift index b4b6a1b..f73f6cd 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,13 @@ // It is also exposed as a library product so a future separate app package could depend on it. // // Ownership boundary unchanged: S2 owns Sources/AI/** + Tests/AITests/**; S3 owns DSKit / AppFeature -// / DSApp / Tests/DSKitTests. S3 consumes AIFabric read-only. +// / Tests/DSKitTests. S3 consumes AIFabric read-only. +// +// A-6 (Xcode .app target via xcodegen): the runnable macOS app shell lives in App/DSApp.swift, owned +// by the xcodegen "DSApp" application target (project.yml), NOT by SPM. SPM here builds only the +// libraries + tests, so `swift build` / `swift test` stay backend-free and the executable lives in +// the real .app bundle (Info.plist + entitlements) where Cmd+R actually opens a window. The App +// target depends on the AppFeature library product below. import PackageDescription let package = Package( @@ -17,6 +23,8 @@ let package = Package( ], products: [ .library(name: "AIFabric", targets: ["AIFabric"]), + // Consumed by the xcodegen "DSApp" .app target (App/DSApp.swift). + .library(name: "AppFeature", targets: ["AppFeature"]), ], targets: [ .target( @@ -34,11 +42,6 @@ let package = Package( dependencies: ["DSKit", "AIFabric"], swiftSettings: [.swiftLanguageMode(.v6)] ), - .executableTarget( - name: "DSApp", - dependencies: ["AppFeature"], - swiftSettings: [.swiftLanguageMode(.v6)] - ), .testTarget( name: "DSKitTests", dependencies: ["DSKit", "AIFabric"], diff --git a/project.yml b/project.yml new file mode 100644 index 0000000..ba780af --- /dev/null +++ b/project.yml @@ -0,0 +1,76 @@ +# A-6 — real macOS .app target for the DS app shell. +# +# Why this exists: opening Package.swift directly in Xcode produced an *executable* SwiftPM target +# with no .app bundle / Info.plist, so macOS treated it as an accessory and Cmd+R never opened a +# window (see ds-native-app-program memory). This generates a proper application target whose @main +# lives in App/DSApp.swift and which links the AppFeature library product from the local SwiftPM +# package. project.yml is the source of truth; DSApp.xcodeproj + Support/*.plist|.entitlements are +# generated artifacts (gitignored). Regenerate with: xcodegen generate +name: DSApp +options: + bundleIdPrefix: net.hyungi + deploymentTarget: + macOS: "26.0" + createIntermediateGroups: true + minimumXcodeGenVersion: "2.40.0" + +settings: + base: + SWIFT_VERSION: "6.0" # Swift 6 language mode (matches package .swiftLanguageMode(.v6)) + SWIFT_STRICT_CONCURRENCY: complete + MACOSX_DEPLOYMENT_TARGET: "26.0" + CODE_SIGN_STYLE: Automatic + # Local dev: no signing identity needed to build/run on this Mac. + CODE_SIGNING_ALLOWED: "NO" + CODE_SIGNING_REQUIRED: "NO" + +packages: + # Local SwiftPM package = this repo (Package.swift): AIFabric + DSKit + AppFeature libraries. + DSPackage: + path: . + +targets: + DSApp: + type: application + platform: macOS + deploymentTarget: "26.0" + sources: + - path: App # App/DSApp.swift only — @main window + DI shell + dependencies: + - package: DSPackage + product: AppFeature + settings: + base: + PRODUCT_BUNDLE_IDENTIFIER: net.hyungi.dsapp + PRODUCT_NAME: DS + GENERATE_INFOPLIST_FILE: "NO" + MARKETING_VERSION: "0.1" + CURRENT_PROJECT_VERSION: "1" + ENABLE_HARDENED_RUNTIME: "YES" + info: + path: Support/Info.plist + properties: + CFBundleName: DS + CFBundleDisplayName: DS + CFBundleShortVersionString: "0.1" + CFBundleVersion: "1" + CFBundlePackageType: APPL + LSMinimumSystemVersion: "26.0" + LSApplicationCategoryType: public.app-category.productivity + NSHumanReadableCopyright: "" + entitlements: + path: Support/DSApp.entitlements + properties: + com.apple.security.app-sandbox: true + com.apple.security.network.client: true # LiveDSClient HTTP → DS / mac mini :8890 + com.apple.security.files.user-selected.read-write: true # FU-C upload / FU-D download save + +schemes: + DSApp: + build: + targets: + DSApp: all + run: + config: Debug + test: + config: Debug