Skip to content

Commit

Permalink
Add Swift Package Manager support
Browse files Browse the repository at this point in the history
  • Loading branch information
luispadron committed Sep 23, 2024
1 parent 7906584 commit 26c221a
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 11 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/swift_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- name: Install Pod Dependencies
run: cd ios/Example && pod install
shell: bash

- name: Run tests
run: xcodebuild test -workspace ios/Example/Trifle.xcworkspace -scheme Trifle-Example -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -configuration Debug

- name: Run CocoaPod tests
run: xcodebuild test -workspace ios/Example/Trifle.xcworkspace -scheme Trifle-Example -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -configuration Debug

- name: Run Swift Package Manager tests
run: |
swift build --sdk "$(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk" --triple "arm64-apple-ios14.0-simulator"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ build
.externalNativeBuild
.cxx
local.properties

# SPM
.build
15 changes: 15 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"originHash" : "eae3917e9693897f6a03267f06d2b1d3ffb475a64065c99d0920e0637b7085c5",
"pins" : [
{
"identity" : "wire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/square/wire",
"state" : {
"revision" : "ae34c3a2cfdea31ea7cb8328c84c2a8bc1d0f25f",
"version" : "4.7.2"
}
}
],
"version" : 3
}
32 changes: 32 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// swift-tools-version:5.10

import PackageDescription

let package = Package(
name: "Trifle",
platforms: [
.iOS(.v14),
.macOS(.v10_15),
],
products: [
.library(
name: "Trifle",
targets: ["Trifle"]
),
],
dependencies: [
.package(
url: "https://github.com/square/wire",
.upToNextMinor(from: "4.7.0")
),
],
targets: [
.target(
name: "Trifle",
dependencies: [
.product(name: "Wire", package: "wire"),
],
path: "ios/Trifle/Sources"
),
]
)
4 changes: 2 additions & 2 deletions Trifle.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Security functionality for interoperability/interaction with core services.

s.source_files = 'ios/Trifle/Sources/**/*.swift'

s.dependency 'Wire', '~> 4'
s.dependency 'Wire', '~> 4.7'

s.swift_versions = '5.0.1'
s.swift_versions = '5.8'
end
12 changes: 6 additions & 6 deletions ios/Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Trifle (0.2.4):
- Wire (~> 4)
- Wire (4.5.1)
- Trifle (0.2.5):
- Wire (~> 4.7)
- Wire (4.9.4)
- WireCompiler (4.5.1)

DEPENDENCIES:
Expand All @@ -18,10 +18,10 @@ EXTERNAL SOURCES:
:path: "../../"

SPEC CHECKSUMS:
Trifle: bb8422a8904ddfa192d5b7beedfbf5505087c947
Wire: b07a2ff1c4cd4b71f5ae26771cdd13fc7868c9df
Trifle: 640389000f04f073a54b82d237b2ac5afb081a80
Wire: f5fe13fcad476bfd248f23a45a2004167c0ebae2
WireCompiler: 417c2ac583c01de328010738658758556ea92a92

PODFILE CHECKSUM: 4b8d6c2fc4c9668821977302cb1ff5c5891d9920

COCOAPODS: 1.12.0
COCOAPODS: 1.15.0

0 comments on commit 26c221a

Please sign in to comment.