|
| 1 | +// swift-tools-version:4.0 |
| 2 | +// The swift-tools-version declares the minimum version of Swift required to build this package. |
| 3 | + |
| 4 | +/** |
| 5 | + * Copyright IBM Corporation 2016, 2017, 2019 |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + **/ |
| 19 | + |
| 20 | +import PackageDescription |
| 21 | +import Foundation |
| 22 | + |
| 23 | +var kituraNetPackage: Package.Dependency |
| 24 | + |
| 25 | +if ProcessInfo.processInfo.environment["KITURA_NIO"] != nil { |
| 26 | + kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-NIO.git", from: "1.0.0") |
| 27 | +} else { |
| 28 | + kituraNetPackage = .package(url: "https://github.com/IBM-Swift/Kitura-net.git", from: "2.1.0") |
| 29 | +} |
| 30 | + |
| 31 | +let package = Package( |
| 32 | + name: "Kitura-CouchDB", |
| 33 | + products: [ |
| 34 | + // Products define the executables and libraries produced by a package, and make them visible to other packages. |
| 35 | + .library( |
| 36 | + name: "CouchDB", |
| 37 | + targets: ["CouchDB"]), |
| 38 | + ], |
| 39 | + dependencies: [ |
| 40 | + // Dependencies declare other packages that this package depends on. |
| 41 | + // .package(url: /* package url */, from: "1.0.0"), |
| 42 | + .package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "1.7.0"), |
| 43 | + kituraNetPackage, |
| 44 | + ], |
| 45 | + targets: [ |
| 46 | + // Targets are the basic building blocks of a package. A target defines a module or a test suite. |
| 47 | + // Targets can depend on other targets in this package, and on products in packages which this package depends on. |
| 48 | + .target( |
| 49 | + name: "CouchDB", |
| 50 | + dependencies: ["LoggerAPI", "KituraNet"]), |
| 51 | + .target( |
| 52 | + name: "CouchDBSample", |
| 53 | + dependencies: ["CouchDB"]), |
| 54 | + .testTarget( |
| 55 | + name: "CouchDBTests", |
| 56 | + dependencies: ["CouchDB"]), |
| 57 | + ] |
| 58 | +) |
0 commit comments