cocoapods-kz 0.0.4 → 0.0.6

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: 2f8cee909ef575acab6b79cbcc8bb35111b0828bdac5b60ff697e09f72939373
4
- data.tar.gz: 71d9afa7f5b11a7e517c4e2a59fcf91d8b1f9f5ff1e55656187fe23468eb86ab
3
+ metadata.gz: 0adb9cf2f4e1a78b6abe18abd9fae6e436a4c7fad05acc3bddf755741c629ac3
4
+ data.tar.gz: f19287aa386c7a8dc5e35c7c968e4561f2d1efd5e89e9c442713d44c1b33efc9
5
5
  SHA512:
6
- metadata.gz: b313218bd5b0dddd59a8f757306c9d1075d4269867b4f092d643fec4d91640d775c496e18ed35936b5a634daf70ed629cd780e55b1962d88ef4707fc5784137b
7
- data.tar.gz: 0dfbce6a258f4d94eec260e16856088d9f97533a63f394be0e9cff6ca66e47f4af68048015c0970454b235d72bbd12e55d65054abbd75c000005f484cc656b2b
6
+ metadata.gz: 3271c951e3d57b6051ab4d50256f9856fe01b5249406a55add7aa82d4ac480e83595d8718767e0b3a23c5294ec36ff9c0a381ebd2ca3dd714b20e066ea366c45
7
+ data.tar.gz: 1c3e23c479465b7fcaedee7976a8407cdfff7febb40a38c77dea9f08126f69cf1d8e8aa6956b35a15b267c1a8203951498d92dc792095857af7e0822393945f5
@@ -31,7 +31,7 @@ module Pod
31
31
  use_framework_tag = argv.flag?('framework')
32
32
  help! if use_code_tag && use_framework_tag
33
33
  KZ::KZGlobalHelper.instance.analyze_special_parameters(use_code_tag, use_framework_tag, argv.arguments!)
34
- if Pod.match_version?('~> 1.4')
34
+ if Pod.match_version?('~> 1.11')
35
35
  KZ::KZGlobalHelper.instance.kz_pod_enable = true
36
36
  KZ::KZGlobalHelper.instance.generate_kz_pod_targets = true
37
37
  end
@@ -31,7 +31,7 @@ module Pod
31
31
  use_framework_tag = argv.flag?('framework')
32
32
  help! if use_code_tag && use_framework_tag
33
33
  KZ::KZGlobalHelper.instance.analyze_special_parameters(use_code_tag, use_framework_tag, argv.arguments!)
34
- if Pod.match_version?('~> 1.4')
34
+ if Pod.match_version?('~> 1.11')
35
35
  KZ::KZGlobalHelper.instance.kz_pod_enable = true
36
36
  KZ::KZGlobalHelper.instance.generate_kz_pod_targets = true
37
37
  end
@@ -1,5 +1,5 @@
1
1
  module CocoapodsKz
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
4
4
 
5
5
  module Pod
@@ -45,7 +45,7 @@ module KZ
45
45
  kz_pod_target = KZPodTarget.new(native_pod_target)
46
46
  is_dev_pod = @development_pods.include?(native_pod_target_name)
47
47
  kz_pod_target.is_dev_pod = is_dev_pod
48
- kz_pod_target.force_config_pod_mode = get_real_config_pod_mode(kz_pod_target)
48
+ kz_pod_target.force_config_pod_mode = get_force_config_pod_mode(kz_pod_target)
49
49
  if config_pod_mode != :kz_pod_origin_mode && !is_dev_pod
50
50
  kz_pod_target.config_pod_mode = config_pod_mode
51
51
  else
@@ -67,7 +67,9 @@ module KZ
67
67
  kz_dependent_target_info[native_dependent_target.name] = kz_dependent_pod_target if kz_dependent_pod_target
68
68
  end
69
69
  kz_pod_target.dependent_target_info = kz_dependent_target_info
70
- kz_pod_target.add_kz_pod_config(KZGlobalHelper.instance.kz_pod_config[native_pod_target_name]) do |repair_dependent_pod_target_name|
70
+ kz_pod_config = KZGlobalHelper.instance.kz_pod_config[native_pod_target_name]
71
+ kz_pod_config = KZGlobalHelper.instance.kz_pod_config[kz_pod_target.root_name] if kz_pod_config == nil
72
+ kz_pod_target.add_kz_pod_config(kz_pod_config) do |repair_dependent_pod_target_name|
71
73
  repair_native_pod_target = get_native_pod_target_with(repair_dependent_pod_target_name)
72
74
  repair_kz_pod_target = nil
73
75
  if repair_native_pod_target
@@ -95,7 +97,7 @@ module KZ
95
97
  kz_pod_targets
96
98
  end
97
99
 
98
- def get_real_config_pod_mode(kz_pod_target)
100
+ def get_force_config_pod_mode(kz_pod_target)
99
101
  if specify_pod_names_contain(kz_pod_target.name)
100
102
  return KZGlobalHelper.instance.specify_pod_mode
101
103
  end
@@ -107,6 +109,8 @@ module KZ
107
109
  specify_pod_names_contain(kz_pod_target.name) ? :kz_pod_framework_mode : :kz_pod_code_mode
108
110
  elsif KZGlobalHelper.instance.specify_pod_mode == :kz_pod_code_mode
109
111
  specify_pod_names_contain(kz_pod_target.name) ? :kz_pod_code_mode : :kz_pod_framework_mode
112
+ elsif KZGlobalHelper.instance.specify_pod_mode == :kz_pod_origin_mode
113
+ use_framework_mode_from_lock_file?(kz_pod_target)
110
114
  end
111
115
  end
112
116
 
@@ -125,5 +129,15 @@ module KZ
125
129
  true
126
130
  end
127
131
  end
132
+
133
+ def use_framework_mode_from_lock_file?(kz_pod_target)
134
+ if File.exist?(KZ_LOCK_FILE_PATH)
135
+ @lock_file ||= JSON.parse(File.read(KZ_LOCK_FILE_PATH))
136
+ pod_lock_config = @lock_file[kz_pod_target.name]
137
+ return :kz_pod_framework_mode if pod_lock_config['use_framework']
138
+ end
139
+ :kz_pod_code_mode
140
+ end
141
+
128
142
  end
129
143
  end
@@ -48,7 +48,19 @@ find "${CURRENT_PRODUCT_DIR}" -iname "*.bundle" | while read -r BUNDLE_FILE; do
48
48
  done
49
49
 
50
50
  if [ -f ${PRODUCT_DIR}/${PRODUCT_NAME} ] && [ -f ${PRODUCT_SIMULATOR_DIR}/${PRODUCT_NAME} ]; then
51
- lipo -create ${PRODUCT_DIR}/${PRODUCT_NAME} ${PRODUCT_SIMULATOR_DIR}/${PRODUCT_NAME} -output "${KZ_FRAMEWORK_CACHE_PATH}/${PRODUCT_NAME}.framework/${PRODUCT_NAME}"
51
+ lipo -create ${PRODUCT_DIR}/${PRODUCT_NAME} ${PRODUCT_SIMULATOR_DIR}/${PRODUCT_NAME} -output "${KZ_FRAMEWORK_CACHE_PATH}/${FULL_PRODUCT_NAME}/${PRODUCT_NAME}"
52
+ fi
53
+
54
+ if [ -d ${PRODUCT_DIR}/Modules/${PRODUCT_NAME}.swiftmodule ] && [ -d ${PRODUCT_SIMULATOR_DIR}/Modules/${PRODUCT_NAME}.swiftmodule ]; then
55
+ cp -r ${PRODUCT_DIR}/Modules/${PRODUCT_NAME}.swiftmodule "${KZ_FRAMEWORK_CACHE_PATH}/${FULL_PRODUCT_NAME}/Modules"
56
+ cp -r ${PRODUCT_SIMULATOR_DIR}/Modules/${PRODUCT_NAME}.swiftmodule "${KZ_FRAMEWORK_CACHE_PATH}/${FULL_PRODUCT_NAME}/Modules"
57
+ fi
58
+
59
+ PRODUCT_SWIFT_H=${PRODUCT_DIR}/Headers/${PRODUCT_NAME}-Swift.h
60
+ PRODUCT_SIMULATOR_SWIFT_H=${PRODUCT_SIMULATOR_DIR}/Headers/${PRODUCT_NAME}-Swift.h
61
+ TARGET_SWIFT_H=${KZ_FRAMEWORK_CACHE_PATH}/${FULL_PRODUCT_NAME}/Headers/${PRODUCT_NAME}-Swift.h
62
+ if [ -f $PRODUCT_SWIFT_H ] && [ -f $PRODUCT_SIMULATOR_SWIFT_H ]; then
63
+ ruby "$KZ_MERGE_SWIFT_H_PATH" "$PRODUCT_SWIFT_H" "$PRODUCT_SIMULATOR_SWIFT_H" "$TARGET_SWIFT_H"
52
64
  fi
53
65
  }
54
66
  end
@@ -204,8 +216,8 @@ fi}
204
216
  end
205
217
 
206
218
  unless kz_pod_target.is_dev_pod
207
- # 各别第三方在使用自己组件文件时,会使用#import <xx/xx.h>的方式
208
- hmap_info[kz_pod_target.name + '/' + header_pathname_basename] = header_hmap_value_quotes
219
+ # 个别第三方在使用自己组件文件时,会使用#import <xx/xx.h>的方式
220
+ hmap_info[kz_pod_target.product_basename + '/' + header_pathname_basename] = header_hmap_value_quotes
209
221
  end
210
222
 
211
223
  if kz_pod_target.uses_swift && kz_pod_target.is_dev_pod
@@ -224,7 +236,7 @@ fi}
224
236
  elsif hmap_content_style == HmapContentStyle::QUOTES_REPAIR
225
237
  header_hmap_value_slash = {}
226
238
  header_hmap_value_slash['suffix'] = header_pathname_basename
227
- prefix_name = kz_pod_target.name
239
+ prefix_name = kz_pod_target.product_basename
228
240
  if header_pathname.dirname.to_s.include?('.framework')
229
241
  header_pathname.dirname.to_s.split('/').each do |name|
230
242
  if name.include?('.framework')
@@ -15,6 +15,7 @@ module KZ
15
15
  HMAP_EXECUTE_PATH = File.dirname(__FILE__) + '/../resources/hmap'
16
16
  FLEX_COMPLIER_PATH = KZ_POD_CONFIG_ROOT + 'FlexCompiler'
17
17
  KZ_LOCK_FILE_PATH = KZ_POD_CONFIG_ROOT + 'KZConfigLock'
18
+ KZ_MERGE_SWIFT_H_PATH = KZ_POD_CONFIG_ROOT + 'kz_merge_swift_h.rb'
18
19
 
19
20
  def self.deal_path_for_xcconfig(path, add_quotes = false)
20
21
  if path.is_a?(String)
@@ -59,15 +60,20 @@ module KZ
59
60
  end
60
61
 
61
62
  def prepare
62
- FileUtils.rm(KZ_LOCK_FILE_PATH) if File.exist?(KZ_LOCK_FILE_PATH)
63
- FileUtils.mkdir_p(KZ_POD_CONFIG_ROOT) unless File.exist?(KZ_POD_CONFIG_ROOT)
64
-
65
- flex_compiler_de_path = KZ_POD_CONFIG_ROOT + 'FlexCompiler'
66
- FileUtils.rm(flex_compiler_de_path) if File.exist?(flex_compiler_de_path)
67
- FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/FlexCompiler', KZ_POD_CONFIG_ROOT)
68
- system("chmod +x #{flex_compiler_de_path}")
69
-
70
- Pod::Config.instance.podfile.use_frameworks!(:linkage => :static) if Pod::Config.instance.podfile
63
+ if Pod::Config.instance.podfile && Pod::Config.instance.podfile.plugins.has_key?("cocoapods-kz")
64
+ FileUtils.mkdir_p(KZ_POD_CONFIG_ROOT) unless File.exist?(KZ_POD_CONFIG_ROOT)
65
+
66
+ flex_compiler_de_path = KZ_POD_CONFIG_ROOT + 'FlexCompiler'
67
+ FileUtils.rm(flex_compiler_de_path) if File.exist?(flex_compiler_de_path)
68
+ FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/FlexCompiler', KZ_POD_CONFIG_ROOT)
69
+ system("chmod +x #{flex_compiler_de_path}")
70
+ FileUtils.cp_r(File.dirname(__FILE__) + '/../resources/kz_merge_swift_h.rb', KZ_MERGE_SWIFT_H_PATH)
71
+
72
+ Pod::Config.instance.podfile.use_frameworks!(:linkage => :static)
73
+ else
74
+ @kz_pod_enable = false
75
+ @generate_kz_pod_targets = false
76
+ end
71
77
  end
72
78
 
73
79
  def analyze_special_parameters(use_code_tag, use_framework_tag, pod_names)
@@ -123,5 +129,9 @@ module KZ
123
129
  end
124
130
  end
125
131
 
132
+ def kz_merge_swift_h_path
133
+ KZ_POD_CONFIG_ROOT_STR + '/kz_merge_swift_h.rb'
134
+ end
135
+
126
136
  end
127
137
  end
@@ -0,0 +1,31 @@
1
+
2
+ module Pod
3
+ class Specification
4
+
5
+ def deployment_target(platform_name)
6
+ result = platform_hash[platform_name.to_s]
7
+ result ||= parent.deployment_target(platform_name) if parent
8
+ result = "9.0" if platform_name == "ios" && (result == nil || result.to_f < 9.0)
9
+ result
10
+ end
11
+
12
+ def platform_hash
13
+ case value = attributes_hash['platforms']
14
+ when String
15
+ { value => nil }
16
+ when Array
17
+ result = {}
18
+ value.each do |a_value|
19
+ result[a_value] = nil
20
+ end
21
+ result
22
+ when Hash
23
+ ios = value["ios"]
24
+ value["ios"] = 9.0 if ios == nil || ios.to_f < 9.0
25
+ value
26
+ else
27
+ {}
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,5 +1,6 @@
1
1
  require 'cocoapods-kz/helpers/kz_global_helper'
2
2
  require 'cocoapods-kz/helpers/kz_pod_target'
3
+ require 'xcodeproj'
3
4
 
4
5
  module Pod
5
6
  class Installer
@@ -15,22 +16,30 @@ module Pod
15
16
  end
16
17
 
17
18
  if generator.is_a?(Pod::Target::BuildSettings::AggregateTargetSettings)
18
- xcconfig = generator.xcconfig
19
- kz_clean_xcconfig(xcconfig)
20
- main_hamp_search_path = '"' + KZ::KZ_POD_CONFIG_ROOT_STR + "/#{self.target.user_project.root_object.display_name}.hmap" + '"'
21
- self.target.pod_targets.each do |native_pod_target|
22
- kz_pod_target = native_pod_target.weakRef_kz_pod_target
23
- if kz_pod_target
24
- if kz_pod_target.repair_header_search_path
25
- main_hamp_search_path += (' ' + KZ.deal_path_for_xcconfig(kz_pod_target.repair_header_search_path, true))
19
+ unless self.target.application_extension_api_only
20
+ xcconfig = generator.xcconfig
21
+ kz_clean_xcconfig(xcconfig)
22
+ main_hamp_search_path = '"' + KZ::KZ_POD_CONFIG_ROOT_STR + "/#{self.target.user_project.root_object.display_name}.hmap" + '"'
23
+ pod_targets = self.target.pod_targets_for_build_configuration(generator.configuration_name)
24
+ pod_targets.each do |native_pod_target|
25
+ kz_pod_target = native_pod_target.weakRef_kz_pod_target
26
+ if kz_pod_target
27
+ if kz_pod_target.repair_header_search_path
28
+ main_hamp_search_path += (' ' + KZ.deal_path_for_xcconfig(kz_pod_target.repair_header_search_path, true))
29
+ end
30
+ add_repair_modulemap(xcconfig, kz_pod_target.all_repair_modulemap_paths)
26
31
  end
27
- add_repair_modulemap(xcconfig, kz_pod_target.all_repair_modulemap_paths)
28
32
  end
29
- end
30
- xcconfig.attributes['HEADER_SEARCH_PATHS'] = main_hamp_search_path
31
- xcconfig.attributes['USE_HEADERMAP'] = 'NO'
33
+ xcconfig.attributes['HEADER_SEARCH_PATHS'] = main_hamp_search_path
34
+ xcconfig.attributes['USE_HEADERMAP'] = 'NO'
32
35
 
33
- kz_update_xcconfig_file(xcconfig, path)
36
+ if generator.configuration_name == 'Debug' && check_default_xcode_version_for_ld64
37
+ other_linker_flags = xcconfig.other_linker_flags[:simple]
38
+ other_linker_flags << '-ld64'
39
+ end
40
+ kz_update_xcconfig_file(xcconfig, path)
41
+ return
42
+ end
34
43
  elsif generator.is_a?(Pod::Target::BuildSettings::PodTargetSettings)
35
44
  kz_pod_target = self.target.weakRef_kz_pod_target
36
45
  if kz_pod_target
@@ -39,15 +48,14 @@ module Pod
39
48
  xcconfig.attributes['USE_HEADERMAP'] = 'NO'
40
49
  framework_cache_path = KZ.deal_path_for_xcconfig(kz_pod_target.pod_config_cache_path(true))
41
50
  xcconfig.attributes['KZ_FRAMEWORK_CACHE_PATH'] = framework_cache_path
51
+ xcconfig.attributes['KZ_MERGE_SWIFT_H_PATH'] = KZ::KZGlobalHelper.instance.kz_merge_swift_h_path
42
52
 
43
53
  add_repair_modulemap(xcconfig, kz_pod_target.all_repair_modulemap_paths)
44
54
  kz_update_xcconfig_file(xcconfig, path)
45
- else
46
- origin_update_changed_file(generator, path)
55
+ return
47
56
  end
48
- else
49
- origin_update_changed_file(generator, path)
50
57
  end
58
+ origin_update_changed_file(generator, path)
51
59
  end
52
60
 
53
61
  def add_repair_modulemap(xcconfig, repair_modulemap_paths)
@@ -65,7 +73,6 @@ module Pod
65
73
  end
66
74
  end
67
75
 
68
-
69
76
  def kz_update_xcconfig_file(xcconfig, path)
70
77
  if path.exist?
71
78
  contents = xcconfig.to_s
@@ -98,6 +105,19 @@ module Pod
98
105
  xcconfig.attributes['OTHER_CFLAGS'] = new_flags.join(' ')
99
106
  end
100
107
 
108
+ def check_default_xcode_version_for_ld64
109
+ default_xcode_path = Pathname.new('/Applications/Xcode.app')
110
+ return false unless File.exist?(default_xcode_path)
111
+
112
+ xcode_info_plist = default_xcode_path + 'Contents/Info.plist'
113
+ _xcode_info_plist = KZ::KZ_POD_CONFIG_ROOT + 'Xcode_Info.plist'
114
+ FileUtils.cp(xcode_info_plist, _xcode_info_plist)
115
+ system "plutil -convert xml1 #{_xcode_info_plist.to_s} #{_xcode_info_plist.to_s}"
116
+ plist_hash = Xcodeproj::Plist.read_from_path(_xcode_info_plist)
117
+ FileUtils.rm(_xcode_info_plist)
118
+ plist_hash['CFBundleShortVersionString'] == '15.0'
119
+ end
120
+
101
121
  end
102
122
  end
103
123
  end
@@ -1,7 +1,7 @@
1
1
  require 'cocoapods'
2
2
  require_relative 'gem_version'
3
3
 
4
- if Pod.match_version?('~> 1.4')
4
+ if Pod.match_version?('~> 1.11')
5
5
  require 'cocoapods-kz/native/dls'
6
6
  require 'cocoapods-kz/native/installer'
7
7
  require 'cocoapods-kz/native/acknowledgements'
@@ -11,4 +11,5 @@ if Pod.match_version?('~> 1.4')
11
11
  require 'cocoapods-kz/native/target_installer_helper'
12
12
  require 'cocoapods-kz/native/pod_target'
13
13
  require 'cocoapods-kz/native/pod_target_installer'
14
+ require 'cocoapods-kz/native/specification'
14
15
  end
@@ -0,0 +1,14 @@
1
+ require 'fileutils'
2
+ require 'pathname'
3
+
4
+ product_swift_h_path = Pathname.new(ARGV[0])
5
+ product_simulator_swift_h_path = Pathname.new(ARGV[1])
6
+ target_swfit_h_path = Pathname.new(ARGV[2])
7
+
8
+ if File.exist?(product_swift_h_path) && File.exist?(product_simulator_swift_h_path)
9
+ FileUtils.cp_r(product_swift_h_path, target_swfit_h_path)
10
+ replacement = File.read(product_simulator_swift_h_path)
11
+ content_a = File.read(target_swfit_h_path)
12
+ content_a.gsub!("#error unsupported Swift architecture", replacement)
13
+ File.write(target_swfit_h_path, content_a)
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-kz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - yixiong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-02 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,10 +68,12 @@ files:
68
68
  - lib/cocoapods-kz/native/installer.rb
69
69
  - lib/cocoapods-kz/native/pod_target.rb
70
70
  - lib/cocoapods-kz/native/pod_target_installer.rb
71
+ - lib/cocoapods-kz/native/specification.rb
71
72
  - lib/cocoapods-kz/native/target.rb
72
73
  - lib/cocoapods-kz/native/target_installer_helper.rb
73
74
  - lib/cocoapods-kz/resources/FlexCompiler
74
75
  - lib/cocoapods-kz/resources/hmap
76
+ - lib/cocoapods-kz/resources/kz_merge_swift_h.rb
75
77
  - lib/cocoapods_plugin.rb
76
78
  homepage: https://github.com/EXAMPLE/cocoapods-kz
77
79
  licenses: