Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 825 Bytes

创建服务器基础工程.md

File metadata and controls

29 lines (24 loc) · 825 Bytes
  1. Xcode 创建 macOS CommandLine Tool 工程
  2. 添加Package.swift,并设置工程名
  3. private let kProjectName: String = "ProjectName"
// swift-tools-version:4.0

import PackageDescription

// ProjectName
private let kProjectName: String = "FilePlay"

let package = Package(
name: kProjectName,
products: [
.executable(name: kProjectName, targets: [kProjectName])
],
dependencies: [
.package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git", from: "3.0.0"),
.package(url: "https://github.com/PerfectlySoft/Perfect-MySQL.git", from: "3.0.0"),
.package(url: "https://github.com/PerfectlySoft/Perfect-Logger.git", from: "3.0.0"),
],
targets: [
.target(name: kProjectName, dependencies: ["PerfectHTTPServer", "PerfectMySQL", "PerfectLogger"])
]
  1. swift build
  2. swift package generate-xcodeproj