Skip to content

Commit

Permalink
Add support for Swift Package Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
luispadron committed Oct 10, 2024
1 parent 77f02f2 commit 2e30cc9
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ jobs:
run: bundle exec --gemfile=Example/Gemfile pod repo update
- name: Lint AardvarkReveal Podspec
run: bundle exec --gemfile=Example/Gemfile pod lib lint --verbose --fail-fast AardvarkReveal.podspec
swift-build:
name: Swift Build
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Swift Build
run: swift build --sdk "$(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk" --triple "arm64-apple-ios14.0-simulator"
2 changes: 1 addition & 1 deletion AardvarkReveal.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'
s.ios.deployment_target = '14.0'

s.source_files = 'Sources/AardvarkReveal/**/*.{h,m,swift}'
s.source_files = 'Sources/AardvarkReveal/**/*.{swift}', 'Sources/AardvarkRevealCompression/**/*.{h,m}'

s.dependency 'Aardvark', '~> 5.0'

Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Aardvark: 783a49c945545c11e82e22a87ef82ced58033c21
AardvarkMailUI: b5324ce0fab7c121e4093baad5280c89a4c8275a
AardvarkReveal: f053047040bd07360c99b782df12c68371a5a5bb
AardvarkReveal: 410027948dda92f201e26d1401ae6d53ed82952c
CoreAardvark: a3e7c44b2889acdcf14d39a1d703d1e8bdfd94be
Reveal-SDK: 0ecda2395cf587e2f574c19a723b3dd27c90572e

Expand Down
15 changes: 15 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"originHash" : "0a4059d71ef3255e39435e63666b42b53838c8cc2ef6f517795297df18422dcb",
"pins" : [
{
"identity" : "aardvark",
"kind" : "remoteSourceControl",
"location" : "https://github.com/square/Aardvark",
"state" : {
"revision" : "2eb62ce13df23128dcc89b70cf200d369d47dbbd",
"version" : "5.2.0"
}
}
],
"version" : 3
}
44 changes: 44 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// swift-tools-version:5.10

import PackageDescription

let package = Package(
name: "AardvarkReveal",
platforms: [
.iOS(.v14),
],
products: [
.library(
name: "AardvarkReveal",
targets: ["AardvarkReveal"]
),
.library(
name: "AardvarkRevealCompression",
targets: ["AardvarkRevealCompression"]
)
],
dependencies: [
.package(
url: "https://github.com/square/Aardvark",
.upToNextMajor(from: "5.2.0")
),
],
targets: [
.target(
name: "AardvarkReveal",
dependencies: [
.product(name: "Aardvark", package: "Aardvark"),
.target(name: "AardvarkRevealCompression"),
],
cSettings: [
.define("SWIFT_PACKAGE"),
]
),
.target(
name: "AardvarkRevealCompression",
cSettings: [
.define("SWIFT_PACKAGE"),
]
),
]
)
5 changes: 5 additions & 0 deletions Sources/AardvarkReveal/RevealAttachmentGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import Foundation
import UIKit
import zlib

#if SWIFT_PACKAGE
import AardvarkSwift
import AardvarkRevealCompression
#endif

@objc(ARKRevealAttachmentGeneratorDelegate)
public protocol RevealAttachmentGeneratorDelegate: AnyObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ FOUNDATION_EXPORT const unsigned char AardvarkRevealVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <AardvarkReveal/PublicHeader.h>

#if SWIFT_PACKAGE
#import "ARKCompressionUtility.h"
#else
#import <AardvarkReveal/ARKCompressionUtility.h>
#endif

0 comments on commit 2e30cc9

Please sign in to comment.