cocoapods-util 0.0.14 → 0.0.15

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: c64106c89882c33e0febe8aa3623478f1b5c9a3325c7efdb6a10a4a2a998ab91
4
- data.tar.gz: ec9b2691eecd6fba14b374f0fd8b9a302595b958d314d85c8b065e85896b5f35
3
+ metadata.gz: d3e136a04158a95c53ec3bf85971b13f137f85ad816633d64cf9655fca06234c
4
+ data.tar.gz: 32fd218bb662f121551dd394782a97691fee24c86d7105cf3d5c0f7d5a16275c
5
5
  SHA512:
6
- metadata.gz: e21f0d9d26c4c4ae210f25f462f706e57a0867536316b4ec81321c9e422ce4469c3df09a3ee2637516f49c27026bbd83f428268efe1999204c83f0d4ec23c8b0
7
- data.tar.gz: '0818fdf44b6dc9cc552ba5464de71aa95e004190cea4a21b827d049b16641a82fd103feda06421c2d897e59faa0d303b8472205b7d1f08d8a8ea3bf369811730'
6
+ metadata.gz: 14561d493194c787d69f8749f30e14c57227f623a3954cf8017376a84544df4dbd23906e4041b3361211e31340cae48344ff4c0b61601bd02d9cb27db96bf07b
7
+ data.tar.gz: dc4fcb6c4dafd62b2b107d6f7d40f254b2544e91beeaaa9ca75296c2816c5af3b48c46f1dd44c9af622835a25db823f6eec9b606e57f87ec14535f1aad5c39c0
@@ -1,6 +1,52 @@
1
1
  module CocoapodsUtilHook
2
- Pod::HooksManager.register('cocoapods-util', :pre_install) do |context, _|
2
+ Pod::HooksManager.register('cocoapods-util', :pre_install) do |installer_context, _|
3
3
  puts "pre_install"
4
+ require_relative 'hooks/feature_switch'
5
+ if Pod.is_prebuild_stage
6
+ next
7
+ end
8
+
9
+ # [Check Environment]
10
+ podfile = installer_context.podfile
11
+ # podfile.target_definition_list.each do |target_definition|
12
+ # # next if target_definition.prebuild_framework_pod_names.empty?
13
+ # # if not target_definition.uses_frameworks?
14
+ # # STDERR.puts "[!] Cocoapods-binary requires `use_frameworks!`".red
15
+ # # exit
16
+ # # end
17
+ # end
18
+
19
+ require_relative 'hooks/prebuild_sandbox'
20
+
21
+ # 读取update和repo_update参数
22
+ update = nil
23
+ repo_update = nil
24
+ include ObjectSpace
25
+ ObjectSpace.each_object(Pod::Installer) { |installer|
26
+ update = installer.update
27
+ repo_update = installer.repo_update
28
+ }
29
+
30
+ # switches setting
31
+ Pod.is_prebuild_stage = true
32
+
33
+ # make another custom sandbox
34
+ standard_sandbox = installer_context.sandbox
35
+ prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox)
36
+
37
+ # get the podfile for prebuild
38
+ prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file)
39
+
40
+ # install
41
+ lockfile = installer_context.lockfile
42
+ binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile)
43
+
44
+ binary_installer.update = update
45
+ binary_installer.repo_update = repo_update
46
+ # binary_installer.install!
47
+
48
+ # reset switches setting
49
+ Pod.is_prebuild_stage = false
4
50
  end
5
51
  Pod::HooksManager.register('cocoapods-util', :pre_integrate) do |context, _|
6
52
  puts "pre_integrate"
@@ -14,5 +60,4 @@ module CocoapodsUtilHook
14
60
  Pod::HooksManager.register('cocoapods-util', :source_provider) do |context, _|
15
61
  puts "source_provider"
16
62
  end
17
- end
18
-
63
+ end
@@ -40,7 +40,11 @@ module Pod
40
40
  check_all_componment
41
41
  else
42
42
  installed = pod_installed
43
- help! "没有找到#{@name}组件的相关信息,请检查输入的组件名称" unless installed.include?(@name)
43
+ help! "没有找到#{@name}组件的相关信息,请检查输入的组件名称" unless installed.include?(@name) || installed.map do |item|
44
+ downcase = item.downcase
45
+ @name = item if @name.downcase == downcase
46
+ downcase
47
+ end.include?(@name.downcase)
44
48
  check_componment_with_name(@name)
45
49
  end
46
50
  end
@@ -101,9 +105,9 @@ module Pod
101
105
  subspecs.uniq!
102
106
  dependencies.uniq!
103
107
  parents.uniq!
104
- UI.puts " - SUBSPEC: ".yellow "#{subspecs.join('、')}".green unless subspecs.empty?
108
+ UI.puts " - SUBSPECS: ".yellow "#{subspecs.join('、')}".green unless subspecs.empty?
105
109
  UI.puts " - DEPENDENCIES: ".yellow "#{dependencies.join('、')}".green unless dependencies.empty?
106
- UI.puts " - DEPENDENTS: ".yellow "#{parents.join('、')}".green unless parents.empty?
110
+ UI.puts " - WHO DEPENDS ON IT: ".yellow "#{parents.join('、')}".green unless parents.empty?
107
111
  end
108
112
 
109
113
  def pod_tags_info
@@ -15,6 +15,7 @@ module Pod
15
15
 
16
16
  def initialize(argv)
17
17
  @skip_validate = argv.flag?('skip-validate', false)
18
+ @skip_build = argv.flag?('skip-build', false)
18
19
  super
19
20
  @argvs = argv.remainder!
20
21
 
@@ -31,6 +32,7 @@ module Pod
31
32
  @target = Pod::Command::Repo::Push.new(CLAide::ARGV.new(@argvs))
32
33
  @target.validate!
33
34
  @target.skip_validate = @skip_validate
35
+ @target.skip_build = @skip_build
34
36
  @target.run
35
37
  end
36
38
  end
@@ -1,29 +1,23 @@
1
- class Module
2
- def strong_alias(to, from)
3
- # https://tieba.baidu.com/p/5535445605?red_tag=0735709674 贴吧大神给出的方案
4
- # 类方法可以看做singleton class(单例类)的实例方法,下面两个方法都可以,上面这个方式也适用于早起的ruby版本
5
- (class << self;self;end).send(:alias_method, to, from)
6
- # self.singleton_class.send(:alias_method, to, from)
7
- end
8
- end
9
-
10
1
  module Pod
11
2
  class Command
12
3
  class Repo < Command
13
4
  class Push < Repo
14
- attr_accessor :skip_validate
15
-
16
- self.strong_alias(:old_options, :options)
5
+ attr_accessor :skip_validate, :skip_build
6
+
7
+ class_alias_method(:old_options, :options)
17
8
  def self.options
18
9
  [
19
- ['--skip-validate', '跳过验证,不验证推送的podspec文件,默认为验证']
10
+ ['--skip-validate', '跳过整个验证,不验证推送的podspec文件,默认为验证'],
11
+ ['--skip-build', '跳过编译过程,还是会校验pod下载和依赖']
20
12
  ].concat(self.old_options)
21
13
  end
22
14
 
23
15
  # 调用原方法的两种方式
24
16
  old_validate_podspec_files = instance_method(:validate_podspec_files)
25
17
  define_method(:validate_podspec_files) do
18
+ Pod::Validator.skip_build = @skip_build
26
19
  old_validate_podspec_files.bind(self).() unless @skip_validate
20
+ Pod::Validator.skip_build = false
27
21
  end
28
22
 
29
23
  alias_method :old_check_repo_status, :check_repo_status
@@ -33,4 +27,25 @@ module Pod
33
27
  end
34
28
  end
35
29
  end
30
+ end
31
+
32
+ module Pod
33
+ class Validator
34
+ class_attr_accessor :skip_build
35
+
36
+ alias_method :old_build_pod, :build_pod
37
+ def build_pod
38
+ old_build_pod unless Pod::Validator.skip_build
39
+ end
40
+
41
+ alias_method :old_test_pod, :test_pod
42
+ def test_pod
43
+ old_test_pod unless Pod::Validator.skip_build
44
+ end
45
+
46
+ alias_method :old_validated?, :validated?
47
+ def validated?
48
+ Pod::Validator.skip_build || old_validated?
49
+ end
50
+ end
36
51
  end
@@ -32,6 +32,7 @@ module Pod
32
32
  default_build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" unless @xcframework && self.match_pod_version?('~> 1.11') # 非xcframework排除ios simulator 64位架构
33
33
  default_build_settings["EXCLUDED_ARCHS[sdk=appletvsimulator*]"] = "arm64" unless @xcframework && self.match_pod_version?('~> 1.11') # 非xcframework排除tvos simulator 64位架构
34
34
  default_build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES" # 编译swift生成swiftinterface文件
35
+ default_build_settings["CODE_SIGN_IDENTITY"] = "" if `xcodebuild -version`.lines.shift.gsub!('Xcode ', '') >= "14" #xcode版本大于等于xcode 14时需要添加
35
36
 
36
37
  # merge user setting
37
38
  default_build_settings.merge!(@build_settings) unless @build_settings.empty?
@@ -1,3 +1,3 @@
1
1
  module CocoapodsUtil
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -0,0 +1,3 @@
1
+ module Pod
2
+ class_attr_accessor :is_prebuild_stage
3
+ end
@@ -0,0 +1,14 @@
1
+ module Pod
2
+ class PrebuildSandbox < Sandbox
3
+
4
+ # [String] standard_sandbox_path
5
+ def self.from_standard_sanbox_path(path)
6
+ prebuild_sandbox_path = Pathname.new(path).realpath + "_Prebuild"
7
+ self.new(prebuild_sandbox_path)
8
+ end
9
+
10
+ def self.from_standard_sandbox(sandbox)
11
+ self.from_standard_sanbox_path(sandbox.root)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ class Module
2
+ def class_alias_method(to, from)
3
+ # https://tieba.baidu.com/p/5535445605?red_tag=0735709674 贴吧大神给出的方案
4
+ # 类方法可以看做singleton class(单例类)的实例方法,下面两个方法都可以,上面这个方式也适用于早期的ruby版本
5
+ (class << self;self;end).send(:alias_method, to, from)
6
+ # self.singleton_class.send(:alias_method, to, from)
7
+ end
8
+
9
+ def class_attr_accessor(symbol)
10
+ self.class.send(:attr_accessor, symbol)
11
+ end
12
+ end
@@ -1,2 +1,3 @@
1
+ require 'cocoapods-util/tool'
1
2
  require 'cocoapods-util/command'
2
3
  require 'cocoapods-util/CocoapodsUtilHook.rb'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - guojiashuang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-01 00:00:00.000000000 Z
11
+ date: 2022-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '1.3'
39
+ version: 2.2.33
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '1.3'
46
+ version: 2.2.33
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -90,7 +90,10 @@ files:
90
90
  - lib/cocoapods-util/command/xcframework/xcframework.rb
91
91
  - lib/cocoapods-util/command/xcframework/xcframework_build.rb
92
92
  - lib/cocoapods-util/gem_version.rb
93
+ - lib/cocoapods-util/hooks/feature_switch.rb
93
94
  - lib/cocoapods-util/hooks/installer.rb
95
+ - lib/cocoapods-util/hooks/prebuild_sandbox.rb
96
+ - lib/cocoapods-util/tool.rb
94
97
  - lib/cocoapods_plugin.rb
95
98
  homepage: https://github.com/CaryGo/cocoapods-util
96
99
  licenses: