From 12ce3067ce183cc0e5af70d4360ba60f96d60c10 Mon Sep 17 00:00:00 2001 From: Richard Piazza Date: Tue, 10 Dec 2024 10:42:29 -0600 Subject: [PATCH] Updated Package Tools & Readme --- .github/workflows/swift.yml | 37 ++++++++++++++----------- .spi.yml | 4 +++ Package.swift | 11 ++++---- README.md | 55 ++++++++++++++++--------------------- 4 files changed, 55 insertions(+), 52 deletions(-) create mode 100644 .spi.yml diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 9fb271d..af43337 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -7,24 +7,29 @@ on: branches: [ main ] jobs: - macos-build: - runs-on: macos-latest + SwiftLang: + strategy: + fail-fast: false + matrix: + os: [macOS-15, ubuntu-latest] + + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Build (macOS) - run: swift build -v - - name: Run tests - run: swift test -v - - ubuntu-build: - runs-on: ubuntu-latest + - name: Checkout + uses: actions/checkout@v4 - steps: - - uses: actions/checkout@v2 - - name: Build (Ubuntu) - run: swift build -v - - name: Run tests - run: swift test -v + - name: Package Resolution + shell: bash + run: swift package resolve + + - name: Build + shell: bash + run: swift build + + - name: Test + shell: bash + run: swift test + \ No newline at end of file diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 0000000..3d9caf1 --- /dev/null +++ b/.spi.yml @@ -0,0 +1,4 @@ +version: 1 +builder: + configs: + - documentation_targets: [CodablePlus] diff --git a/Package.swift b/Package.swift index 735f485..7b5b01e 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.8 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -6,10 +6,11 @@ import PackageDescription let package = Package( name: "CodablePlus", platforms: [ - .macOS(.v10_12), - .iOS(.v10), - .tvOS(.v10), - .watchOS(.v3), + .macOS(.v12), + .macCatalyst(.v15), + .iOS(.v15), + .tvOS(.v15), + .watchOS(.v8) ], products: [ .library( diff --git a/README.md b/README.md index d51706f..6ca9166 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,9 @@ -

- CodablePlus -

+CodablePlus -

- - - - Twitter: @richardpiazza - -

+A collection of extensions around the Swift `Codable` implementation. -

A collection of extensions around the Swift Codable implementation.

- -## Installation - -**Codable+** is distributed using the [Swift Package Manager](https://swift.org/package-manager). To install it into a project, add it as a dependency within your `Package.swift` manifest: - -```swift -let package = Package( - ... - dependencies: [ - .package(url: "https://github.com/richardpiazza/CodablePlus.git", from: "0.3.0") - ], - ... -) -``` - -Then import **Codable+** wherever you'd like to use it: - -```swift -import CodablePlus -``` +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frichardpiazza%2FCodablePlus%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/richardpiazza/CodablePlus) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frichardpiazza%2FCodablePlus%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/richardpiazza/CodablePlus) ## Usage @@ -148,6 +121,26 @@ let schema2json = """ Notice the `companyName =` in the `init(from:)` method? This specifies multiple `CodingKey`s as possibilities. Now our `CompanyV2` model supports decoding of our `CompanyV1` schema. +## Installation + +**Codable+** is distributed using the [Swift Package Manager](https://swift.org/package-manager). To install it into a project, add it as a dependency within your `Package.swift` manifest: + +```swift +let package = Package( + ... + dependencies: [ + .package(url: "https://github.com/richardpiazza/CodablePlus.git", from: "1.0.0") + ], + ... +) +``` + +Then import **Codable+** wherever you'd like to use it: + +```swift +import CodablePlus +``` + ## Inspiration **Codable+** has grown and been inspired by several posts around the interwebs: