cocoapods-jxedt 0.0.15 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-jxedt/binary/Intergation.rb +6 -0
- data/lib/cocoapods-jxedt/binary/config.rb +7 -0
- data/lib/cocoapods-jxedt/binary/helper/prebuild_sandbox.rb +17 -1
- data/lib/cocoapods-jxedt/binary/helper/target_definition.rb +12 -2
- data/lib/cocoapods-jxedt/binary/hooks/pre_install.rb +4 -3
- data/lib/cocoapods-jxedt/binary/podfile_dsl.rb +7 -0
- data/lib/cocoapods-jxedt/command/binary/command/statistics.rb +7 -0
- data/lib/cocoapods-jxedt/gem_version.rb +1 -1
- data/lib/cocoapods-jxedt/git_helper/cache_fetcher.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87b8390f2490128b3ae787cd3a5d1ae8677eda84a3d8b2817f9d89fef6b47e1d
|
4
|
+
data.tar.gz: b43bef366375925d915be7bf0a4e4b745a1f2eaf506ea0991f6cd7292bce849c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a771222219d027b4f5b5de8077c63d6d9e04450b39c8383e940a1c3b1bf2bdccdd0c974d024ba4a9e8b30da82a530c4370d79c4f14067f1384a9d0fea8d6c4c
|
7
|
+
data.tar.gz: 2a7f8424df70d69f239aa28996152857504e6e07253521fefab8b9370c15a03c98b0effa5637a08ac82a004e75622708a7b3c1d99a2b1af4baa0cd22d0792772
|
@@ -140,6 +140,12 @@ module Pod
|
|
140
140
|
# rmtree
|
141
141
|
target_prebuild_files = self.sandbox.pod_dir(spec.name) + "_Prebuild"
|
142
142
|
target_prebuild_files.rmtree if target_prebuild_files.exist?
|
143
|
+
|
144
|
+
# 切换到local pod时,清除一下pod所在目录下的_Prebuild文件夹
|
145
|
+
if self.sandbox.local?(spec.root.name)
|
146
|
+
source_target_prebuild_files = self.sandbox.sources_root + spec.root.name + "_Prebuild"
|
147
|
+
source_target_prebuild_files.rmtree if source_target_prebuild_files.exist?
|
148
|
+
end
|
143
149
|
|
144
150
|
self.prebuild_pod_names.include? spec.root.name
|
145
151
|
end)
|
@@ -63,6 +63,13 @@ module Jxedt
|
|
63
63
|
@dsl_config[:all_binary] || false
|
64
64
|
end
|
65
65
|
|
66
|
+
def binary_settings
|
67
|
+
@options ||= begin
|
68
|
+
@dsl_config[:use_binary_settings] || {}
|
69
|
+
end
|
70
|
+
@options
|
71
|
+
end
|
72
|
+
|
66
73
|
def binary_switch?
|
67
74
|
@dsl_config[:binary_switch] || @dsl_config[:binary_switch].nil?
|
68
75
|
end
|
@@ -109,7 +109,23 @@ module Pod
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def clean_source_project!
|
112
|
-
|
112
|
+
if Jxedt.config.keep_source_project?
|
113
|
+
# 修改productName后,可以把源码工程拖入workspace中源码调试,而源码不链接和编译
|
114
|
+
require 'xcodeproj'
|
115
|
+
project = Xcodeproj::Project.open(project_path)
|
116
|
+
project.targets.each do |target|
|
117
|
+
target.build_configurations.each do |config|
|
118
|
+
# 修改工程的product name
|
119
|
+
product_name = config.build_settings['PRODUCT_NAME'] || target.name
|
120
|
+
config.build_settings['PRODUCT_NAME'] = "#{product_name}_Source"
|
121
|
+
end
|
122
|
+
# target.name = "#{target.name}_Source"
|
123
|
+
end
|
124
|
+
project.save
|
125
|
+
|
126
|
+
# 保存源码工程,退出
|
127
|
+
return
|
128
|
+
end
|
113
129
|
|
114
130
|
sources_root.rmtree if real_path_compiler? && sources_root.exist?
|
115
131
|
root.rmtree if root.exist?
|
@@ -7,8 +7,18 @@ module Pod
|
|
7
7
|
# prebuild
|
8
8
|
@explicit_prebuild_pod_names ||= []
|
9
9
|
@reject_prebuild_pod_names ||= []
|
10
|
-
|
11
|
-
|
10
|
+
if options.is_a?(Hash) && options.include?(:binary)
|
11
|
+
@explicit_prebuild_pod_names << Specification.root_name(name) if options[:binary]
|
12
|
+
@reject_prebuild_pod_names << Specification.root_name(name) unless options[:binary]
|
13
|
+
else
|
14
|
+
settings = Jxedt.config.binary_settings
|
15
|
+
symbol_name = Specification.root_name(name).to_sym
|
16
|
+
if settings.include?(symbol_name) && [true, false].include?(settings[symbol_name])
|
17
|
+
@explicit_prebuild_pod_names << Specification.root_name(name) if settings[symbol_name]
|
18
|
+
@reject_prebuild_pod_names << Specification.root_name(name) unless settings[symbol_name]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
12
22
|
|
13
23
|
# header search path
|
14
24
|
@explicit_header_search_pod_names ||= []
|
@@ -45,10 +45,11 @@ module Jxedt
|
|
45
45
|
# fetch cache and sync
|
46
46
|
if Jxedt.config.cache_repo_enabled? && Jxedt.config.auto_fetch?
|
47
47
|
log_section "🚗 Fetch git cache"
|
48
|
-
|
49
|
-
|
48
|
+
# 统计需要prebuild的targets
|
49
|
+
prebuild_pods = Jxedt::Prebuild.new(source_installer).targets_to_prebuild.map(&:pod_name)
|
50
|
+
binary_hash = prebuild_pods.reduce({}) do |hash, name|
|
50
51
|
checksum = prebuild_sandbox.source_lockfile.spec_checksums_hash_key(name)
|
51
|
-
hash.update(name => checksum)
|
52
|
+
hash.update(name => checksum)
|
52
53
|
end
|
53
54
|
|
54
55
|
require 'cocoapods-jxedt/git_helper/cache_fetcher'
|
@@ -17,6 +17,13 @@ module Pod
|
|
17
17
|
Jxedt.config.dsl_config.merge!({'framework_header_search_enabled': true})
|
18
18
|
end
|
19
19
|
|
20
|
+
# 统一设置是否使用binary
|
21
|
+
def use_binary_settings(options=nil)
|
22
|
+
return if options.nil?
|
23
|
+
return unless options.is_a?(Hash)
|
24
|
+
Jxedt.config.dsl_config.merge!({'use_binary_settings': options})
|
25
|
+
end
|
26
|
+
|
20
27
|
def cocoapods_jxedt_config(options)
|
21
28
|
Jxedt.config.dsl_config.merge!(options)
|
22
29
|
Jxedt.config.validate_dsl_config
|
@@ -37,7 +37,11 @@ module Pod
|
|
37
37
|
|
38
38
|
used_binary = []
|
39
39
|
Dir.glob("#{pods_root}/*/_Prebuild") do |file_path|
|
40
|
+
# 不是目录,不处理
|
40
41
|
next unless File.directory?(file_path)
|
42
|
+
# 目录下文件为空不处理
|
43
|
+
next if Dir["#{file_path}/*"].empty?
|
44
|
+
|
41
45
|
dir_name = File.dirname(file_path)
|
42
46
|
name = File.basename(dir_name).to_s
|
43
47
|
target_path = binary_dir + name
|
@@ -64,6 +68,9 @@ module Pod
|
|
64
68
|
index, failed = 0, []
|
65
69
|
used_binary.sort_by {|hash| hash[:name].capitalize }.each do |hash|
|
66
70
|
name = hash[:name]
|
71
|
+
|
72
|
+
# lockfile中没有则跳过
|
73
|
+
next unless lockfile.internal_data["SPEC CHECKSUMS"].include?(name)
|
67
74
|
|
68
75
|
checksum = lockfile.spec_checksums_hash_key(name)
|
69
76
|
validation_passed = checksum && checksum == hash[:checksum] && hash[:checksum_count] == 1
|
@@ -19,6 +19,8 @@ module Jxedt
|
|
19
19
|
cache_dir = Pathname.new(Jxedt.config.git_cache_path) + "GeneratedFrameworks"
|
20
20
|
to_dir = Pathname.new(to_dir)
|
21
21
|
binary_hash.each do |name, checksum|
|
22
|
+
next if checksum.nil?
|
23
|
+
|
22
24
|
zip_file = cache_dir + name + "#{checksum}.zip"
|
23
25
|
next unless zip_file.exist?
|
24
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-jxedt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- guojiashuang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|