cocoapods-binaryhqp 0.4.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14566192d217044c6dc8d8b93af1d0296c14f092006c9880cf8beb689802cd34
4
- data.tar.gz: 6e22703f0dad2e1f8cbdff851ad26d8b1033dd530e5c98c000e10d9900b65fcc
3
+ metadata.gz: 41a7a422607d24a0693df14db38d1ce0fa9db2063693eb4d134dd08372eb2aff
4
+ data.tar.gz: 230ef35f4cbde58d0a22f23982eb91271e8f18e793792f15f5a865511ed964dd
5
5
  SHA512:
6
- metadata.gz: dc6a18e6324e3d5b6a37aed9a10c2477b3037752026439de9416fda800c234407b2cf3f8d9ac13496c14ab8a9dc588072d195ac508919c284a1a0d21b7773b6b
7
- data.tar.gz: 93547fff043c799c6489041300733cb676f9daf1792df574181359178254cf8696295960740fb86e04a8f0cc09099037036e768dad581e185438fe434fec0018
6
+ metadata.gz: 0b976845e07ef81b004f2e3b8b798cf2784fbad540e29bd335127b6b47ddef9b35c0f6eb76970cf86e2ee52e7a0433d7f51926c38f9002435648830e86b4ab01
7
+ data.tar.gz: 3ec892b95c5f4d510f14d21afda29990603747b5efd5b49d87388cad77de5f0481c90c3f38725c7be240033e8ea8dc5911b5aa730bb487c77ce862e6195f0402
data/.vscode/launch.json CHANGED
@@ -9,7 +9,9 @@
9
9
  "cwd": "${workspaceRoot}/demo", // pod 命令执行的路径
10
10
  "program": "/usr/local/bin/pod",
11
11
  // "args": ["update", "--verbose","--sources=http://gitlab.9tong.com/ios-group/HQPFoundation/hqpspecs.git"], // `pod` 命令的参数
12
- "args": ["install", "--verbose"]
12
+ // "args": ["install", "--verbose"]
13
+ // "args": ["install","--hsource"]
14
+ "args":["install", "--help"]
13
15
  }
14
16
  ]
15
17
  }
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-binaryhqp (0.4.7)
4
+ cocoapods-binaryhqp (0.4.9)
5
+ CFPropertyList
5
6
  cocoapods
6
7
  fourflusher
7
- plist
8
8
  xcpretty
9
9
 
10
10
  GEM
@@ -87,7 +87,6 @@ GEM
87
87
  nanaimo (0.3.0)
88
88
  nap (1.1.0)
89
89
  netrc (0.11.0)
90
- plist (3.6.0)
91
90
  prettybacon (0.0.2)
92
91
  bacon (~> 1.2)
93
92
  public_suffix (4.0.6)
@@ -2,6 +2,7 @@
2
2
  require_relative 'helper/podfile_options'
3
3
  require_relative 'tool/tool'
4
4
  require_relative 'gem_version'
5
+ require_relative 'command_option/command_option'
5
6
 
6
7
  module Pod
7
8
  class Podfile
@@ -13,6 +14,10 @@ module Pod
13
14
  DSL.prebuild_all = true
14
15
  end
15
16
 
17
+ def all_source!
18
+ DSL.framework_source_all = true
19
+ end
20
+
16
21
  # Enable bitcode for prebuilt frameworks
17
22
  def enable_bitcode_for_prebuilt_frameworks!
18
23
  DSL.bitcode_enabled = true
@@ -60,6 +65,9 @@ module Pod
60
65
  class_attr_accessor :prebuild_all
61
66
  prebuild_all = false
62
67
 
68
+ class_attr_accessor :framework_source_all
69
+ framework_source_all = false
70
+
63
71
  class_attr_accessor :bitcode_enabled
64
72
  bitcode_enabled = false
65
73
 
@@ -122,6 +130,9 @@ Pod::HooksManager.register('cocoapods-binaryhqp', :pre_install) do |installer_co
122
130
  Pod::Installer.force_disable_integration true # don't integrate targets
123
131
  Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile
124
132
  Pod::Installer.disable_install_complete_message true # disable install complete message
133
+
134
+ Pod::Podfile::DSL.framework_source_all = Pod::Podfile::DSL.framework_source_all || Pod::Command::Install::all_use_source
135
+ Pod::UI.puts("全部使用源码") if Pod::Podfile::DSL.framework_source_all
125
136
 
126
137
  # make another custom sandbox
127
138
  standard_sandbox = installer_context.sandbox
@@ -134,8 +145,8 @@ Pod::HooksManager.register('cocoapods-binaryhqp', :pre_install) do |installer_co
134
145
  lockfile = installer_context.lockfile
135
146
  binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile)
136
147
 
137
- binary_installer.delete_standard_sand_box_pod(standard_sandbox)
138
-
148
+ binary_installer.delete_all_standard_sandbox_pod(standard_sandbox)
149
+
139
150
  if binary_installer.have_exact_prebuild_cache? && !update
140
151
  binary_installer.install_when_cache_hit!
141
152
  else
@@ -155,7 +155,20 @@ module Pod
155
155
 
156
156
  need_update_pods.each do |pod_name|
157
157
  pod_path = Pathname.new(standard_sanbox.root.to_s + "/#{pod_name}")
158
- Pod::UI.puts("删除 #{pod_path.to_s}")
158
+ Pod::UI.puts("删除 #{pod_path.to_s}") if config.verbose
159
+ pod_path.rmtree if pod_path.exist?
160
+ end
161
+ end
162
+ end
163
+
164
+ def delete_all_standard_sandbox_pod(standard_sanbox)
165
+ if lockfile
166
+ changes = lockfile.detect_changes_with_podfile(podfile)
167
+ need_update_pods = (changes[:added] + changes[:changed] + changes[:removed] + changes[:unchanged]).to_a
168
+
169
+ need_update_pods.each do |pod_name|
170
+ pod_path = Pathname.new(standard_sanbox.root.to_s + "/#{pod_name}")
171
+ Pod::UI.puts("删除 #{pod_path.to_s}") if config.verbose
159
172
  pod_path.rmtree if pod_path.exist?
160
173
  end
161
174
  end
@@ -297,10 +310,11 @@ module Pod
297
310
  useless_target_names = sandbox.exsited_framework_target_names.reject do |name|
298
311
  all_needed_names.include? name
299
312
  end
300
- useless_target_names.each do |name|
301
- path = sandbox.framework_folder_path_for_target_name(name)
302
- path.rmtree if path.exist?
303
- end
313
+ # 不删除已经编译好的framework
314
+ # useless_target_names.each do |name|
315
+ # path = sandbox.framework_folder_path_for_target_name(name)
316
+ # path.rmtree if path.exist?
317
+ # end
304
318
 
305
319
  if not Podfile::DSL.dont_remove_source_code
306
320
  # only keep manifest.lock and framework folder in _Prebuild
@@ -0,0 +1,28 @@
1
+ module Pod
2
+ class Command
3
+ class Install < Command
4
+
5
+ def self.options
6
+ [
7
+ ['--hsource', 'from cocoapods-binaryhqp, all frameworks use source code'],
8
+ ].concat(super).reject { |(name, _)| name == '--no-repo-update' }
9
+ end
10
+
11
+ def initialize(argv)
12
+ super
13
+ @@use_source = argv.flag?('hsource', false)
14
+ end
15
+
16
+ def self.all_use_source
17
+ @@use_source
18
+ end
19
+
20
+ def self.run(argv)
21
+ super(argv)
22
+ end
23
+
24
+
25
+ end
26
+ end
27
+ end
28
+
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBinaryHqp
2
- VERSION = "0.4.9"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -28,14 +28,18 @@ module Pod
28
28
  end
29
29
 
30
30
  # patched content
31
- should_prebuild = Pod::Podfile::DSL.prebuild_all
31
+ should_prebuild = Pod::Podfile::DSL.prebuild_all || (not Pod::Podfile::DSL.framework_source_all)
32
32
  local = false
33
33
 
34
34
  options = args.last
35
35
  if options.is_a?(Hash) and options[Pod::Prebuild.keyword] != nil
36
- should_prebuild = options[Pod::Prebuild.keyword]
36
+ should_prebuild = options[Pod::Prebuild.keyword] && (not Pod::Podfile::DSL.framework_source_all)
37
37
  local = (options[:path] != nil)
38
38
  end
39
+
40
+ if Pod::Command::Install.all_use_source
41
+ should_prebuild = false
42
+ end
39
43
 
40
44
  if should_prebuild and (not local)
41
45
  old_method.bind(self).(name, *args)
@@ -11,13 +11,17 @@ module Pod
11
11
 
12
12
  ## --- option for setting using prebuild framework ---
13
13
  def parse_prebuild_framework(name, requirements)
14
- should_prebuild = Pod::Podfile::DSL.prebuild_all
14
+ should_prebuild = Pod::Podfile::DSL.prebuild_all && (not Pod::Podfile::DSL.framework_source_all)
15
15
 
16
16
  options = requirements.last
17
17
  if options.is_a?(Hash) && options[Pod::Prebuild.keyword] != nil
18
- should_prebuild = options.delete(Pod::Prebuild.keyword)
18
+ should_prebuild = options.delete(Pod::Prebuild.keyword) && (not Pod::Podfile::DSL.framework_source_all)
19
19
  requirements.pop if options.empty?
20
20
  end
21
+
22
+ if Pod::Command::Install.all_use_source
23
+ should_prebuild = false
24
+ end
21
25
 
22
26
  pod_name = Specification.root_name(name)
23
27
  set_prebuild_for_pod(pod_name, should_prebuild)
@@ -32,6 +32,8 @@ def build_for_iosish_platform(sandbox,
32
32
  # make less arch to iphone simulator for faster build
33
33
  custom_build_options_simulator += ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] if simulator == 'iphonesimulator'
34
34
 
35
+ custom_build_options += ['ARCHS=arm64']
36
+
35
37
  is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options)
36
38
  exit 1 unless is_succeed
37
39
  is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + custom_build_options_simulator)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-binaryhqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - leavez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-30 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -118,6 +118,7 @@ files:
118
118
  - lib/cocoapods-binaryhqp/Integration.rb
119
119
  - lib/cocoapods-binaryhqp/Main.rb
120
120
  - lib/cocoapods-binaryhqp/Prebuild.rb
121
+ - lib/cocoapods-binaryhqp/command_option/command_option.rb
121
122
  - lib/cocoapods-binaryhqp/gem_version.rb
122
123
  - lib/cocoapods-binaryhqp/helper/feature_switches.rb
123
124
  - lib/cocoapods-binaryhqp/helper/names.rb