Package target setup (#1)

This PR contains the work done to setup the *executable*, *library*, and *test* targets for the Swift package. In addition, some boilerplate code has been removed.

Reviewed-on: #1
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit is contained in:
Javier Cicchelli 2025-01-27 23:38:34 +00:00 committed by Javier Cicchelli
parent b2c911d165
commit d0d47d280d
5 changed files with 53 additions and 8 deletions

View File

@ -1,14 +1,46 @@
// swift-tools-version: 6.0 // swift-tools-version: 6.0
// 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: "Colibri", name: "Colibri",
products: [
.executable(
name: "colibri",
targets: ["Colibri"]
),
.library(
name: "ColibriLibrary",
targets: ["ColibriLibrary"]
)
],
dependencies: [
.package(
url: "https://github.com/apple/swift-argument-parser",
from: "1.0.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.
.executableTarget( .executableTarget(
name: "Colibri"), name: "Colibri",
dependencies: [
.product(
name: "ArgumentParser",
package: "swift-argument-parser"
),
.target(name: "ColibriLibrary")
],
path: "Sources/Executable"
),
.target(
name: "ColibriLibrary",
dependencies: [],
path: "Sources/Library"
),
.testTarget(
name: "ColibriTests",
dependencies: ["ColibriLibrary"],
path: "Tests/Library"
)
] ]
) )

View File

@ -0,0 +1,13 @@
import ArgumentParser
import ColibriLibrary
@main
struct Colibri: AsyncParsableCommand {
// MARK: Functions
func run() async throws {
// ...
}
}

View File

@ -0,0 +1 @@
import Foundation

View File

@ -1,4 +0,0 @@
// The Swift Programming Language
// https://docs.swift.org/swift-book
print("Hello, world!")

View File

@ -0,0 +1,3 @@
import Testing
struct ColibriLibraryTests {}