cocoapods-binary-matchup 0.0.16 → 0.0.17
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 +0 -2
- data/lib/cocoapods-binary-matchup/Integration_cache.rb +7 -1
- data/lib/cocoapods-binary-matchup/Main.rb +7 -6
- data/lib/cocoapods-binary-matchup/gem_version.rb +1 -1
- data/lib/cocoapods-binary-matchup/rome/build_framework.rb +3 -10
- data/spec/plugin_spec.rb +0 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b2d7e5383e4069928a8652aef16cd19446482e0149cb36dc4b880f68ffdd11d
|
4
|
+
data.tar.gz: b76423c11f50d5cba8f78c31c3707707aaf55511ef848225dfff0549ddb7c1c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2f3f6d35e6aa9a410038014c97a5c4fddbac788da44ce2b2fce2fb72d55c04cf910794d5ee7718274f5d6d80ba47095abf870096c22fcda52707be5058d044e
|
7
|
+
data.tar.gz: fa74552e79a659791add383487f55fad19c492588fc5943f108cfff70fee9a98b1624e209c7bdb2c915b3dc800b8ec16773498a8fabf693f4cf5bef2673ecf13
|
data/README.md
CHANGED
@@ -61,8 +61,6 @@ If bitcode is needed, add a `enable_bitcode_for_prebuilt_frameworks!` before all
|
|
61
61
|
|
62
62
|
if forbidden simulator, add a `simulator_build_disable!` before all targets in Podfile
|
63
63
|
|
64
|
-
if custom main deployment target, add a `min_deployment_target(version)` before all targets in Podfile; e.g: `min_deployment_target(14.0)`
|
65
|
-
|
66
64
|
if custom build configuration is needed, add a `set_custom_xcodebuild_options_for_prebuilt_frameworks` before all targets in Podfile; e.g:
|
67
65
|
set_custom_xcodebuild_options_for_prebuilt_frameworks({
|
68
66
|
:device => "ARCHS=arm64",
|
@@ -2,12 +2,17 @@ require 'fileutils'
|
|
2
2
|
require 'digest'
|
3
3
|
|
4
4
|
module Pod
|
5
|
+
|
6
|
+
class_attr_accessor :min_deployment_target
|
7
|
+
|
5
8
|
module PrebuildCache
|
9
|
+
|
6
10
|
class Cache
|
7
11
|
|
8
12
|
# 获取缓存根目录
|
9
13
|
def self.cache_root_dir
|
10
|
-
cache_dir = File.expand_path("~/.PodCache/#{Pod
|
14
|
+
cache_dir = File.expand_path("~/.PodCache/#{Pod.min_deployment_target}")
|
15
|
+
UI.puts "🔍 cache_root_dir #{cache_dir}"
|
11
16
|
FileUtils.mkdir_p(cache_dir) unless Dir.exist?(cache_dir)
|
12
17
|
cache_dir
|
13
18
|
end
|
@@ -89,6 +94,7 @@ module Pod
|
|
89
94
|
|
90
95
|
# 检查缓存是否存在
|
91
96
|
def self.cache_exists?(pod_name, version)
|
97
|
+
Pod::UI.puts "🔍 cache_exists? #{pod_name} #{version}"
|
92
98
|
cache_dir = cache_dir_for_pod(pod_name, version)
|
93
99
|
Dir.exist?(cache_dir) && !Dir.empty?(cache_dir)
|
94
100
|
end
|
@@ -30,9 +30,6 @@ module Pod
|
|
30
30
|
DSL.dont_remove_source_code = true
|
31
31
|
end
|
32
32
|
|
33
|
-
def min_deployment_target(target)
|
34
|
-
DSL.min_deployment_target = target
|
35
|
-
end
|
36
33
|
|
37
34
|
# Add custom xcodebuild option to the prebuilding action
|
38
35
|
#
|
@@ -68,9 +65,6 @@ module Pod
|
|
68
65
|
class_attr_accessor :simulator_build_enabled
|
69
66
|
self.simulator_build_enabled = true
|
70
67
|
|
71
|
-
class_attr_accessor :min_deployment_target
|
72
|
-
self.min_deployment_target = '14.0'
|
73
|
-
|
74
68
|
private
|
75
69
|
class_attr_accessor :prebuild_all
|
76
70
|
self.prebuild_all = false
|
@@ -106,6 +100,13 @@ Pod::HooksManager.register('cocoapods-binary-matchup', :pre_install) do |install
|
|
106
100
|
exit
|
107
101
|
end
|
108
102
|
end
|
103
|
+
|
104
|
+
root_target = installer_context.podfile.target_definition_list.first
|
105
|
+
if root_target.platform
|
106
|
+
project_ios_version = root_target.platform.deployment_target
|
107
|
+
Pod::UI.puts "📱 Project iOS Version: #{project_ios_version.version}"
|
108
|
+
Pod.min_deployment_target = project_ios_version.version
|
109
|
+
end
|
109
110
|
|
110
111
|
|
111
112
|
# -- step 1: prebuild framework ---
|
@@ -20,23 +20,20 @@ def build_for_iosish_platform(sandbox,
|
|
20
20
|
custom_build_options = [], # Array<String>
|
21
21
|
custom_build_options_simulator = [] # Array<String>
|
22
22
|
)
|
23
|
-
|
24
|
-
deployment_target = Pod::Podfile::DSL.min_deployment_target
|
25
23
|
|
26
24
|
target_label = target.label # name with platform if it's used in multiple platforms
|
27
25
|
Pod::UI.puts "Prebuilding #{target_label}..."
|
28
|
-
Pod::UI.puts "📦 deployment_target: #{deployment_target}"
|
29
26
|
|
30
27
|
other_options = []
|
31
28
|
# bitcode enabled
|
32
29
|
other_options += ['BITCODE_GENERATION_MODE=bitcode'] if bitcode_enabled
|
33
30
|
|
34
|
-
is_succeed, _ = xcodebuild(sandbox, target_label, device,
|
31
|
+
is_succeed, _ = xcodebuild(sandbox, target_label, device, target, other_options + custom_build_options)
|
35
32
|
exit 1 unless is_succeed
|
36
33
|
if Pod::Podfile::DSL.simulator_build_enabled
|
37
34
|
# make less arch to iphone simulator for faster build
|
38
35
|
custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator'
|
39
|
-
is_succeed, _ = xcodebuild(sandbox, target_label, simulator,
|
36
|
+
is_succeed, _ = xcodebuild(sandbox, target_label, simulator, target, other_options + custom_build_options_simulator)
|
40
37
|
exit 1 unless is_succeed
|
41
38
|
end
|
42
39
|
|
@@ -133,11 +130,7 @@ end
|
|
133
130
|
def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_options=[])
|
134
131
|
args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk} )
|
135
132
|
platform = PLATFORMS[sdk]
|
136
|
-
|
137
|
-
args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil?
|
138
|
-
elsif
|
139
|
-
args += ["IPHONEOS_DEPLOYMENT_TARGET=#{deployment_target}"]
|
140
|
-
end
|
133
|
+
args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil?
|
141
134
|
args += other_options
|
142
135
|
Pod::UI.puts "📦 start compile project #{target} (#{args}) "
|
143
136
|
log = `xcodebuild #{args.join(" ")} 2>&1`
|
data/spec/plugin_spec.rb
CHANGED
@@ -22,7 +22,6 @@ describe "CocoaPods Binary Matchup Plugin" do
|
|
22
22
|
dsl_methods.should.include?(:all_binary!)
|
23
23
|
dsl_methods.should.include?(:enable_bitcode_for_prebuilt_frameworks!)
|
24
24
|
dsl_methods.should.include?(:keep_source_code_for_prebuilt_frameworks!)
|
25
|
-
dsl_methods.should.include?(:min_deployment_target)
|
26
25
|
dsl_methods.should.include?(:simulator_build_disable!)
|
27
26
|
dsl_methods.should.include?(:set_custom_xcodebuild_options_for_prebuilt_frameworks)
|
28
27
|
end
|
@@ -30,18 +29,8 @@ describe "CocoaPods Binary Matchup Plugin" do
|
|
30
29
|
it "should have correct default values for public attributes" do
|
31
30
|
# 验证公开的默认配置值
|
32
31
|
Pod::Podfile::DSL.simulator_build_enabled.should == true
|
33
|
-
# should是bacon中的测试断言,这里的意思是min_deployment_target应该等于'14.0'
|
34
|
-
Pod::Podfile::DSL.min_deployment_target.should == '14.0'
|
35
32
|
end
|
36
33
|
|
37
|
-
it "should allow setting min_deployment_target" do
|
38
|
-
# 验证可以设置最小部署目标
|
39
|
-
original_target = Pod::Podfile::DSL.min_deployment_target
|
40
|
-
Pod::Podfile::DSL.min_deployment_target = '15.0'
|
41
|
-
Pod::Podfile::DSL.min_deployment_target.should == '15.0'
|
42
|
-
# 恢复原值
|
43
|
-
Pod::Podfile::DSL.min_deployment_target = original_target
|
44
|
-
end
|
45
34
|
|
46
35
|
it "should allow toggling simulator build" do
|
47
36
|
# 验证可以切换模拟器构建设置
|