cocoapods-kz 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dbfec23581ec953d3d7886a2aa6007bbbb10f5d3355fa6a81fd532cb9cd3a6e
4
- data.tar.gz: ad0eea404a2b6e8015c8f5e574c3cff081e40c4f6a7f8647fa2cf0a1598a7dd0
3
+ metadata.gz: 6c9619f1947bb18ec49029b61641468d7f9df706184017ec8e77d2b17d1a58d0
4
+ data.tar.gz: dce63b4ca62cea830b0104106f92166ac0fa9b7d00e0110378f32efe4d43fe94
5
5
  SHA512:
6
- metadata.gz: 8884f42d577af7e435d804ad0c028b9e296123d0b0b10cbffa64cc244db7c52b4910cbaff33d6eabaa898371f1aaa09866b7b9ee679f65f682766b74fd052d5f
7
- data.tar.gz: d8fba21db82fc7d30ccb5536434e5cf020319c56f31920a5723d1c6fbb47c7f6cbf6122a97c9e3d4e0f1c0682571fa65ece9a728edfc632bec4ab165b63dbe78
6
+ metadata.gz: 349028d335d34a1d9b186d61e377c78feb03ebe4447136970e469f192ec6e7bf785026fa2420fd31714f7c9172abdb14f533ceb8e090a13accba984ea116198b
7
+ data.tar.gz: 646ca98a19160714c566e70f64b1f822f6a05e9f1531c1970ec0e89534198054c71e2c2b24659cb747cfb2c8592a6a79c335d1ff6f29f504f604cc9368186bbe
@@ -1,5 +1,5 @@
1
1
  module CocoapodsKz
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
4
4
 
5
5
  module Pod
@@ -54,7 +54,8 @@ module Pod
54
54
  xcconfig.attributes['USE_HEADERMAP'] = 'NO'
55
55
  xcconfig.attributes["KZ_POD_CONFIG_ROOT"] = KZ::KZ_POD_CONFIG_ROOT_STR
56
56
  if KZ::KZGlobalHelper.instance.arm64_simulator
57
- xcconfig.attributes.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]")
57
+ xcconfig.attributes.delete_if { |key, _value| key.to_s.start_with?("VALID_ARCHS") }
58
+ xcconfig.attributes.delete_if { |key, _value| key.to_s.start_with?("EXCLUDED_ARCHS") }
58
59
  xcconfig.attributes['VALID_ARCHS'] = 'arm64 arm64_32 x86_64'
59
60
  end
60
61
  if KZ::KZGlobalHelper.instance.on_demand_resources_info.odr_target_names.include?(self.target.name.sub('Pods-', ''))
@@ -98,7 +99,8 @@ module Pod
98
99
  xcconfig.attributes['KZ_FIX_FORCE_LOAD_EXE_FOLDER'] = kz_pod_target.configuration_build_dir(true)
99
100
  end
100
101
  if KZ::KZGlobalHelper.instance.arm64_simulator
101
- xcconfig.attributes.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]")
102
+ xcconfig.attributes.delete_if { |key, _value| key.to_s.start_with?("VALID_ARCHS") }
103
+ xcconfig.attributes.delete_if { |key, _value| key.to_s.start_with?("EXCLUDED_ARCHS") }
102
104
  xcconfig.attributes['VALID_ARCHS'] = 'arm64 arm64_32 x86_64'
103
105
  end
104
106
 
@@ -4,9 +4,11 @@ if [ "${MACH_O_TYPE}" != "staticlib" ]; then
4
4
  exit 0
5
5
  fi
6
6
 
7
+ XCFRAMEWORK_OUTPUT="${KZ_FRAMEWORK_CACHE_PATH}/${PRODUCT_NAME}.xcframework"
8
+
7
9
  if [ -d "${KZ_FRAMEWORK_CACHE_PATH}" ]; then
8
- if [ -d "${KZ_FRAMEWORK_CACHE_PATH}/${PRODUCT_NAME}.xcframework" ]; then
9
- rm -r "${KZ_FRAMEWORK_CACHE_PATH}/${PRODUCT_NAME}.xcframework"
10
+ if [ -d "${XCFRAMEWORK_OUTPUT}" ]; then
11
+ rm -r "${XCFRAMEWORK_OUTPUT}"
10
12
  fi
11
13
  else
12
14
  mkdir -p "${KZ_FRAMEWORK_CACHE_PATH}"
@@ -34,10 +36,59 @@ if [ "${OPPOSE_PLATFORM_NAME}" = "" ]; then
34
36
  fi
35
37
 
36
38
  OPPOSE_PRODUCT_FULL_DIR=${PODS_BUILD_DIR}/${CONFIGURATION}-${OPPOSE_PLATFORM_NAME}/${TARGET_NAME}/${FULL_PRODUCT_NAME}
37
- if [ -d "${OPPOSE_PRODUCT_FULL_DIR}" ]; then
38
- xcodebuild -create-xcframework -allow-internal-distribution -framework $(readlink -f "${CURRENT_PRODUCT_DIR}/${FULL_PRODUCT_NAME}") -framework $(readlink -f "${OPPOSE_PRODUCT_FULL_DIR}") \
39
- -output "${KZ_FRAMEWORK_CACHE_PATH}/${PRODUCT_NAME}.xcframework"
40
- else
41
- xcodebuild -create-xcframework -allow-internal-distribution -framework $(readlink -f "${CURRENT_PRODUCT_DIR}/${FULL_PRODUCT_NAME}") \
42
- -output "${KZ_FRAMEWORK_CACHE_PATH}/${PRODUCT_NAME}.xcframework"
39
+ OPPOSE_BINARY="${OPPOSE_PRODUCT_FULL_DIR}/${PRODUCT_NAME}"
40
+
41
+ resolve_framework_path() {
42
+ local FRAMEWORK_PATH="$1"
43
+ local RESOLVED_PATH
44
+ RESOLVED_PATH=$(readlink -f "${FRAMEWORK_PATH}" 2>/dev/null)
45
+ if [ $? -ne 0 ] || [ -z "${RESOLVED_PATH}" ] || [ ! -d "${RESOLVED_PATH}" ]; then
46
+ return 1
47
+ fi
48
+ echo "${RESOLVED_PATH}"
49
+ }
50
+
51
+ remove_xcframework_output() {
52
+ if [ -d "${XCFRAMEWORK_OUTPUT}" ]; then
53
+ rm -r "${XCFRAMEWORK_OUTPUT}"
54
+ fi
55
+ }
56
+
57
+ create_single_platform_xcframework() {
58
+ remove_xcframework_output
59
+ xcodebuild -create-xcframework -allow-internal-distribution \
60
+ -framework "${CURRENT_FRAMEWORK_PATH}" \
61
+ -output "${XCFRAMEWORK_OUTPUT}"
62
+ }
63
+
64
+ if ! CURRENT_FRAMEWORK_PATH=$(resolve_framework_path "${CURRENT_PRODUCT_DIR}/${FULL_PRODUCT_NAME}"); then
65
+ echo "error: [KZ] Unable to resolve current platform framework: ${CURRENT_PRODUCT_DIR}/${FULL_PRODUCT_NAME}" >&2
66
+ exit 1
67
+ fi
68
+
69
+ CURRENT_BINARY="${CURRENT_FRAMEWORK_PATH}/${PRODUCT_NAME}"
70
+ if [ ! -f "${CURRENT_BINARY}" ] || [ ! -r "${CURRENT_BINARY}" ]; then
71
+ echo "error: [KZ] Current platform framework binary is unavailable: ${CURRENT_BINARY}" >&2
72
+ exit 1
73
+ fi
74
+
75
+ if [ -f "${OPPOSE_BINARY}" ] && [ -r "${OPPOSE_BINARY}" ]; then
76
+ if OPPOSE_FRAMEWORK_PATH=$(resolve_framework_path "${OPPOSE_PRODUCT_FULL_DIR}"); then
77
+ if xcodebuild -create-xcframework -allow-internal-distribution \
78
+ -framework "${CURRENT_FRAMEWORK_PATH}" \
79
+ -framework "${OPPOSE_FRAMEWORK_PATH}" \
80
+ -output "${XCFRAMEWORK_OUTPUT}"; then
81
+ exit 0
82
+ fi
83
+ echo "warning: [KZ] Failed to create a dual-platform xcframework; falling back to the current platform only: ${OPPOSE_FRAMEWORK_PATH}" >&2
84
+ else
85
+ echo "warning: [KZ] Unable to resolve the opposite platform framework; falling back to the current platform only: ${OPPOSE_PRODUCT_FULL_DIR}" >&2
86
+ fi
87
+ elif [ -d "${OPPOSE_PRODUCT_FULL_DIR}" ]; then
88
+ echo "warning: [KZ] Opposite platform framework binary is unavailable; falling back to the current platform only: ${OPPOSE_BINARY}" >&2
89
+ fi
90
+
91
+ if ! create_single_platform_xcframework; then
92
+ echo "error: [KZ] Failed to create a current-platform xcframework: ${CURRENT_FRAMEWORK_PATH}" >&2
93
+ exit 1
43
94
  fi
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-kz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - yixiong