Create a directory where you will create your application:
mkdir fun
cd fun
swift package init --type executable
Then edit Package.swift
so that it reads:
import PackageDescription
let package = Package(
name: "fun",
dependencies: [
.package(url: "https://github.com/lemire/Swimsuit.git", from: "0.1.2")
],
targets: [
.target(
name: "fun",
dependencies: ["Swimsuit"]),
]
)
Edit main.swift
(in Sources) so that it looks something like this :
import Swimsuit;
let nano = Swimsuit.nanotime() {
print("do something")
}
You can run your example as follows:
swift build --configuration release
$(swift build --configuration release --show-bin-path)/fun
$ swift package generate-xcodeproj
generated: ./Bitset.xcodeproj
$ open ./Bitset.xcodeproj
link |
Stars: 0 |
Last commit: 4 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics