kc3hack/2023_C

ViewモジュールからCoreモジュールを参照する

miyaji255 opened this issue · 2 comments

ViewモジュールからCoreモジュールを参照する

Package.swiftのproductsと同じ階層でと追加すればいけそう?

dependencies : [
    .package(path: "../calculator-for-iPad.core")
],
targets: [
        .executableTarget(
            name: "AppModule",
            path: ".",
            dependencies: ["calculator-for-iPad.core"]
        )
    ]
// swift-tools-version: 5.6

// WARNING:
// This file is automatically generated.
// Do not edit it by hand because the contents will be replaced.

import PackageDescription
import AppleProductTypes

let package = Package(
    name: "calculator-for-iPad",
    platforms: [
        .iOS("15.2")
    ],
    products: [
        .iOSApplication(
            name: "calculator-for-iPad",
            targets: ["AppModule"],
            bundleIdentifier: "com.KC3-2023-C.calculator-for-iPad",
            displayVersion: "1.0",
            bundleVersion: "1",
            appIcon: .placeholder(icon: .pencil),
            accentColor: .presetColor(.cyan),
            supportedDeviceFamilies: [
                .pad,
                .phone
            ],
            supportedInterfaceOrientations: [
                .portrait,
                .landscapeRight,
                .landscapeLeft,
                .portraitUpsideDown(.when(deviceFamilies: [.pad]))
            ]
        )
    ],
    dependencies : [
        .package(path: "../calculator-for-iPad.core")
    ],
    targets: [
            .executableTarget(
                name: "AppModule",
                dependencies: ["calculator-for-iPad.core"],
                path: "."
            )
        ]
)

このようにすると

product 'calculator-for-iPad.core' required by package 'calculator-for-ipad.swiftpm' target 'AppModule' not found.

このようなエラーが出ます。