zabel 1.0.1 → 1.0.2

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -1
  3. data/lib/zabel.rb +27 -14
  4. data/lib/zabel/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b4bd5a362ce7f4aa9c80a6e1f385f21cdd60b07c7d76bd27aaacb127a5eb037
4
- data.tar.gz: 842369d90e5a1f878d51b9d439c62de4c123f3fbfd7bd63bca2735f24ac302d9
3
+ metadata.gz: 89413297b2ba01b9d67f3bd364566b73ad66164fbcffba18c13f799a35f0b760
4
+ data.tar.gz: 31e676f429656820d38993ffc31b5a6521bd510dedaab32464f5ab3a69ddf3f8
5
5
  SHA512:
6
- metadata.gz: e44882f989a91d79be7467f1c81af6625f74509219ea8e761814eba5bafa9413263b9e0708ea9d2d42f637da03ccea990eaecfdaf337d540ee12576750aece13
7
- data.tar.gz: 6dbf765804557e693cc30e569ea7cf17ceffaf1c6cfb516eb745e1d972248551bb4490fc14a660c2de55296fedd67f7f3afb585427729623995f5ca479fe97e5
6
+ metadata.gz: 8644fe694d350d9799affc0eb50f0cc668380dbbf32361d5fb48a29c02cf330bfe63d2769311e3c64f6f33e351b0d028429022cf0a9d6099c9664e5d3db58cf9
7
+ data.tar.gz: 56102a92ef122f2cd71c80f6c5e61b561cff1c14021d7dbd77ee4175b708a62f5dc64f2e1150324582f25a02cbbd553782ee9b34517b1b4beeb998e24db457ba
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Zabel
2
2
 
3
- Zabel, is a build cacher for Xcode, using Xcodeproj and MD5, to detect and cache products for targets. Zabel is not Bazel.
3
+ 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
4
 
5
5
  ## Feature
6
6
 
@@ -19,6 +19,7 @@ Zabel, is a build cacher for Xcode, using Xcodeproj and MD5, to detect and cache
19
19
  - support dependent files and implicit dependent targets
20
20
  - support xcodebuild build or archive
21
21
  - support fastlane build or archive
22
+ - support legacy or new build system
22
23
 
23
24
  ## Installation
24
25
 
@@ -54,6 +55,12 @@ xcodebuild/fastlane xxx
54
55
  zabel post -configuration Release abc
55
56
  ```
56
57
 
58
+ ## Changelog
59
+
60
+ - 1.0.2 support legacy build system
61
+ - 1.0.1 support xcodebuild archive and fastlane
62
+ - 1.0.0
63
+
57
64
  ## Development
58
65
 
59
66
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/zabel.rb CHANGED
@@ -13,6 +13,7 @@ module Zabel
13
13
 
14
14
  BUILD_KEY_SYMROOT = "SYMROOT"
15
15
  BUILD_KEY_CONFIGURATION_BUILD_DIR = "CONFIGURATION_BUILD_DIR"
16
+ BUILD_KEY_TARGET_BUILD_DIR = "TARGET_BUILD_DIR"
16
17
  BUILD_KEY_OBJROOT = "OBJROOT"
17
18
  BUILD_KEY_TARGET_TEMP_DIR = "TARGET_TEMP_DIR"
18
19
  BUILD_KEY_PODS_XCFRAMEWORKS_BUILD_DIR = "PODS_XCFRAMEWORKS_BUILD_DIR"
@@ -74,15 +75,6 @@ module Zabel
74
75
  end
75
76
 
76
77
  def self.zabel_should_extract_once
77
- # By default, to achieve better compatibility, zabel extracts target cache ondemand,
78
- # which means it depends on original dependencies of targets and it is in parallel.
79
- # However, extracting once in a shell script build phase rather than multiple shell script build phases,
80
- # is a little bit faster in some cases.
81
- # You can enable this by set "export ZABEL_EXTRACT_ONCE=YES"
82
- should_extract_once = ENV["ZABEL_EXTRACT_ONCE"]
83
- if should_extract_once == "YES"
84
- return true
85
- end
86
78
  return false
87
79
  end
88
80
 
@@ -866,15 +858,36 @@ module Zabel
866
858
 
867
859
  def self.zabel_extract
868
860
  target_cache_dir = ARGV[1]
869
- product_path = ARGV[2]
870
861
 
871
862
  cache_product_path = target_cache_dir + "/#{FILE_NAME_PRODUCT}"
872
863
 
873
864
  start_time = Time.now
874
- command = "mkdir -p \"#{ENV[BUILD_KEY_SYMROOT]}/#{product_path}\" && cd \"#{ENV[BUILD_KEY_SYMROOT]}/#{product_path}/..\" && tar -xf \"#{cache_product_path}\""
875
- puts command
876
- raise unless system command
877
-
865
+
866
+ if ENV[BUILD_KEY_CONFIGURATION_BUILD_DIR] != ENV[BUILD_KEY_TARGET_BUILD_DIR]
867
+ command = "mkdir -p \"#{ENV[BUILD_KEY_CONFIGURATION_BUILD_DIR]}\" && cd \"#{File.dirname(ENV[BUILD_KEY_CONFIGURATION_BUILD_DIR])}/\" && tar -xf \"#{cache_product_path}\""
868
+ puts command
869
+ raise unless system command
870
+
871
+ command = "rm -rf \"#{ENV[BUILD_KEY_TARGET_BUILD_DIR]+"/"+ENV[BUILD_KEY_FULL_PRODUCT_NAME]}\""
872
+ puts command
873
+ raise unless system command
874
+
875
+ command = "mkdir -p \"#{File.dirname(ENV[BUILD_KEY_TARGET_BUILD_DIR]+"/"+ENV[BUILD_KEY_FULL_PRODUCT_NAME])}\""
876
+ puts command
877
+ raise unless system command
878
+
879
+ command = "mv \"#{ENV[BUILD_KEY_CONFIGURATION_BUILD_DIR]+"/"+ENV[BUILD_KEY_FULL_PRODUCT_NAME]}\" \"#{ENV[BUILD_KEY_TARGET_BUILD_DIR]+"/"+ENV[BUILD_KEY_FULL_PRODUCT_NAME]}\""
880
+ puts command
881
+ raise unless system command
882
+
883
+ command = "/bin/ln -sfh \"#{ENV[BUILD_KEY_TARGET_BUILD_DIR]+"/"+ENV[BUILD_KEY_FULL_PRODUCT_NAME]}\" \"#{ENV[BUILD_KEY_CONFIGURATION_BUILD_DIR]+"/"+ENV[BUILD_KEY_FULL_PRODUCT_NAME]}\""
884
+ puts command
885
+ raise unless system command
886
+ else
887
+ command = "mkdir -p \"#{ENV[BUILD_KEY_CONFIGURATION_BUILD_DIR]}\" && cd \"#{File.dirname(ENV[BUILD_KEY_CONFIGURATION_BUILD_DIR])}/\" && tar -xf \"#{cache_product_path}\""
888
+ puts command
889
+ raise unless system command
890
+ end
878
891
  end
879
892
 
880
893
  def self.zabel_printenv
data/lib/zabel/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zabel
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dengweijun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-31 00:00:00.000000000 Z
11
+ date: 2021-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj