Skip to content

Commit

Permalink
Add support for Aardvark in SPM
Browse files Browse the repository at this point in the history
  • Loading branch information
luispadron committed Oct 4, 2024
1 parent ded8c2a commit c24d201
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Aardvark.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/Aardvark/**/*.{h,m,swift}'
s.source_files = 'Sources/Aardvark/**/*.{h,m}', 'Sources/CoreAardvarkSwift/**/*.{swift}'
s.resource_bundle = {'Aardvark' => ['Sources/Aardvark/PrivacyInfo.xcprivacy']}

s.dependency 'CoreAardvark', '~> 4.0'
Expand Down
21 changes: 21 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,33 @@ let package = Package(
.iOS(.v14),
],
products: [
.library(
name: "Aardvark",
targets: ["Aardvark", "AardvarkSwift"]
),
.library(
name: "CoreAardvark",
targets: ["CoreAardvark", "CoreAardvarkSwift"]
),
],
targets: [
.target(
name: "Aardvark",
dependencies: ["CoreAardvark"],
resources: [
.process("PrivacyInfo.xcprivacy"),
],
cSettings: [
.define("SWIFT_PACKAGE"),
]
),
.target(
name: "AardvarkSwift",
dependencies: ["Aardvark"],
cSettings: [
.define("SWIFT_PACKAGE"),
]
),
.target(
name: "CoreAardvark",
resources: [
Expand Down
6 changes: 5 additions & 1 deletion Sources/Aardvark/Aardvark.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ FOUNDATION_EXPORT double Aardvark_iOSVersionNumber;
//! Project version string for Aardvark-iOS.
FOUNDATION_EXPORT const unsigned char Aardvark_iOSVersionString[];


#if SWIFT_PACKAGE
#import "ARKLogDistributor+UIAdditions.h"
#import "ARKScreenshotLogging.h"
#else
#import <Aardvark/ARKLogDistributor+UIAdditions.h>
#import <Aardvark/ARKScreenshotLogging.h>
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
import CoreAardvark
import Foundation

#if SWIFT_PACKAGE
import Aardvark
#endif

@objc
public class Aardvark : NSObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

import Foundation

#if SWIFT_PACKAGE
import Aardvark
#endif

@objc(ARKLogStoreAttachmentGenerator)
public final class LogStoreAttachmentGenerator: NSObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//

import Foundation
import UIKit

@objc(ARKViewHierarchyAttachmentGenerator)
public final class ViewHierarchyAttachmentGenerator: NSObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//

import Foundation
import UIKit

extension UIApplication {

Expand Down

0 comments on commit c24d201

Please sign in to comment.