SPM Tips in Kitura Swift-server side May 2021

Another Swift Option

Check official doc (this Link : https://www.kitura.dev/docs/getting-started/installation)

Environment Big Sur 11.2.3, Xcode 12.4, swift 5.4

  1. Part GetStart

The doc with command line “kitura init”. It’s should updated ‘kitura init “your file name” ‘

2. SPM

It’s Beef in.

Some SPM have the erro with “explicit name issue”

That is what I try this two days result.

For using convenience, you can just copy code below.

////////////////////

In Package.swift file.

let package = Package(

name: “SPMKitura”,

dependencies: [

.package(url: “https://github.com/Kitura/Kitura.git", .upToNextMajor(from: “2.9.200”)),

.package(url: “https://github.com/IBM-Swift/HeliumLogger.git", from: “1.7.1”),

.package(url: “https://github.com/IBM-Swift/CloudEnvironment.git", from: “9.0.0”),

.package(url: “https://github.com/RuntimeTools/SwiftMetrics.git", from: “2.0.0”),

.package(url: “https://github.com/IBM-Swift/Health.git", from: “1.0.0”),

.package(name:”KituraOpenAPI”, url: “https://github.com/IBM-Swift/Kitura-OpenAPI.git", from: “1.4.0”),

.package(name: “SwiftKuery”, url: “https://github.com/IBM-Swift/Swift-Kuery.git", from: “3.0.1”) ,

.package(url: “https://github.com/IBM-Swift/SwiftKueryMySQL.git", from: “2.0.2”),

.package(url: “https://github.com/Kitura/Kitura-Session.git", .upToNextMinor(from: “3.3.4” )),

],

targets: [

.target(name: “SPMKitura”,

dependencies: [ .target(name: “Application”), “Kitura”,”KituraOpenAPI”,”SwiftKueryMySQL”,”SwiftKuery”,]),

.target(name: “Application”,

dependencies: [“Kitura”, “CloudEnvironment”, “SwiftMetrics”,”Health”,”KituraOpenAPI”,”SwiftKueryMySQL”,”SwiftKuery”,”HeliumLogger”,.product(name: “KituraSession”, package: “Kitura-Session”)]),

// .testTarget(name: “ApplicationTests” , dependencies: [“Kitura”]),

]

)

///////////

Leave a claps for me a cup of coffee.

--

--

Major in physical education. Football referee. And high interest in looking the world through the numbers.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mario tsai

Major in physical education. Football referee. And high interest in looking the world through the numbers.