From 15252dd3c130d892adcea78a8bb067c7684eac30 Mon Sep 17 00:00:00 2001 From: kishanraja Date: Tue, 12 May 2020 21:37:37 +0530 Subject: [PATCH] add swift package --- .../contents.xcworkspacedata | 7 +++++ FloatingLabelTextFieldSwiftUI.podspec | 2 +- Package.swift | 28 +++++++++++++++++++ .../Extensions/TextAlignment+Extension.swift | 0 .../Extensions/UIControl+Extension.swift | 0 .../Extensions/UIResponder+Extesnion.swift | 0 .../Extensions/View+Extension.swift | 0 .../FloatingLabelTextField.swift | 0 .../ObservableObject/ObservableObject.swift | 0 .../FloatingLabelTextFieldSwiftUITests.swift | 15 ++++++++++ .../XCTestManifests.swift | 9 ++++++ Tests/LinuxMain.swift | 7 +++++ 12 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata create mode 100644 Package.swift rename {Source => Sources/FloatingLabelTextFieldSwiftUI}/Extensions/TextAlignment+Extension.swift (100%) rename {Source => Sources/FloatingLabelTextFieldSwiftUI}/Extensions/UIControl+Extension.swift (100%) rename {Source => Sources/FloatingLabelTextFieldSwiftUI}/Extensions/UIResponder+Extesnion.swift (100%) rename {Source => Sources/FloatingLabelTextFieldSwiftUI}/Extensions/View+Extension.swift (100%) rename {Source => Sources/FloatingLabelTextFieldSwiftUI}/FloatingLabelTextField.swift (100%) rename {Source => Sources/FloatingLabelTextFieldSwiftUI}/ObservableObject/ObservableObject.swift (100%) create mode 100644 Tests/FloatingLabelTextFieldSwiftUITests/FloatingLabelTextFieldSwiftUITests.swift create mode 100644 Tests/FloatingLabelTextFieldSwiftUITests/XCTestManifests.swift create mode 100644 Tests/LinuxMain.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/FloatingLabelTextFieldSwiftUI.podspec b/FloatingLabelTextFieldSwiftUI.podspec index fe29de2..507aabb 100644 --- a/FloatingLabelTextFieldSwiftUI.podspec +++ b/FloatingLabelTextFieldSwiftUI.podspec @@ -30,7 +30,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = '13.0' - s.source_files = 'Source/**/*.swift' + s.source_files = 'Sources/**/*.swift' s.swift_version = '5.0' s.platforms = { diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..91c8859 --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// 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: "FloatingLabelTextFieldSwiftUI", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "FloatingLabelTextFieldSwiftUI", + targets: ["FloatingLabelTextFieldSwiftUI"]), + ], + 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: "FloatingLabelTextFieldSwiftUI", + dependencies: []), + .testTarget( + name: "FloatingLabelTextFieldSwiftUITests", + dependencies: ["FloatingLabelTextFieldSwiftUI"]), + ] +) diff --git a/Source/Extensions/TextAlignment+Extension.swift b/Sources/FloatingLabelTextFieldSwiftUI/Extensions/TextAlignment+Extension.swift similarity index 100% rename from Source/Extensions/TextAlignment+Extension.swift rename to Sources/FloatingLabelTextFieldSwiftUI/Extensions/TextAlignment+Extension.swift diff --git a/Source/Extensions/UIControl+Extension.swift b/Sources/FloatingLabelTextFieldSwiftUI/Extensions/UIControl+Extension.swift similarity index 100% rename from Source/Extensions/UIControl+Extension.swift rename to Sources/FloatingLabelTextFieldSwiftUI/Extensions/UIControl+Extension.swift diff --git a/Source/Extensions/UIResponder+Extesnion.swift b/Sources/FloatingLabelTextFieldSwiftUI/Extensions/UIResponder+Extesnion.swift similarity index 100% rename from Source/Extensions/UIResponder+Extesnion.swift rename to Sources/FloatingLabelTextFieldSwiftUI/Extensions/UIResponder+Extesnion.swift diff --git a/Source/Extensions/View+Extension.swift b/Sources/FloatingLabelTextFieldSwiftUI/Extensions/View+Extension.swift similarity index 100% rename from Source/Extensions/View+Extension.swift rename to Sources/FloatingLabelTextFieldSwiftUI/Extensions/View+Extension.swift diff --git a/Source/FloatingLabelTextField.swift b/Sources/FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift similarity index 100% rename from Source/FloatingLabelTextField.swift rename to Sources/FloatingLabelTextFieldSwiftUI/FloatingLabelTextField.swift diff --git a/Source/ObservableObject/ObservableObject.swift b/Sources/FloatingLabelTextFieldSwiftUI/ObservableObject/ObservableObject.swift similarity index 100% rename from Source/ObservableObject/ObservableObject.swift rename to Sources/FloatingLabelTextFieldSwiftUI/ObservableObject/ObservableObject.swift diff --git a/Tests/FloatingLabelTextFieldSwiftUITests/FloatingLabelTextFieldSwiftUITests.swift b/Tests/FloatingLabelTextFieldSwiftUITests/FloatingLabelTextFieldSwiftUITests.swift new file mode 100644 index 0000000..5b46018 --- /dev/null +++ b/Tests/FloatingLabelTextFieldSwiftUITests/FloatingLabelTextFieldSwiftUITests.swift @@ -0,0 +1,15 @@ +import XCTest +@testable import FloatingLabelTextFieldSwiftUI + +final class FloatingLabelTextFieldSwiftUITests: 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(FloatingLabelTextFieldSwiftUI().text, "Hello, World!") + } + + static var allTests = [ + ("testExample", testExample), + ] +} diff --git a/Tests/FloatingLabelTextFieldSwiftUITests/XCTestManifests.swift b/Tests/FloatingLabelTextFieldSwiftUITests/XCTestManifests.swift new file mode 100644 index 0000000..96aa0a4 --- /dev/null +++ b/Tests/FloatingLabelTextFieldSwiftUITests/XCTestManifests.swift @@ -0,0 +1,9 @@ +import XCTest + +#if !canImport(ObjectiveC) +public func allTests() -> [XCTestCaseEntry] { + return [ + testCase(FloatingLabelTextFieldSwiftUITests.allTests), + ] +} +#endif diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100644 index 0000000..9c06202 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,7 @@ +import XCTest + +import FloatingLabelTextFieldSwiftUITests + +var tests = [XCTestCaseEntry]() +tests += FloatingLabelTextFieldSwiftUITests.allTests() +XCTMain(tests)