Skip to content

Commit

Permalink
Revert embedded module, use OpenSSL repo in Swift 4.2 format
Browse files Browse the repository at this point in the history
  • Loading branch information
djones6 committed Oct 1, 2018
1 parent a1e7ed1 commit 0a745d8
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 148 deletions.
76 changes: 50 additions & 26 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,43 +1,67 @@
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

//
// Package.swift
// SSLService
//
// Copyright © 2016 IBM. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import PackageDescription

#if os(Linux) || os(macOS) || os(iOS) || os(tvOS)

let package = Package(
name: "SSLService",
targets: [Target(name: "SSLService")],
dependencies: [
.Package(url: "https://github.com/IBM-Swift/BlueSocket.git", majorVersion: 1, minor: 0),
],
exclude: ["SSLService.xcodeproj", "README.md", "Sources/Info.plist"])

#if os(Linux)

package.dependencies.append(
.Package(url: "https://github.com/IBM-Swift/OpenSSL.git", majorVersion: 1, minor: 0))

#endif
var packageDependencies: [Package.Dependency] = [.package(url: "https://github.com/IBM-Swift/BlueSocket.git", from: "1.0.0")]
var targetDependencies: [Target.Dependency] = [.byName(name: "Socket")]

#if os(Linux)

packageDependencies.append(.package(url: "https://github.com/IBM-Swift/OpenSSL.git", from: "2.0.0"))
targetDependencies.append(.byName(name: "OpenSSL"))

#endif

let package = Package(
name: "SSLService",

products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "SSLService",
targets: ["SSLService"]),
],

dependencies:
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
packageDependencies,

targets: [
// Targets are the basic building blocks of a package. A target defines a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "SSLService",
dependencies: targetDependencies,
exclude: ["SSLService.xcodeproj", "README.md", "Sources/Info.plist"]),
]
)

#else
fatalError("Unsupported OS")

fatalError("Unsupported OS")

#endif

File renamed without changes.
29 changes: 13 additions & 16 deletions Package@swift-4.2.swift → Package@swift-4.1.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.2
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

//
Expand All @@ -25,23 +25,13 @@ import PackageDescription
#if os(Linux) || os(macOS) || os(iOS) || os(tvOS)

var packageDependencies: [Package.Dependency] = [.package(url: "https://github.com/IBM-Swift/BlueSocket.git", from: "1.0.0")]
var targetDependencies: [Target.Dependency] = [.byName(name: "Socket")]
var targetDependencies: [Target.Dependency] = [.byNameItem(name: "Socket")]

#if os(Linux)
targetDependencies.append(.target(name: "OpenSSLLocal1"))
#endif

var targets: [Target] = [
.target(
name: "SSLService",
dependencies: targetDependencies,
exclude: ["SSLService.xcodeproj", "README.md", "Sources/Info.plist"]),
]

packageDependencies.append(.package(url: "https://github.com/IBM-Swift/OpenSSL.git", from: "1.0.0"))
targetDependencies.append(.byNameItem(name: "OpenSSL"))

#if os(Linux)
targets.append(
.systemLibrary(name: "OpenSSLLocal1")
)
#endif

let package = Package(
Expand All @@ -59,7 +49,14 @@ let package = Package(
// .package(url: /* package url */, from: "1.0.0"),
packageDependencies,

targets: targets
targets: [
// Targets are the basic building blocks of a package. A target defines a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "SSLService",
dependencies: targetDependencies,
exclude: ["SSLService.xcodeproj", "README.md", "Sources/Info.plist"]),
]
)

#else
Expand Down
21 changes: 0 additions & 21 deletions Sources/OpenSSLLocal1/module.modulemap

This file was deleted.

81 changes: 0 additions & 81 deletions Sources/OpenSSLLocal1/shim.h

This file was deleted.

4 changes: 0 additions & 4 deletions Sources/SSLService/SSLService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ import Foundation
import Socket

#if os(Linux)
#if swift(>=4.2)
import OpenSSLLocal1
#else
import OpenSSL
#endif
#endif

import Dispatch

Expand Down

0 comments on commit 0a745d8

Please sign in to comment.