react-native-netmera 2.2.0-alpha03 → 2.2.0-alpha04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/netmera_pod_helpers.rb +60 -0
- package/package.json +3 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Call from your Podfile's post_install block, after react_native_post_install:
|
|
2
|
+
#
|
|
3
|
+
# post_install do |installer|
|
|
4
|
+
# react_native_post_install(installer, config[:reactNativePath], :mac_catalyst_enabled => false)
|
|
5
|
+
# netmera_post_install(installer)
|
|
6
|
+
# end
|
|
7
|
+
#
|
|
8
|
+
# Safe to call regardless of whether NETMERA_USE_SPM is set — each fix below
|
|
9
|
+
# only applies when the target/files it looks for actually exist.
|
|
10
|
+
def netmera_post_install(installer)
|
|
11
|
+
# Swinject is compiled from source when the Netmera SDK is resolved via CocoaPods
|
|
12
|
+
# (the default). Without library evolution enabled, it can only be imported by the
|
|
13
|
+
# exact Swift compiler version that compiled it, which breaks as soon as the
|
|
14
|
+
# consuming app's toolchain differs even slightly ("this SDK is not supported by
|
|
15
|
+
# the compiler..."). No-op when NETMERA_USE_SPM=1 (Swinject then comes prebuilt
|
|
16
|
+
# from Netmera/swift-sdk with a stable module interface already).
|
|
17
|
+
installer.pods_project.targets.each do |target|
|
|
18
|
+
if target.name.include?('Swinject')
|
|
19
|
+
target.build_configurations.each do |config|
|
|
20
|
+
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# React Native's spm_dependency CocoaPods bridge links Swift Package Manager
|
|
26
|
+
# products correctly but never embeds them into the app bundle (no code in RN's
|
|
27
|
+
# own spm.rb does this as of this writing). This is invisible on the simulator
|
|
28
|
+
# (it can load frameworks straight from DerivedData) but crashes on a real
|
|
29
|
+
# device at launch: "Library not loaded: @rpath/<Name>.framework/<Name>".
|
|
30
|
+
# Copies whatever Xcode staged under RNNetmera's own build products folder into
|
|
31
|
+
# the app's Frameworks/ folder and re-signs it, exactly like CocoaPods' own
|
|
32
|
+
# "Embed Pods Frameworks" phase does for regular pods. No-op when
|
|
33
|
+
# NETMERA_USE_SPM is unset (nothing to copy, directory won't exist).
|
|
34
|
+
installer.aggregate_targets.each do |aggregate_target|
|
|
35
|
+
aggregate_target.user_targets.each do |user_target|
|
|
36
|
+
user_target.build_phases
|
|
37
|
+
.select { |p| p.respond_to?(:name) && p.name == '[Netmera] Embed SPM Frameworks' }
|
|
38
|
+
.each { |old_phase| user_target.build_phases.delete(old_phase) }
|
|
39
|
+
|
|
40
|
+
phase = user_target.new_shell_script_build_phase('[Netmera] Embed SPM Frameworks')
|
|
41
|
+
phase.shell_script = <<~SCRIPT
|
|
42
|
+
SRC_DIR="${BUILT_PRODUCTS_DIR}/RNNetmera"
|
|
43
|
+
DEST_DIR="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
|
44
|
+
if [ -d "$SRC_DIR" ]; then
|
|
45
|
+
mkdir -p "$DEST_DIR"
|
|
46
|
+
for fw in "$SRC_DIR"/*.framework; do
|
|
47
|
+
[ -d "$fw" ] || continue
|
|
48
|
+
name=$(basename "$fw")
|
|
49
|
+
[ "$name" = "RNNetmera.framework" ] && continue
|
|
50
|
+
rsync -a --delete "$fw" "$DEST_DIR/"
|
|
51
|
+
if [ -n "$EXPANDED_CODE_SIGN_IDENTITY" ]; then
|
|
52
|
+
/usr/bin/codesign --force --sign "$EXPANDED_CODE_SIGN_IDENTITY" --preserve-metadata=identifier,entitlements,flags "$DEST_DIR/$name"
|
|
53
|
+
fi
|
|
54
|
+
done
|
|
55
|
+
fi
|
|
56
|
+
SCRIPT
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
installer.aggregate_targets.map(&:user_project).uniq.each(&:save)
|
|
60
|
+
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-netmera",
|
|
3
|
-
"version": "2.2.0-
|
|
3
|
+
"version": "2.2.0-alpha04",
|
|
4
4
|
"description": "Netmera React Native SDK",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"types": "./lib/typescript/src/index.d.ts",
|
|
11
11
|
"default": "./lib/module/index.js"
|
|
12
12
|
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
"./ios/*": "./ios/*"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"src",
|