From 41ed774f14fc490be5d040ea3a41878dff4973a2 Mon Sep 17 00:00:00 2001 From: Mikhail Akopov Date: Fri, 29 Sep 2023 16:49:45 +0300 Subject: [PATCH 1/4] Add SwiftPM support --- Package.swift | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Package.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..97c1fda --- /dev/null +++ b/Package.swift @@ -0,0 +1,23 @@ +// swift-tools-version: 5.6 + +import PackageDescription + +let package = Package( + name: "Personnummer", + products: [ + .library(name: "Personnummer", targets: ["Personnummer"]), + ], + targets: [ + .target( + name: "Personnummer", + dependencies: [], + path: "source" + ), + .testTarget( + name: "PersonnummerTests", + dependencies: ["Personnummer"], + path: "PersonnummerExample/PersonnummerExampleTests", + exclude: ["Info.plist"] + ), + ] +) From d90480e1f0486c24dcd2e07bfc8d588517354e90 Mon Sep 17 00:00:00 2001 From: Mikhail Akopov Date: Fri, 29 Sep 2023 16:50:08 +0300 Subject: [PATCH 2/4] Add gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..042513c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +.swiftpm/ +.build/ \ No newline at end of file From f5744c4393bb329c1803823d4095a2a61c557384 Mon Sep 17 00:00:00 2001 From: Mikhail Akopov Date: Fri, 29 Sep 2023 16:52:55 +0300 Subject: [PATCH 3/4] Test as a package too --- .github/workflows/swift.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 9a3c246..a3a91c0 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -18,6 +18,8 @@ jobs: steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + - name: Test as package + run: swift test - name: CocoaPod Install run: | cd PersonnummerExample From 948310a648b7e551cd9b4f0e63ab084788bc7c93 Mon Sep 17 00:00:00 2001 From: Mikhail Akopov Date: Fri, 29 Sep 2023 16:59:52 +0300 Subject: [PATCH 4/4] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6cb60ed..26bc45b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ Small library to validate and format swedish personal identity numbers called "P pod 'Personnummer', '~> 1.0.0' ``` +### Swift Package Manager + +```swift +.package(url: "https://github.com/personnummer/swift.git", from: "1.0.2") +``` + ## Usage ```swift