From aafa52d83684140d20724339a0034bfdcde68325 Mon Sep 17 00:00:00 2001 From: Fawad Suhail Date: Mon, 18 Nov 2019 15:43:20 -0500 Subject: [PATCH] Added swift package support --- .../contents.xcworkspacedata | 7 +++++ Package.swift | 29 +++++++++++++++++++ Tests/LinuxMain.swift | 7 +++++ Tests/RRuleSwiftTests/RRuleSwiftTests.swift | 15 ++++++++++ Tests/RRuleSwiftTests/XCTestManifests.swift | 9 ++++++ 5 files changed, 67 insertions(+) create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata create mode 100644 Package.swift create mode 100644 Tests/LinuxMain.swift create mode 100644 Tests/RRuleSwiftTests/RRuleSwiftTests.swift create mode 100644 Tests/RRuleSwiftTests/XCTestManifests.swift diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..aa51f92 --- /dev/null +++ b/Package.swift @@ -0,0 +1,29 @@ +// swift-tools-version:5.1 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "RRuleSwift", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "RRuleSwift", + targets: ["RRuleSwift"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define 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: "RRuleSwift", + dependencies: [], + path: "Sources"), + .testTarget( + name: "RRuleSwiftTests", + dependencies: ["RRuleSwift"]), + ] +) diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..c42e5fa --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import RRuleSwiftTests + +var tests = [XCTestCaseEntry]() +tests += RRuleSwiftTests.allTests() +XCTMain(tests) diff --git a/Tests/RRuleSwiftTests/RRuleSwiftTests.swift b/Tests/RRuleSwiftTests/RRuleSwiftTests.swift new file mode 100644 index 0000000..7bb5751 --- /dev/null +++ b/Tests/RRuleSwiftTests/RRuleSwiftTests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import RRuleSwift + +final class RRuleSwiftTests: XCTestCase { + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(RRuleSwift().text, "Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/RRuleSwiftTests/XCTestManifests.swift b/Tests/RRuleSwiftTests/XCTestManifests.swift new file mode 100644 index 0000000..1352332 --- /dev/null +++ b/Tests/RRuleSwiftTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(RRuleSwiftTests.allTests), + ] +} +#endif