cocoapods-pahealth-bin 0.0.5 → 0.0.6

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: 548ec031b506a3415e358a531b7164c58ffa5f98bd60a6bdd39b2a7bb1fbc5da
4
- data.tar.gz: 26a9775ac5184aaee5543bb7e732f1c9781039ca42b7e942ba9f0e2a45b6ef78
3
+ metadata.gz: c425660864d3b8b05518e496fb36bff6a558f0146a2072442669aadf4c2d946b
4
+ data.tar.gz: d3001b8edad764f0d0112a4dafb869832958ba7fe7cf6a6e1dcf30e342fc96e2
5
5
  SHA512:
6
- metadata.gz: 782b67edcf136c3f51523eb15a30ece5f293b17ca5f3c013384d93911a376787111231456c5f10165104b1d27ceffeb9310ac607605892d7640656f8d4c62ec6
7
- data.tar.gz: 5f106a5efb491af72858e877b084f5a6fb225d4c3f2cc5b3cc6b1edba1cf35ded83421f2ca0ab299e17dc9d2c23e1eb5c65ff8cebc80abd200527e5d23fe6c9e
6
+ metadata.gz: f567e671d1d5794c8393cc794dabaa25df139d5276955ef3e13f81c98faf34f95282d0f33c8188d720d6d826c23c5099338889918e4e8cef987320b21f479be6
7
+ data.tar.gz: 4e25e4dfb7543767ab1927a15b6a9117cd0f7a6edce7fce7a0f6c3ed0124875a8d78cb9cf0dffc4dcc090d0fc13c27dcaac2b080ea9054df09c25796d09ff248
@@ -1 +1,2 @@
1
1
  require 'cocoapods-pahealth-bin/gem_version'
2
+ require 'cocoapods-pahealth-bin/native/sources_manager'
@@ -17,39 +17,31 @@ module Pod
17
17
 
18
18
  def self.options
19
19
  [
20
- ['--trunk-dependencies', 'push 到官方源'],
20
+
21
21
  ].concat(Pod::Command::Repo::Push.options).concat(super).uniq
22
22
  end
23
23
 
24
24
  def initialize(argv)
25
25
  @podspec = argv.shift_argument
26
- @trunk_dependencies = argv.flag?('trunk-dependencies')
27
- @sources = argv.option('sources') || []
26
+ @sources = argv.option('sources')
27
+ @code_dependencies = argv.flag?('code-dependencies')
28
28
  super
29
29
 
30
30
  @additional_args = argv.remainder!
31
31
  end
32
32
 
33
33
  def run
34
- Podfile.execute_with_bin_plugin do
35
- Podfile.execute_with_allow_prerelease(@allow_prerelease) do
36
- Podfile.execute_with_use_binaries(!@code_dependencies) do
37
- argvs = [
38
- repo,
39
- "--sources=#{sources_option(!@trunk_dependencies, @sources)}",
40
- *@additional_args
41
- ]
34
+ argvs = [
35
+ repo,
36
+ "--sources=#{sources_option(@code_dependencies, @sources)+','+Pod::TrunkSource::TRUNK_REPO_URL}",
37
+ *@additional_args
38
+ ]
42
39
 
43
- argvs << spec_file if spec_file
40
+ argvs << spec_file if spec_file
44
41
 
45
- push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
46
- push.validate!
47
- push.run
48
- end
49
- end
50
- end
51
- ensure
52
- clear_binary_spec_file_if_needed unless @reserve_created_spec
42
+ push = Pod::Command::Repo::Push.new(CLAide::ARGV.new(argvs))
43
+ push.validate!
44
+ push.run
53
45
  end
54
46
 
55
47
  private
@@ -17,16 +17,21 @@ module Pod
17
17
  end
18
18
 
19
19
  def initialize(argv)
20
+ @name = argv.shift_argument
20
21
  super
21
22
  end
22
23
 
23
24
  def run
24
25
  show_output = !config.silent?
25
- Parallel.each(valid_sources, in_threads: 4) do |source|
26
- source.update(show_output)
27
- # update_git_repo
26
+ if @name
27
+ config.sources_manager.update(@name, show_output)
28
+ else
29
+ Parallel.each(valid_sources, in_threads: 4) do |source|
30
+ source.update(show_output)
31
+ end
28
32
  end
29
33
  end
34
+
30
35
  end
31
36
  end
32
37
  end
@@ -12,38 +12,32 @@ module Pod
12
12
  DESC
13
13
 
14
14
  self.arguments = [
15
- CLAide::Argument.new(%w[NAME.podspec DIRECTORY http://PATH/NAME.podspec], false, true)
15
+ CLAide::Argument.new('NAME.podspec', false)
16
16
  ]
17
17
 
18
18
  def self.options
19
19
  [
20
- ['--release', '在 release 环境下进行 lint']
21
20
  ].concat(Pod::Command::Spec::Lint.options).concat(super).uniq
22
21
  end
23
22
 
24
23
  def initialize(argv)
25
24
  @podspec = argv.shift_argument
26
- @release = argv.flag?('release',false )
27
- @sources = argv.option('sources')
28
- @allow_prerelease = argv.flag?('allow-prerelease')
25
+ @sources = argv.option('sources') || []
26
+ @code_dependencies = argv.flag?('code-dependencies')
29
27
  super
30
28
 
31
29
  @additional_args = argv.remainder!
32
30
  end
33
31
 
34
32
  def run
35
- Podfile.execute_with_bin_plugin do
36
- Podfile.execute_with_allow_prerelease(@allow_prerelease) do
37
- argvs = [
38
- "--sources=#{sources_option(@release, @sources)+','+Pod::TrunkSource::TRUNK_REPO_URL}",
39
- *@additional_args
40
- ]
41
- argvs << spec_file if spec_file
42
- lint = Pod::Command::Spec::Lint.new(CLAide::ARGV.new(argvs))
43
- lint.validate!
44
- lint.run
45
- end
46
- end
33
+ argvs = [
34
+ "--sources=#{sources_option(@code_dependencies, @sources)+','+Pod::TrunkSource::TRUNK_REPO_URL}",
35
+ *@additional_args
36
+ ]
37
+ argvs << spec_file if spec_file
38
+ lint = Pod::Command::Spec::Lint.new(CLAide::ARGV.new(argvs))
39
+ lint.validate!
40
+ lint.run
47
41
  end
48
42
 
49
43
  private
@@ -21,7 +21,7 @@ module Pod
21
21
  end
22
22
 
23
23
  def run
24
- #1.clone Private repo
24
+ #1.更新 repo
25
25
  clone_private_repo
26
26
  #2.执行 pod update --no-repo-update
27
27
  pod_update_no_repo_update
@@ -1,61 +1,21 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
- require 'cocoapods-pahealth-bin/native/podfile'
3
- require 'cocoapods-pahealth-bin/native/podfile_env'
4
- require 'cocoapods/generate'
5
4
 
6
5
  module CBin
7
6
  class Config
8
7
  def config_file
9
- config_file_with_configuration_dependence(configuration_dependence)
8
+ File.expand_path("#{Pod::Config.instance.home_dir}/bin.yml")
10
9
  end
11
10
 
12
11
  def template_hash
13
12
  {
14
- 'configuration_dependence' => { description: '依赖环境', default: 'uat', selection: %w[uat test] },
15
- 'code_repo_url' => { description: '私有源 Git 地址', default: 'uat环境:https://github.com/GitWangKai/ReleasePrivateRepo.git test环境:https://github.com/GitWangKai/TestPrivateRepo.git' },
13
+ 'code_repo_url' => { description: '私有源 Git 地址', default: 'git@github.com/cocoapods-spec.git' }
16
14
  }
17
15
  end
18
16
 
19
- def config_file_with_configuration_dependence(configuration_dependence)
20
- file = config_uat_dependence_file
21
- if configuration_dependence == "test"
22
- file = config_test_dependence_file
23
- puts "\n====== #{configuration_dependence} 环境 ========"
24
- elsif configuration_dependence == "uat"
25
- puts "\n====== #{configuration_dependence} 环境 ========"
26
- else
27
- raise "\n===== #{configuration_dependence} 参数有误,请检查%w[uat test]===="
28
- end
29
-
30
- File.expand_path("#{Pod::Config.instance.home_dir}/#{file}")
31
- end
32
-
33
- def configuration_dependence
34
- #如果是dev 再去 podfile的配置文件中获取,确保是正确的, pod update时会用到
35
- if @configuration_dependence == "uat" || @configuration_dependence == nil
36
- if Pod::Config.instance.podfile
37
- configuration_dependence ||= Pod::Config.instance.podfile.configuration_dependence
38
- end
39
- configuration_dependence ||= "uat"
40
- @configuration_dependence = configuration_dependence
41
- end
42
- @configuration_dependence
43
- end
44
-
45
- def set_configuration_dependence(dependence)
46
- @configuration_dependence = dependence
47
- end
48
-
49
- def config_test_dependence_file
50
- "pahealth_test.yml"
51
- end
52
-
53
- def config_uat_dependence_file
54
- "pahealth_uat.yml"
55
- end
56
-
57
17
  def sync_config(config)
58
- File.open(config_file_with_configuration_dependence(config['configuration_dependence']), 'w+') do |f|
18
+ File.open(config_file, 'w+') do |f|
59
19
  f.write(config.to_yaml)
60
20
  end
61
21
  end
@@ -114,6 +74,4 @@ module CBin
114
74
  def self.config
115
75
  @config ||= Config.new
116
76
  end
117
-
118
-
119
77
  end
@@ -42,7 +42,6 @@ module CBin
42
42
 
43
43
  开始设置组件私有化初始信息.
44
44
  所有的信息都会保存在 #{CBin.config.config_file} 文件中.
45
- %w[pahealth_test.yml pahealth_uat.yml]
46
45
  你可以在对应目录下手动添加编辑该文件. 文件包含的配置信息样式如下:
47
46
 
48
47
  #{CBin.config.default_config.to_yaml}
@@ -1,3 +1,3 @@
1
1
  module CocoapodsPahealthBin
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -10,13 +10,13 @@ module CBin
10
10
  sources_manager.code_source
11
11
  end
12
12
 
13
- def valid_sources
13
+ def valid_sources(code_dependencies = false)
14
14
  sources = [code_source]
15
15
  sources
16
16
  end
17
17
 
18
- def sources_option(additional_sources)
19
- (valid_sources.map(&:url) + Array(additional_sources)).join(',')
18
+ def sources_option(code_dependencies, additional_sources)
19
+ (valid_sources(code_dependencies).map(&:url) + Array(additional_sources)).join(',')
20
20
  end
21
21
  end
22
22
  end
@@ -26,10 +26,6 @@ module Pod
26
26
  set_internal_hash_value(USE_SOURCE_PODS, hash_pods_use_source)
27
27
  end
28
28
 
29
- def set_configuration_dependence(dependence = "uat")
30
- set_internal_hash_value(CONFIGURATION_DEPENDENCE, dependence)
31
- end
32
-
33
29
  end
34
30
 
35
31
  alias old_plugins plugins
@@ -60,10 +56,6 @@ module Pod
60
56
  get_internal_hash_value(USE_SOURCE_PODS, []) + String(ENV[USE_SOURCE_PODS]).split('|').uniq
61
57
  end
62
58
 
63
- def configuration_dependence
64
- get_internal_hash_value(CONFIGURATION_DEPENDENCE, "uat") || ENV[CONFIGURATION_DEPENDENCE] == "uat"
65
- end
66
-
67
59
  private
68
60
 
69
61
  def valid_bin_plugin
@@ -5,7 +5,6 @@ module Pod
5
5
  USE_BINARIES_SELECTOR = 'use_binaries_selector'
6
6
  ALLOW_PRERELEASE = 'allow_prerelease'
7
7
  USE_PLUGINS = 'use_plugins'
8
- CONFIGURATION_DEPENDENCE = 'configuration_dependence'
9
8
 
10
9
  module ENVExecutor
11
10
 
@@ -2,16 +2,3 @@ require 'cocoapods-pahealth-bin/native/sources_manager'
2
2
  require 'cocoapods-pahealth-bin/native/podfile'
3
3
  require 'cocoapods'
4
4
 
5
- Pod::HooksManager.register('cocoapods-pahealth-bin', :source_provider) do |context, _|
6
- sources_manager = Pod::Config.instance.sources_manager
7
- podfile = Pod::Config.instance.podfile
8
-
9
- if podfile
10
- # 添加源
11
- added_sources = [sources_manager.trunk_source]
12
- added_sources << sources_manager.code_source
13
- added_sources.reverse!
14
-
15
- added_sources.each { |source| context.add_source(source) }
16
- end
17
- end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-pahealth-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitWangKai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-22 00:00:00.000000000 Z
11
+ date: 2020-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel