zabel 1.0.3 → 1.0.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 +4 -4
- data/README.md +23 -11
- data/bin/zabel +2 -2
- data/lib/zabel/version.rb +2 -1
- data/lib/zabel.rb +88 -62
- 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: 7bbbbd6d01a9148ff002993ceebe5ed44aba4fd905cb1529689ca40406357aff
|
4
|
+
data.tar.gz: b0ef1fd3e75802bc1ab90f99f3c2910263e84c0fa4352536a7e7515a7e8515c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 842b4eade28085456376de660c8f353108d488caf3f26dcd6308476c2eab2a60cfa67e1c4f5a248cc9a7c4a29d574ecbaa41273d56dd3d323a05a8453698fd11
|
7
|
+
data.tar.gz: 28fdc857de4f92a8c6c806305e858bdd94c5fb2888bc86eaa7fb7f9a3b67ea311ef28bf132ffb4690ab5bea9449f62eb62c5a983fb5f0a9bc1988d38f343cf3b
|
data/README.md
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
-
# Zabel
|
2
|
-
|
3
1
|
Zabel, is a build cacher for Xcode, using Xcodeproj and MD5, to detect and cache products for targets. Designed for CI by now. Zabel is not Bazel.
|
4
2
|
|
5
3
|
WARNING: BE CAREFUL IN PRODUCTION ENVIRONMENT.
|
6
4
|
|
5
|
+
- [Feature](https://github.com/WeijunDeng/Zabel#feature)
|
6
|
+
- [Installation](https://github.com/WeijunDeng/Zabel#installation)
|
7
|
+
- [Usage](https://github.com/WeijunDeng/Zabel#usage)
|
8
|
+
- [Advanced usage](https://github.com/WeijunDeng/Zabel#advanced-usage)
|
9
|
+
- [Options](https://github.com/WeijunDeng/Zabel#options)
|
10
|
+
- [Changelog](https://github.com/WeijunDeng/Zabel#changelog)
|
11
|
+
- [Development](https://github.com/WeijunDeng/Zabel#development)
|
12
|
+
- [Test](https://github.com/WeijunDeng/Zabel#test)
|
13
|
+
- [Contributing](https://github.com/WeijunDeng/Zabel#contributing)
|
14
|
+
- [License](https://github.com/WeijunDeng/Zabel#license)
|
15
|
+
- [Code of Conduct](https://github.com/WeijunDeng/Zabel#code-of-conduct)
|
16
|
+
- [FAQ](https://github.com/WeijunDeng/Zabel#faq)
|
17
|
+
- [TODO](https://github.com/WeijunDeng/Zabel#todo)
|
18
|
+
|
7
19
|
## Feature
|
8
20
|
|
9
21
|
- only support Cocoapods targets now
|
@@ -65,7 +77,7 @@ Importantly, configuration argument must be set with zabel.
|
|
65
77
|
|
66
78
|
## Options
|
67
79
|
|
68
|
-
You can
|
80
|
+
You can customize some options by yourself.
|
69
81
|
|
70
82
|
Zabel stores caches in `~/zabel` by default. You can change this path.
|
71
83
|
|
@@ -85,6 +97,7 @@ Zabel detects module map dependecy by default. However, there are bugs of xcodeb
|
|
85
97
|
|
86
98
|
## Changelog
|
87
99
|
|
100
|
+
- 1.0.4 optimize spec checksums; optimize output log; use CACHE_VERSION; should not cache if dependency error
|
88
101
|
- 1.0.3 support bundle install
|
89
102
|
- 1.0.2 support legacy build system
|
90
103
|
- 1.0.1 support xcodebuild archive and fastlane
|
@@ -107,14 +120,6 @@ ruby test/one.rb test/case/simple/Podfile
|
|
107
120
|
ruby test/one.rb test/todo/modulemap_file/Podfile
|
108
121
|
```
|
109
122
|
|
110
|
-
## TODO
|
111
|
-
|
112
|
-
- support more projects and targets, not only Pods
|
113
|
-
- support and test more clang arguments
|
114
|
-
- support intermediate cache such as .o and .gcno
|
115
|
-
- try to support local development
|
116
|
-
- try to support remote cache server
|
117
|
-
|
118
123
|
## Contributing
|
119
124
|
|
120
125
|
Bug reports and pull requests are welcome on GitHub at https://github.com/WeijunDeng/Zabel. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
@@ -149,4 +154,11 @@ Q: What about dependencies ?
|
|
149
154
|
|
150
155
|
A: Simple dependent files (headers) and implicit dependent targets will be detected. If dependent files of a target change, this target will be recompiled. If dependent targets of a target miss cache, this target and dependent targets will be recompiled.
|
151
156
|
|
157
|
+
## TODO
|
158
|
+
|
159
|
+
- support more projects and targets, not only Pods
|
160
|
+
- support and test more clang arguments
|
161
|
+
- support intermediate cache such as .o and .gcno
|
162
|
+
- try to support local development
|
163
|
+
- try to support remote cache server
|
152
164
|
|
data/bin/zabel
CHANGED
@@ -19,11 +19,11 @@ elsif ARGV.include?("-configuration") or ARGV.include?("--configuration")
|
|
19
19
|
|
20
20
|
build_start_time = Time.now
|
21
21
|
exit 1 unless system(*ARGV)
|
22
|
-
puts "[ZABEL]
|
22
|
+
puts "[ZABEL/I] duration = #{(Time.now - build_start_time).to_i} s in stage build"
|
23
23
|
|
24
24
|
Zabel::zabel_post(ARGV)
|
25
25
|
|
26
|
-
puts "[ZABEL]
|
26
|
+
puts "[ZABEL/I] duration = #{(Time.now - total_start_time).to_i} s in stage all"
|
27
27
|
elsif ARGV.size == 0 or (ARGV.size == 1 and ARGV[0].include?("v"))
|
28
28
|
puts "ver: #{Zabel::VERSION}"
|
29
29
|
puts "exe: #{$0}"
|
data/lib/zabel/version.rb
CHANGED
data/lib/zabel.rb
CHANGED
@@ -99,6 +99,7 @@ module Zabel
|
|
99
99
|
|
100
100
|
def self.zabel_can_cache_target(target)
|
101
101
|
if target.name.start_with? "Pods-"
|
102
|
+
puts "[ZABEL/I] skip #{target.name}"
|
102
103
|
return false
|
103
104
|
end
|
104
105
|
if target.class == Xcodeproj::Project::Object::PBXNativeTarget
|
@@ -107,7 +108,11 @@ module Zabel
|
|
107
108
|
target.product_type == "com.apple.product-type.library.static" or
|
108
109
|
target.product_type == "com.apple.product-type.framework"
|
109
110
|
return true
|
111
|
+
else
|
112
|
+
puts "[ZABEL/I] skip #{target.name} #{target.class} #{target.product_type}"
|
110
113
|
end
|
114
|
+
else
|
115
|
+
puts "[ZABEL/I] skip #{target.name} #{target.class}"
|
111
116
|
end
|
112
117
|
return false
|
113
118
|
end
|
@@ -125,7 +130,7 @@ module Zabel
|
|
125
130
|
file = file.gsub("\\ ", " ")
|
126
131
|
|
127
132
|
unless File.exist? file
|
128
|
-
puts "[ZABEL]
|
133
|
+
puts "[ZABEL/E] #{target.name} #{file} should exist in dependency file #{dependency_file}"
|
129
134
|
return []
|
130
135
|
end
|
131
136
|
|
@@ -194,11 +199,11 @@ module Zabel
|
|
194
199
|
file_time_hash[file] = File.mtime(file)
|
195
200
|
end
|
196
201
|
file_list = file_list.sort_by {|file| - file_time_hash[file].to_f}
|
197
|
-
puts "[ZABEL]
|
202
|
+
puts "[ZABEL/I] keep cache " + file_list.size.to_s + " " + Open3.capture3("du -sh #{zabel_get_cache_root}")[0].to_s
|
198
203
|
|
199
204
|
if file_list.size > 1
|
200
|
-
puts "[ZABEL]
|
201
|
-
puts "[ZABEL]
|
205
|
+
puts "[ZABEL/I] keep oldest " + file_time_hash[file_list.last].to_s + " " + file_list.last
|
206
|
+
puts "[ZABEL/I] keep newest " + file_time_hash[file_list.first].to_s + " " + file_list.first
|
202
207
|
end
|
203
208
|
|
204
209
|
if file_list.size > zabel_get_cache_count
|
@@ -242,7 +247,7 @@ module Zabel
|
|
242
247
|
project_configuration_content = project_configuration.pretty_print.to_yaml
|
243
248
|
project_xcconfig = ""
|
244
249
|
if project_configuration.base_configuration_reference
|
245
|
-
config_file_path = project_configuration.base_configuration_reference.real_path
|
250
|
+
config_file_path = project_configuration.base_configuration_reference.real_path.to_s
|
246
251
|
if File.exist? config_file_path
|
247
252
|
project_xcconfig = File.read(config_file_path).lines.reject{|line|line.include? "_SEARCH_PATHS"}.sort.join("")
|
248
253
|
end
|
@@ -251,8 +256,10 @@ module Zabel
|
|
251
256
|
target_configuration = target.build_configurations.detect { | config | config.name == configuration_name}
|
252
257
|
target_configuration_content = target_configuration.pretty_print.to_yaml
|
253
258
|
target_xcconfig = ""
|
259
|
+
target_spec_name = ""
|
254
260
|
if target_configuration.base_configuration_reference
|
255
|
-
config_file_path = target_configuration.base_configuration_reference.real_path
|
261
|
+
config_file_path = target_configuration.base_configuration_reference.real_path.to_s
|
262
|
+
target_spec_name = File.basename(File.dirname(config_file_path))
|
256
263
|
if File.exist? config_file_path
|
257
264
|
target_xcconfig = File.read(config_file_path).lines.reject{|line|line.include? "_SEARCH_PATHS"}.sort.join("")
|
258
265
|
end
|
@@ -289,22 +296,15 @@ module Zabel
|
|
289
296
|
|
290
297
|
source_md5_list = []
|
291
298
|
# zabel built-in verison, which will be changed for incompatibility in the future
|
292
|
-
source_md5_list.push "Zabel version : #{Zabel::
|
299
|
+
source_md5_list.push "Zabel cache version : #{Zabel::CACHE_VERSION}"
|
293
300
|
source_md5_list.push "ARGV : #{key_argv.to_s}"
|
294
301
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
if $zabel_podfile_spec_checksums.has_key? spec_name
|
302
|
-
source_md5_list.push "SPEC CHECKSUM : #{spec_name} #{$zabel_podfile_spec_checksums[spec_name]}"
|
303
|
-
has_found_checksum = true
|
304
|
-
end
|
305
|
-
end
|
306
|
-
unless has_found_checksum
|
307
|
-
puts "[ZABEL]<ERROR> #{target.name} SPEC CHECKSUM should be found"
|
302
|
+
# TODO: to get a explicit spec name from a target.
|
303
|
+
if target_spec_name.size > 0 and $zabel_podfile_spec_checksums.has_key? target_spec_name
|
304
|
+
source_md5_list.push "SPEC CHECKSUM : #{target_spec_name} #{$zabel_podfile_spec_checksums[target_spec_name]}"
|
305
|
+
has_found_checksum = true
|
306
|
+
else
|
307
|
+
puts "[ZABEL/E] #{target.name} #{target_spec_name} SPEC CHECKSUM should be found"
|
308
308
|
end
|
309
309
|
|
310
310
|
source_md5_list.push "Project : #{File.basename(project.path)}"
|
@@ -338,10 +338,6 @@ module Zabel
|
|
338
338
|
command = "rm -rf Pods/*.xcodeproj/*.#{FILE_NAME_TARGET_CONTEXT}"
|
339
339
|
puts command
|
340
340
|
raise unless system command
|
341
|
-
|
342
|
-
command = "rm -rf Pods/zabel.xcodeproj"
|
343
|
-
puts command
|
344
|
-
raise unless system command
|
345
341
|
end
|
346
342
|
|
347
343
|
def self.zabel_add_cache(target, target_context, message)
|
@@ -362,7 +358,7 @@ module Zabel
|
|
362
358
|
end
|
363
359
|
|
364
360
|
unless full_product_name and full_product_name.size > 0 and File.exist? "#{product_dir}/#{full_product_name}"
|
365
|
-
puts "[ZABEL]
|
361
|
+
puts "[ZABEL/E] #{target.name} #{product_dir}/#{full_product_name} should exist"
|
366
362
|
return false
|
367
363
|
end
|
368
364
|
|
@@ -375,12 +371,12 @@ module Zabel
|
|
375
371
|
|
376
372
|
puts command
|
377
373
|
unless system command
|
378
|
-
puts "[ZABEL]
|
374
|
+
puts "[ZABEL/E] #{command} should succeed"
|
379
375
|
return false
|
380
376
|
end
|
381
377
|
|
382
378
|
if File.exist? target_cache_dir
|
383
|
-
puts "[ZABEL]
|
379
|
+
puts "[ZABEL/E] #{target_cache_dir} should not exist"
|
384
380
|
raise unless system "rm -rf \"#{target_cache_dir}\""
|
385
381
|
return false
|
386
382
|
end
|
@@ -388,7 +384,7 @@ module Zabel
|
|
388
384
|
command = "mkdir -p \"#{target_cache_dir}\""
|
389
385
|
unless system command
|
390
386
|
puts command
|
391
|
-
puts "[ZABEL]
|
387
|
+
puts "[ZABEL/E] #{command} should succeed"
|
392
388
|
return false
|
393
389
|
end
|
394
390
|
|
@@ -398,11 +394,11 @@ module Zabel
|
|
398
394
|
puts command
|
399
395
|
unless system command
|
400
396
|
puts command
|
401
|
-
puts "[ZABEL]
|
397
|
+
puts "[ZABEL/E] #{command} should succeed"
|
402
398
|
return false
|
403
399
|
end
|
404
400
|
unless File.exist? cache_product_path
|
405
|
-
puts "[ZABEL]
|
401
|
+
puts "[ZABEL/E] #{cache_product_path} should exist after mv"
|
406
402
|
return false
|
407
403
|
end
|
408
404
|
|
@@ -418,6 +414,7 @@ module Zabel
|
|
418
414
|
target_context.delete(:target_status)
|
419
415
|
target_context.delete(:potential_hit_target_cache_dirs)
|
420
416
|
target_context.delete(:target_md5_content)
|
417
|
+
target_context.delete(:miss_dependency_list)
|
421
418
|
[BUILD_KEY_SYMROOT, BUILD_KEY_CONFIGURATION_BUILD_DIR, BUILD_KEY_OBJROOT, BUILD_KEY_TARGET_TEMP_DIR, BUILD_KEY_PODS_XCFRAMEWORKS_BUILD_DIR, BUILD_KEY_SRCROOT].each do | key |
|
422
419
|
target_context.delete(key)
|
423
420
|
end
|
@@ -438,7 +435,7 @@ module Zabel
|
|
438
435
|
configuration_name = argv[argv.index("--configuration") + 1]
|
439
436
|
end
|
440
437
|
unless configuration_name and configuration_name.size > 0
|
441
|
-
raise "[ZABEL]
|
438
|
+
raise "[ZABEL/E] -configuration or --configuration should be set"
|
442
439
|
end
|
443
440
|
|
444
441
|
start_time = Time.now
|
@@ -450,14 +447,17 @@ module Zabel
|
|
450
447
|
post_targets_context = {}
|
451
448
|
|
452
449
|
projects.each do | project |
|
450
|
+
project_configuration = project.build_configurations.detect { | config | config.name == configuration_name}
|
451
|
+
unless project_configuration
|
452
|
+
puts "[ZABEL/E] #{project.path} should have config #{configuration_name}"
|
453
|
+
next
|
454
|
+
end
|
453
455
|
project.native_targets.each do | target |
|
456
|
+
target_context_file = "#{project.path}/#{target.name}.#{FILE_NAME_TARGET_CONTEXT}"
|
457
|
+
unless File.exist? target_context_file
|
458
|
+
next
|
459
|
+
end
|
454
460
|
if zabel_can_cache_target(target)
|
455
|
-
|
456
|
-
target_context_file = "#{project.path}/#{target.name}.#{FILE_NAME_TARGET_CONTEXT}"
|
457
|
-
unless File.exist? target_context_file
|
458
|
-
next
|
459
|
-
end
|
460
|
-
|
461
461
|
target_context = YAML.load(File.read(target_context_file))
|
462
462
|
|
463
463
|
if target_context[:target_status] == STATUS_MISS
|
@@ -469,7 +469,7 @@ module Zabel
|
|
469
469
|
|
470
470
|
dependency_files = zabel_get_dependency_files(target, intermediate_dir, product_dir, xcframeworks_build_dir)
|
471
471
|
if source_files.size > 0 and dependency_files.size == 0 and target.product_type != "com.apple.product-type.bundle"
|
472
|
-
puts "[ZABEL]
|
472
|
+
puts "[ZABEL/E] #{target.name} should have dependent files"
|
473
473
|
next
|
474
474
|
end
|
475
475
|
target_context[:dependency_files] = dependency_files - source_files
|
@@ -477,7 +477,7 @@ module Zabel
|
|
477
477
|
target_context[:target_md5_content] = target_md5_content
|
478
478
|
target_md5 = Digest::MD5.hexdigest(target_md5_content)
|
479
479
|
unless target_context[:target_md5] == target_md5
|
480
|
-
puts "[ZABEL]
|
480
|
+
puts "[ZABEL/E] #{target.name} md5 should not be changed after build"
|
481
481
|
next
|
482
482
|
end
|
483
483
|
if target_context[BUILD_KEY_SRCROOT] and target_context[BUILD_KEY_SRCROOT].size > 0 and
|
@@ -485,19 +485,19 @@ module Zabel
|
|
485
485
|
if File.exist? Dir.pwd + "/" + zabel_get_content_without_pwd("#{target_context[BUILD_KEY_SRCROOT]}/#{target_context[BUILD_KEY_MODULEMAP_FILE]}")
|
486
486
|
target_context[BUILD_KEY_MODULEMAP_FILE] = zabel_get_content_without_pwd("#{target_context[BUILD_KEY_SRCROOT]}/#{target_context[BUILD_KEY_MODULEMAP_FILE]}")
|
487
487
|
else
|
488
|
-
puts "[ZABEL]
|
488
|
+
puts "[ZABEL/E] #{target.name} #{target_context[BUILD_KEY_MODULEMAP_FILE]} should be supported"
|
489
489
|
next
|
490
490
|
end
|
491
491
|
end
|
492
492
|
elsif target_context[:target_status] == STATUS_HIT
|
493
493
|
if target_context[BUILD_KEY_MODULEMAP_FILE] and target_context[BUILD_KEY_MODULEMAP_FILE].size > 0
|
494
494
|
if not File.exist? Dir.pwd + "/" + target_context[BUILD_KEY_MODULEMAP_FILE]
|
495
|
-
puts "[ZABEL]
|
495
|
+
puts "[ZABEL/E] #{target.name} #{target_context[BUILD_KEY_MODULEMAP_FILE]} should be supported"
|
496
496
|
next
|
497
497
|
end
|
498
498
|
end
|
499
499
|
else
|
500
|
-
puts "[ZABEL]
|
500
|
+
puts "[ZABEL/E] #{target.name} should be hit or miss"
|
501
501
|
next
|
502
502
|
end
|
503
503
|
|
@@ -555,9 +555,17 @@ module Zabel
|
|
555
555
|
|
556
556
|
target_context[:dependency_files] = target_context[:dependency_files] - implicit_dependencies
|
557
557
|
dependency_files_md5 = []
|
558
|
+
should_not_cache = false
|
558
559
|
target_context[:dependency_files].each do | file |
|
560
|
+
if file.start_with? target_context[BUILD_KEY_OBJROOT] + "/" or file.start_with? target_context[BUILD_KEY_SYMROOT] + "/"
|
561
|
+
puts "[ZABEL/W] #{target.name} #{file} dependecy should not include build path"
|
562
|
+
should_not_cache = true
|
563
|
+
break
|
564
|
+
end
|
559
565
|
dependency_files_md5.push [zabel_get_content_without_pwd(file), zabel_get_file_md5(file)]
|
560
566
|
end
|
567
|
+
next if should_not_cache
|
568
|
+
|
561
569
|
target_context[:dependency_files_md5] = dependency_files_md5.sort.uniq
|
562
570
|
|
563
571
|
dependency_targets_md5 = dependency_targets_set.to_a.map { | target | [target.name, post_targets_context[target][:target_md5]]}
|
@@ -578,13 +586,13 @@ module Zabel
|
|
578
586
|
|
579
587
|
zabel_keep
|
580
588
|
|
581
|
-
puts "[ZABEL]
|
589
|
+
puts "[ZABEL/I] total add #{add_count}"
|
582
590
|
|
583
|
-
puts "[ZABEL]
|
591
|
+
puts "[ZABEL/I] duration = #{(Time.now - start_time).to_i} s in stage post"
|
584
592
|
|
585
593
|
end
|
586
594
|
|
587
|
-
def self.zabel_get_potential_hit_target_cache_dirs(target, target_md5)
|
595
|
+
def self.zabel_get_potential_hit_target_cache_dirs(target, target_md5, miss_dependency_list)
|
588
596
|
dependency_start_time = Time.now
|
589
597
|
target_cache_dirs = Dir.glob(zabel_get_cache_root + "/" + target.name + "-" + target_md5 + "-*")
|
590
598
|
file_time_hash = {}
|
@@ -603,12 +611,12 @@ module Zabel
|
|
603
611
|
dependency_md5 = item[1]
|
604
612
|
|
605
613
|
unless File.exist? dependency_file
|
606
|
-
|
614
|
+
miss_dependency_list.push "[ZABEL/W] #{target.name} #{dependency_file} file should exist to be hit"
|
607
615
|
dependency_miss = true
|
608
616
|
break
|
609
617
|
end
|
610
618
|
unless zabel_get_file_md5(dependency_file) == dependency_md5
|
611
|
-
|
619
|
+
miss_dependency_list.push "[ZABEL/W] #{target.name} #{dependency_file} md5 #{zabel_get_file_md5(dependency_file)} should match #{dependency_md5} to be hit"
|
612
620
|
dependency_miss = true
|
613
621
|
break
|
614
622
|
end
|
@@ -617,14 +625,14 @@ module Zabel
|
|
617
625
|
if not target_context[:target_md5] == target_md5
|
618
626
|
command = "rm -rf \"#{target_cache_dir}\""
|
619
627
|
raise unless system command
|
620
|
-
puts "[ZABEL]
|
628
|
+
puts "[ZABEL/E] #{target.name} #{target_cache_dir} target md5 should match to be verified"
|
621
629
|
dependency_miss = false
|
622
630
|
next
|
623
631
|
end
|
624
632
|
if not target_context[:product_md5] == zabel_get_file_md5(target_cache_dir + "/" + FILE_NAME_PRODUCT)
|
625
633
|
command = "rm -rf \"#{target_cache_dir}\""
|
626
634
|
raise unless system command
|
627
|
-
puts "[ZABEL]
|
635
|
+
puts "[ZABEL/E] #{target.name} #{target_cache_dir} product md5 should match to be verified"
|
628
636
|
dependency_miss = false
|
629
637
|
next
|
630
638
|
end
|
@@ -685,7 +693,7 @@ module Zabel
|
|
685
693
|
configuration_name = argv[argv.index("--configuration") + 1]
|
686
694
|
end
|
687
695
|
unless configuration_name and configuration_name.size > 0
|
688
|
-
raise "[ZABEL]
|
696
|
+
raise "[ZABEL/E] -configuration or --configuration should be set"
|
689
697
|
end
|
690
698
|
|
691
699
|
start_time = Time.now
|
@@ -708,19 +716,32 @@ module Zabel
|
|
708
716
|
iteration_count = 0
|
709
717
|
|
710
718
|
projects.each do | project |
|
719
|
+
project_configuration = project.build_configurations.detect { | config | config.name == configuration_name}
|
720
|
+
unless project_configuration
|
721
|
+
puts "[ZABEL/E] #{project.path} should have config #{configuration_name}"
|
722
|
+
next
|
723
|
+
end
|
711
724
|
project.native_targets.each do | target |
|
712
725
|
if zabel_can_cache_target(target)
|
713
726
|
source_files = zabel_get_target_source_files(target)
|
714
|
-
|
727
|
+
unless source_files.size >= zabel_get_min_source_file_count
|
728
|
+
puts "[ZABEL/I] skip #{target.name} #{source_files.size} >= #{zabel_get_min_source_file_count}"
|
729
|
+
next
|
730
|
+
end
|
715
731
|
target_md5_content = zabel_get_target_md5_content(project, target, configuration_name, argv, source_files)
|
716
732
|
target_md5 = Digest::MD5.hexdigest(target_md5_content)
|
717
|
-
|
733
|
+
miss_dependency_list = []
|
734
|
+
potential_hit_target_cache_dirs = zabel_get_potential_hit_target_cache_dirs(target, target_md5, miss_dependency_list)
|
718
735
|
|
719
736
|
target_context = {}
|
720
737
|
target_context[:target_md5] = target_md5
|
721
738
|
target_context[:potential_hit_target_cache_dirs] = potential_hit_target_cache_dirs
|
739
|
+
target_context[:miss_dependency_list] = miss_dependency_list
|
722
740
|
if potential_hit_target_cache_dirs.size == 0
|
723
|
-
|
741
|
+
if miss_dependency_list.size > 0
|
742
|
+
puts miss_dependency_list.uniq.join("\n")
|
743
|
+
end
|
744
|
+
puts "[ZABEL/I] miss #{target.name} #{target_md5} in iteration #{iteration_count}"
|
724
745
|
target_context[:target_status] = STATUS_MISS
|
725
746
|
miss_count = miss_count + 1
|
726
747
|
end
|
@@ -764,7 +785,7 @@ module Zabel
|
|
764
785
|
end
|
765
786
|
end
|
766
787
|
if hit_target_cache_dir
|
767
|
-
puts "[ZABEL]
|
788
|
+
puts "[ZABEL/I] hit #{target.name} #{target_context[:target_md5]} in iteration #{iteration_count} potential #{potential_hit_target_cache_dirs.size}"
|
768
789
|
target_context[:target_status] = STATUS_HIT
|
769
790
|
target_context[:hit_target_cache_dir] = hit_target_cache_dir
|
770
791
|
hit_count = hit_count + 1
|
@@ -788,7 +809,11 @@ module Zabel
|
|
788
809
|
else
|
789
810
|
unless target_context[:target_status] == STATUS_MISS
|
790
811
|
target_context[:target_status] = STATUS_MISS
|
791
|
-
|
812
|
+
miss_dependency_list = target_context[:miss_dependency_list]
|
813
|
+
if miss_dependency_list.size > 0
|
814
|
+
puts miss_dependency_list.uniq.join("\n")
|
815
|
+
end
|
816
|
+
puts "[ZABEL/I] miss #{target.name} #{target_context[:target_md5]} in iteration #{iteration_count}"
|
792
817
|
miss_count = miss_count + 1
|
793
818
|
end
|
794
819
|
zabel_inject_printenv(project, target)
|
@@ -806,12 +831,15 @@ module Zabel
|
|
806
831
|
end
|
807
832
|
end
|
808
833
|
|
809
|
-
puts "[ZABEL]
|
834
|
+
puts "[ZABEL/I] total #{hit_count + miss_count} hit #{hit_count} miss #{miss_count} iteration #{iteration_count}"
|
810
835
|
|
811
|
-
puts "[ZABEL]
|
836
|
+
puts "[ZABEL/I] duration = #{(Time.now - start_time).to_i} s in stage pre"
|
812
837
|
end
|
813
838
|
|
814
839
|
def self.zabel_extract
|
840
|
+
puts "[ZABEL/D] #{Time.now.to_f.to_s}"
|
841
|
+
start_time = Time.now
|
842
|
+
|
815
843
|
target_cache_dir = ARGV[1]
|
816
844
|
|
817
845
|
cache_product_path = target_cache_dir + "/#{FILE_NAME_PRODUCT}"
|
@@ -843,6 +871,9 @@ module Zabel
|
|
843
871
|
puts command
|
844
872
|
raise unless system command
|
845
873
|
end
|
874
|
+
|
875
|
+
puts "[ZABEL/I] duration = #{(Time.now - start_time).to_i} s in stage extract"
|
876
|
+
puts "[ZABEL/D] #{Time.now.to_f.to_s}"
|
846
877
|
end
|
847
878
|
|
848
879
|
def self.zabel_printenv
|
@@ -861,11 +892,6 @@ module Zabel
|
|
861
892
|
end
|
862
893
|
|
863
894
|
def self.zabel_clean
|
864
|
-
if File.exist? "Pods/zabel.xcodeproj"
|
865
|
-
command = "rm -rf Pods/*.xcodeproj"
|
866
|
-
puts command
|
867
|
-
raise unless system command
|
868
|
-
end
|
869
895
|
zabel_clean_temp_files
|
870
896
|
end
|
871
897
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zabel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dengweijun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|