From 19555052570b3e1812770a2f66456f6ad524856c Mon Sep 17 00:00:00 2001 From: Emanuel Guerrero Date: Sun, 19 Jan 2020 01:08:06 -0500 Subject: [PATCH] Initial commit --- .gitignore | 6 ++++ Package.swift | 34 +++++++++++++++++++ .../CNAMEPublishPlugin.swift | 3 ++ .../CNAMEPublishPluginTests.swift | 15 ++++++++ .../XCTestManifests.swift | 9 +++++ Tests/LinuxMain.swift | 7 ++++ 6 files changed, 74 insertions(+) create mode 100644 .gitignore create mode 100644 Package.swift create mode 100644 Sources/CNAMEPublishPlugin/CNAMEPublishPlugin.swift create mode 100644 Tests/CNAMEPublishPluginTests/CNAMEPublishPluginTests.swift create mode 100644 Tests/CNAMEPublishPluginTests/XCTestManifests.swift create mode 100644 Tests/LinuxMain.swift diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..111c2a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +/.build +Package.resolved +.swiftpm +/*.xcodeproj +xcuserdata/ diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..1c60a34 --- /dev/null +++ b/Package.swift @@ -0,0 +1,34 @@ +/** +* CNAME file generator plugin for Publish +* Copyright (c) Manny Guerrero 2020 +* MIT license, see LICENSE file for details +*/ + +// 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: "CNAMEPublishPlugin", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "CNAMEPublishPlugin", + targets: ["CNAMEPublishPlugin"]), + ], + 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: "CNAMEPublishPlugin", + dependencies: []), + .testTarget( + name: "CNAMEPublishPluginTests", + dependencies: ["CNAMEPublishPlugin"]), + ] +) diff --git a/Sources/CNAMEPublishPlugin/CNAMEPublishPlugin.swift b/Sources/CNAMEPublishPlugin/CNAMEPublishPlugin.swift new file mode 100644 index 0000000..d2154b1 --- /dev/null +++ b/Sources/CNAMEPublishPlugin/CNAMEPublishPlugin.swift @@ -0,0 +1,3 @@ +struct CNAMEPublishPlugin { + var text = "Hello, World!" +} diff --git a/Tests/CNAMEPublishPluginTests/CNAMEPublishPluginTests.swift b/Tests/CNAMEPublishPluginTests/CNAMEPublishPluginTests.swift new file mode 100644 index 0000000..693e3a0 --- /dev/null +++ b/Tests/CNAMEPublishPluginTests/CNAMEPublishPluginTests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import CNAMEPublishPlugin + +final class CNAMEPublishPluginTests: 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(CNAMEPublishPlugin().text, "Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/CNAMEPublishPluginTests/XCTestManifests.swift b/Tests/CNAMEPublishPluginTests/XCTestManifests.swift new file mode 100644 index 0000000..99c9e11 --- /dev/null +++ b/Tests/CNAMEPublishPluginTests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(CNAMEPublishPluginTests.allTests), + ] +} +#endif diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..5257898 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import CNAMEPublishPluginTests + +var tests = [XCTestCaseEntry]() +tests += CNAMEPublishPluginTests.allTests() +XCTMain(tests)