Basic package setup #1

Merged
javier merged 6 commits from setup/package into main 2024-09-07 07:46:59 +00:00
3 changed files with 24 additions and 10 deletions
Showing only changes of commit 37512df49e - Show all commits

View File

@ -3,21 +3,34 @@
import PackageDescription
let package = Package(
name: "amiibo-api",
name: AmiiboAPI.package,
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "amiibo-api",
targets: ["amiibo-api"]),
name: AmiiboAPI.package,
targets: [
AmiiboAPI.target
]
)
],
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(
name: "amiibo-api"),
name: AmiiboAPI.target,
path: "Sources"
),
.testTarget(
name: "amiibo-apiTests",
dependencies: ["amiibo-api"]
name: AmiiboAPI.test,
dependencies: [
.byName(name: AmiiboAPI.target)
],
path: "Tests"
),
]
)
// MARK: - Constants
enum AmiiboAPI {
static let package = "amiibo-api"
static let target = "AmiiboAPI"
static let test = "\(AmiiboAPI.target)Tests"
}

View File

@ -1,5 +1,6 @@
import Testing
@testable import amiibo_api
@testable import AmiiboAPI
@Test func example() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions.