Defined the products, dependencies, and targets in the Package file.
This commit is contained in:
+40
-12
@@ -1,26 +1,54 @@
|
|||||||
// swift-tools-version: 6.2
|
// swift-tools-version: 5.10
|
||||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
|
||||||
|
|
||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
name: "marvel-service",
|
name: MarvelService.package,
|
||||||
|
platforms: [
|
||||||
|
.iOS(.v13),
|
||||||
|
.macOS(.v10_15),
|
||||||
|
.tvOS(.v13),
|
||||||
|
.visionOS(.v1),
|
||||||
|
.watchOS(.v6)
|
||||||
|
],
|
||||||
products: [
|
products: [
|
||||||
// Products define the executables and libraries a package produces, making them visible to other packages.
|
|
||||||
.library(
|
.library(
|
||||||
name: "marvel-service",
|
name: MarvelService.package,
|
||||||
targets: ["marvel-service"]
|
targets: [MarvelService.target]
|
||||||
),
|
)
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
.package(url: "https://github.com/apple/swift-openapi-generator.git", from: "1.3.0"),
|
||||||
|
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.5.0"),
|
||||||
|
.package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.2"),
|
||||||
|
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0")
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
|
||||||
// Targets can depend on other targets in this package and products from dependencies.
|
|
||||||
.target(
|
.target(
|
||||||
name: "marvel-service"
|
name: MarvelService.target,
|
||||||
|
dependencies: [
|
||||||
|
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
|
||||||
|
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession")
|
||||||
|
],
|
||||||
|
path: "Sources/MarvelService",
|
||||||
|
plugins: [
|
||||||
|
.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator")
|
||||||
|
]
|
||||||
),
|
),
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "marvel-serviceTests",
|
name: MarvelService.test,
|
||||||
dependencies: ["marvel-service"]
|
dependencies: [
|
||||||
|
.byName(name: MarvelService.target)
|
||||||
|
],
|
||||||
|
path: "Tests/MarvelService"
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// MARK: - Constants
|
||||||
|
|
||||||
|
enum MarvelService {
|
||||||
|
static let package = "marvel-service"
|
||||||
|
static let target = "AmiiboMarvelService"
|
||||||
|
static let test = "\(MarvelService.target)Tests"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user