Fix swift argument parser (#215)
* Resolved dependency on SwiftArgumentParser - Moved BlueSocketTestClient and BlueSocketTestServer to Examples folder with it's own Package.swift file * Update minimum swift argument parser to 1.1.3 * Update podspec; Update travis build platforms.
This commit is contained in:
@@ -2,3 +2,4 @@
|
||||
.DS_Store
|
||||
xcuserdata/
|
||||
.swiftpm
|
||||
Examples/Package.resolved
|
||||
|
||||
+8
-12
@@ -12,32 +12,28 @@ branches:
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
sudo: required
|
||||
services: docker
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu16.04:5.1.5 SWIFT_SNAPSHOT=5.1.5
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:5.1.5
|
||||
- os: linux
|
||||
dist: bionic
|
||||
sudo: required
|
||||
services: docker
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:5.4 SWIFT_SNAPSHOT=5.4
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:5.4
|
||||
- os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
sudo: required
|
||||
services: docker
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:latest SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
|
||||
- os: osx
|
||||
osx_image: xcode11
|
||||
sudo: required
|
||||
env: SWIFT_SNAPSHOT=5.1.5 JAZZY_ELIGIBLE=true
|
||||
env: DOCKER_IMAGE=docker.kitura.net/kitura/swift-ci-ubuntu18.04:latest USE_SWIFT_DEVELOPMENT_SNAPSHOT=1
|
||||
- os: osx
|
||||
osx_image: xcode12.2
|
||||
sudo: required
|
||||
#env: SWIFT_SNAPSHOT=5.1.5
|
||||
env: JAZZY_ELIGIBLE=true
|
||||
- os: osx
|
||||
osx_image: xcode12.5
|
||||
osx_image: xcode13.2
|
||||
sudo: required
|
||||
env: SWIFT_SNAPSHOT=$SWIFT_DEVELOPMENT_SNAPSHOT
|
||||
env: USE_SWIFT_DEVELOPMENT_SNAPSHOT=1
|
||||
|
||||
before_install:
|
||||
- git clone https://github.com/Kitura/Package-Builder.git
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "BlueSocket"
|
||||
s.version = "2.0.2"
|
||||
s.version = "2.0.3"
|
||||
s.summary = "Socket framework for Swift using the Swift Package Manager"
|
||||
s.homepage = "https://github.com/Kitura/BlueSocket"
|
||||
s.license = { :type => "Apache License, Version 2.0" }
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// swift-tools-version:5.2
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Examples",
|
||||
products: [
|
||||
.executable(
|
||||
name: "BlueSocketTestServer",
|
||||
targets: ["BlueSocketTestServer"]),
|
||||
.executable(
|
||||
name: "BlueSocketTestClient",
|
||||
targets: ["BlueSocketTestClient"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.1.3"),
|
||||
.package(name: "BlueSocket", path: ".."),
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "BlueSocketTestServer",
|
||||
dependencies: [
|
||||
.product(name: "BlueSocketTestCommonLibrary", package: "BlueSocket"),
|
||||
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
||||
]),
|
||||
.target(
|
||||
name: "BlueSocketTestClient",
|
||||
dependencies: [
|
||||
.product(name: "BlueSocketTestCommonLibrary", package: "BlueSocket"),
|
||||
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
||||
]),
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,3 @@
|
||||
# Examples
|
||||
|
||||
An example Server and Client.
|
||||
+7
-73
@@ -18,22 +18,16 @@
|
||||
|
||||
import PackageDescription
|
||||
|
||||
struct BuildInfo {
|
||||
let product: [Product]
|
||||
let dependencies: [Package.Dependency]
|
||||
let targets: [Target]
|
||||
}
|
||||
|
||||
|
||||
let libraryBuildInfo = BuildInfo(
|
||||
product: [
|
||||
#if os(Linux) || os(macOS) || os(iOS) || os(tvOS)
|
||||
let package = Package(
|
||||
name: "Socket",
|
||||
products: [
|
||||
.library(
|
||||
name: "Socket",
|
||||
targets: ["Socket"]),
|
||||
|
||||
.library(
|
||||
name: "BlueSocketTestCommonLibrary",
|
||||
targets: ["BlueSocketTestCommonLibrary"]),
|
||||
.library(
|
||||
name: "BlueSocketTestCommonLibrary",
|
||||
targets: ["BlueSocketTestCommonLibrary"]),
|
||||
],
|
||||
dependencies: [],
|
||||
targets: [
|
||||
@@ -46,72 +40,12 @@ let libraryBuildInfo = BuildInfo(
|
||||
name: "SocketTests",
|
||||
dependencies: ["Socket", "BlueSocketTestCommonLibrary"]
|
||||
),
|
||||
|
||||
.target(
|
||||
name: "BlueSocketTestCommonLibrary",
|
||||
dependencies: [ "Socket" ]
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
let toolsBuildInfo = BuildInfo(
|
||||
product: [
|
||||
.executable(
|
||||
name: "BlueSocketTestServer",
|
||||
targets: ["BlueSocketTestServer"]),
|
||||
.executable(
|
||||
name: "BlueSocketTestClient",
|
||||
targets: ["BlueSocketTestClient"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.4.1"),
|
||||
],
|
||||
targets: [
|
||||
.target(name: "BlueSocketTestServer",
|
||||
dependencies: ["BlueSocketTestCommonLibrary", "ArgumentParser", ]
|
||||
),
|
||||
.target(name: "BlueSocketTestClient",
|
||||
dependencies: ["BlueSocketTestCommonLibrary", "ArgumentParser" ]
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
var products: [Product] = [
|
||||
.library(
|
||||
name: "Socket",
|
||||
targets: ["Socket"]),
|
||||
|
||||
.library(
|
||||
name: "BlueSocketTestCommonLibrary",
|
||||
targets: ["BlueSocketTestCommonLibrary"]),
|
||||
]
|
||||
#if swift(>=5.2)
|
||||
products.append(contentsOf: [
|
||||
.executable(
|
||||
name: "BlueSocketTestServer",
|
||||
targets: ["BlueSocketTestServer"]),
|
||||
.executable(
|
||||
name: "BlueSocketTestClient",
|
||||
targets: ["BlueSocketTestClient"])
|
||||
])
|
||||
#endif
|
||||
|
||||
let buildInfo: BuildInfo
|
||||
#if swift(>=5.2)
|
||||
buildInfo = BuildInfo(product: libraryBuildInfo.product + toolsBuildInfo.product,
|
||||
dependencies: libraryBuildInfo.dependencies + toolsBuildInfo.dependencies,
|
||||
targets: libraryBuildInfo.targets + toolsBuildInfo.targets)
|
||||
#else
|
||||
buildInfo = BuildInfo(product: libraryBuildInfo.product, dependencies: libraryBuildInfo.dependencies, targets: libraryBuildInfo.targets)
|
||||
#endif
|
||||
|
||||
#if os(Linux) || os(macOS) || os(iOS) || os(tvOS)
|
||||
let package = Package(
|
||||
name: "Socket",
|
||||
products: buildInfo.product,
|
||||
dependencies: buildInfo.dependencies,
|
||||
targets: buildInfo.targets
|
||||
)
|
||||
#else
|
||||
fatalError("Unsupported OS")
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user