Repository navigation
Expand file tree
/
Copy pathreact-native-adjust.podspec
More file actions
54 lines (43 loc) · 2.23 KB
/
Copy pathreact-native-adjust.podspec
File metadata and controls
54 lines (43 loc) · 2.23 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
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
ADJUST_IOS_SDK_VERSION = '5.8.2' unless defined?(ADJUST_IOS_SDK_VERSION)
ADJUST_SPM_URL = 'https://github.com/adjust/ios_sdk' unless defined?(ADJUST_SPM_URL)
Pod::Spec.new do |s|
spm_requested = defined?($RNAdjustUseSPM) && $RNAdjustUseSPM == true
spm_available = defined?(spm_dependency) ? true : false
use_spm = spm_requested && spm_available
odm_requested = defined?($RNAdjustUseGoogleOdmPlugin) && $RNAdjustUseGoogleOdmPlugin == true
s.name = package['name']
s.version = package['version']
s.summary = package['description']
s.description = package['name']
s.license = package['license']
s.author = package['author']
s.homepage = package['homepage']
s.source = { :git => 'git://github.com/adjust/react_native_sdk.git', :tag => s.version }
s.requires_arc = true
s.platform = :ios, '12.0'
s.preserve_paths = 'LICENSE', 'README.md', 'package.json', 'index.js', 'scripts/*.rb'
s.source_files = 'ios/*.{h,m}'
s.dependency 'React-Core'
if spm_requested && !spm_available
Pod::UI.warn "#{s.name}: $RNAdjustUseSPM set but React Native's spm_dependency helper is unavailable (requires RN 0.75+). Falling back to CocoaPods for the native SDK."
end
if use_spm
require_relative 'scripts/adjust_podfile'
unless AdjustSpm.activate!(ADJUST_IOS_SDK_VERSION)
Pod::UI.warn "#{s.name}: couldn't hook into this CocoaPods version. Add `adjust_embed_native_sdk_spm!(installer)` to a post_integrate block in your Podfile, or the app crashes at launch."
end
# AdjustSigSdk is a dynamic framework from AdjustSdk's package. Link it from the app
# target so it loads at launch with static and dynamic pod linkage alike.
s.user_target_xcconfig = { 'OTHER_LDFLAGS' => '$(inherited) -framework "AdjustSigSdk"' }
spm_dependency(
s,
url: ADJUST_SPM_URL,
requirement: { kind: 'exactVersion', version: ADJUST_IOS_SDK_VERSION },
products: odm_requested ? ['AdjustSdk', 'AdjustGoogleOdmPlugin'] : ['AdjustSdk']
)
else
s.dependency odm_requested ? 'Adjust/AdjustGoogleOdm' : 'Adjust', ADJUST_IOS_SDK_VERSION
end
end