-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSyncProvider.podspec
More file actions
82 lines (70 loc) · 3.52 KB
/
Copy pathSyncProvider.podspec
File metadata and controls
82 lines (70 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "SyncProvider"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
# iOS 15.0 floor: `ios/HTTP/SyncDispatcher.swift` uses the async
# `URLSession.data(for:)` API, which is iOS 15+. We pin the floor explicitly
# rather than relying on the Cocoapods helper because this library has a
# strict minimum. (BGTaskScheduler, iOS 13+, is comfortably covered.)
s.platforms = { :ios => "15.0" }
s.source = { :git => "https://github.com/gabriel-sisjr/react-native-sync-provider.git", :tag => "#{s.version}" }
s.source_files = [
"ios/**/*.{swift}",
"ios/**/*.{m,mm}",
"cpp/**/*.{hpp,cpp}",
]
# Exclude the XCTest sources from the main pod target — they live under
# `s.test_spec 'Tests'` below and must NOT be compiled into the production
# library (would otherwise pull XCTest into release builds).
s.exclude_files = [
"ios/Tests/**/*",
]
# Bundle the Core Data model directly into the app bundle.
s.resources = [
"ios/Database/SyncProvider.xcdatamodeld",
]
# The Privacy Manifest must live inside a `resource_bundle`, not `resources`.
# Reasoning:
# 1. React Native 0.85+ runs a Privacy-Manifest aggregator at `pod install`
# time (see RN's `privacy_manifest_utils.rb`). That aggregator only
# scans `file_accessor.resource_bundles` — it ignores `s.resources`.
# Putting the file under a resource bundle is the only way for our
# `NSPrivacyAccessedAPITypes` entries to be merged into the host app's
# aggregated PrivacyInfo.xcprivacy.
# 2. If we instead listed it in `s.resources`, CocoaPods would copy it
# directly to `<App>.app/PrivacyInfo.xcprivacy`, colliding with the
# aggregated copy that the host app already owns ("Multiple commands
# produce …PrivacyInfo.xcprivacy" build error in Xcode 26).
s.resource_bundles = {
"SyncProvider_Privacy" => ["ios/PrivacyInfo.xcprivacy"]
}
# Apple frameworks the native implementation relies on.
# Foundation — stdlib
# CoreData — queue + history persistence
# Network — NWPathMonitor connectivity tracking
# BackgroundTasks — BGTaskScheduler (iOS 13+; library floor is 15.0)
s.frameworks = "Foundation", "CoreData", "Network", "BackgroundTasks"
s.dependency 'React-jsi'
s.dependency 'React-callinvoker'
load 'nitrogen/generated/ios/SyncProvider+autolinking.rb'
add_nitrogen_files(s)
install_modules_dependencies(s)
# ─── Unit-test sub-spec ────────────────────────────────────────────────
# XCTest target generated by CocoaPods at `pod install` time. Consumer
# Podfiles must opt-in via `:testspecs => ['Tests']` for CocoaPods to
# materialise the scheme in the Pods.xcodeproj. The generated scheme is
# named `SyncProvider-Unit-Tests` because CocoaPods 1.10+ inserts an
# `Unit-` segment for `:test_type => :unit` (the default). Sources live
# under `ios/Tests/**` so they ship in the same git tree as production.
s.test_spec 'Tests' do |test_spec|
test_spec.platforms = { :ios => "15.0" }
test_spec.source_files = "ios/Tests/**/*.swift"
test_spec.requires_app_host = false
test_spec.frameworks = "XCTest", "Foundation", "CoreData", "Network"
end
end