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:
parent
b2c911d165
commit
d0d47d280d
@ -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"
|
||||||
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
13
Sources/Executable/Colibri.swift
Normal file
13
Sources/Executable/Colibri.swift
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import ArgumentParser
|
||||||
|
import ColibriLibrary
|
||||||
|
|
||||||
|
@main
|
||||||
|
struct Colibri: AsyncParsableCommand {
|
||||||
|
|
||||||
|
// MARK: Functions
|
||||||
|
|
||||||
|
func run() async throws {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
1
Sources/Library/ColibriLibrary.swift
Normal file
1
Sources/Library/ColibriLibrary.swift
Normal file
@ -0,0 +1 @@
|
|||||||
|
import Foundation
|
@ -1,4 +0,0 @@
|
|||||||
// The Swift Programming Language
|
|
||||||
// https://docs.swift.org/swift-book
|
|
||||||
|
|
||||||
print("Hello, world!")
|
|
3
Tests/Library/ColibriLibraryTests.swift
Normal file
3
Tests/Library/ColibriLibraryTests.swift
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import Testing
|
||||||
|
|
||||||
|
struct ColibriLibraryTests {}
|
Loading…
x
Reference in New Issue
Block a user