podsorz 0.0.7 → 0.0.13

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: 5a44111361a02ff1c1a71d7085d25bc8ac4ae3835085913ac796c09a86cda8f9
4
- data.tar.gz: e130cd226bdb7072e8db2ee84ca2fad1a09d0d5cbb6b56a7b23e5ed2c206e190
3
+ metadata.gz: bd62dd4556e53831b2b078c24ea852a7c756288385a316ac86e38b3f4ae3a2be
4
+ data.tar.gz: 4d12c63701b3ea89a5096a7f440061940424b8e2ddc33fe1b7ef65200078b8cb
5
5
  SHA512:
6
- metadata.gz: 021efcba84b814774fb105bb019d81053ffbaa727f469ca1c679a55f2ee65a1749ebc4aa15a9c684292899a2ab6930543812b0c825a9ee440b0cc5a2cf2381e3
7
- data.tar.gz: b936d7f1b824146c954767ffd987127ebf09d474e127dae7b9f16e16cf494b959bd1003855c73997d5c5252b11665e25e7bfc2be32175a6b4d62505cc27a589d
6
+ metadata.gz: 216b722dbe1466edbc93c9051ea2e0f4a57324774d201c90f11b44c9adaed803fc49e9f381fb336dc60c817824290075ff673369098ad04e4e42a1a94a3ee386
7
+ data.tar.gz: da69be9b603987f84ff1a951f1582afefc8a0e647472d3dc89ae6924886823ac15088b3f0fe736e643b8a9ddbe6e65f8d217ebbda9a1facec677478ab09dc451
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -0,0 +1,17 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Listen for rdebug-ide",
9
+ "type": "Ruby",
10
+ "request": "attach",
11
+ "cwd": "${workspaceRoot}",
12
+ "remoteHost": "127.0.0.1",
13
+ "remotePort": "1234",
14
+ "remoteWorkspaceRoot": "${workspaceRoot}"
15
+ }
16
+ ]
17
+ }
data/Gemfile CHANGED
@@ -4,3 +4,13 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in podsorz.gemspec
6
6
  gemspec
7
+ gem "rspec"
8
+
9
+ group :development do
10
+ gem 'bacon'
11
+ gem 'mocha-on-bacon'
12
+ gem 'mocha'
13
+ gem 'prettybacon'
14
+ gem 'coveralls', :require => false
15
+ gem 'rubocop'
16
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- podsorz (0.0.5)
4
+ podsorz (0.0.8)
5
5
  cocoapods
6
6
  cocoapods-packager
7
7
  colorize
@@ -21,7 +21,9 @@ GEM
21
21
  algoliasearch (1.27.5)
22
22
  httpclient (~> 2.8, >= 2.8.3)
23
23
  json (>= 1.5.1)
24
+ ast (2.4.2)
24
25
  atomos (0.1.3)
26
+ bacon (1.2.0)
25
27
  claide (1.0.3)
26
28
  cocoapods (1.10.1)
27
29
  addressable (~> 2.6)
@@ -65,6 +67,14 @@ GEM
65
67
  colored2 (3.1.2)
66
68
  colorize (0.8.1)
67
69
  concurrent-ruby (1.1.8)
70
+ coveralls (0.8.23)
71
+ json (>= 1.8, < 3)
72
+ simplecov (~> 0.16.1)
73
+ term-ansicolor (~> 1.3)
74
+ thor (>= 0.19.4, < 2.0)
75
+ tins (~> 1.6)
76
+ diff-lcs (1.4.4)
77
+ docile (1.3.5)
68
78
  escape (0.0.4)
69
79
  ethon (0.12.0)
70
80
  ffi (>= 1.3.0)
@@ -78,17 +88,65 @@ GEM
78
88
  concurrent-ruby (~> 1.0)
79
89
  json (2.5.1)
80
90
  minitest (5.14.4)
91
+ mocha (1.12.0)
92
+ mocha-on-bacon (0.2.3)
93
+ mocha (>= 0.13.0)
81
94
  molinillo (0.6.6)
82
95
  nanaimo (0.3.0)
83
96
  nap (1.1.0)
84
97
  netrc (0.11.0)
98
+ parallel (1.20.1)
99
+ parser (3.0.0.0)
100
+ ast (~> 2.4.1)
101
+ prettybacon (0.0.2)
102
+ bacon (~> 1.2)
85
103
  public_suffix (4.0.6)
104
+ rainbow (3.0.0)
105
+ regexp_parser (2.1.1)
106
+ rexml (3.2.4)
107
+ rspec (3.10.0)
108
+ rspec-core (~> 3.10.0)
109
+ rspec-expectations (~> 3.10.0)
110
+ rspec-mocks (~> 3.10.0)
111
+ rspec-core (3.10.1)
112
+ rspec-support (~> 3.10.0)
113
+ rspec-expectations (3.10.1)
114
+ diff-lcs (>= 1.2.0, < 2.0)
115
+ rspec-support (~> 3.10.0)
116
+ rspec-mocks (3.10.2)
117
+ diff-lcs (>= 1.2.0, < 2.0)
118
+ rspec-support (~> 3.10.0)
119
+ rspec-support (3.10.2)
120
+ rubocop (1.11.0)
121
+ parallel (~> 1.10)
122
+ parser (>= 3.0.0.0)
123
+ rainbow (>= 2.2.2, < 4.0)
124
+ regexp_parser (>= 1.8, < 3.0)
125
+ rexml
126
+ rubocop-ast (>= 1.2.0, < 2.0)
127
+ ruby-progressbar (~> 1.7)
128
+ unicode-display_width (>= 1.4.0, < 3.0)
129
+ rubocop-ast (1.4.1)
130
+ parser (>= 2.7.1.5)
86
131
  ruby-macho (1.4.0)
132
+ ruby-progressbar (1.11.0)
133
+ simplecov (0.16.1)
134
+ docile (~> 1.1)
135
+ json (>= 1.8, < 3)
136
+ simplecov-html (~> 0.10.0)
137
+ simplecov-html (0.10.2)
138
+ sync (0.5.0)
139
+ term-ansicolor (1.7.1)
140
+ tins (~> 1.0)
141
+ thor (1.1.0)
87
142
  thread_safe (0.3.6)
143
+ tins (1.28.0)
144
+ sync
88
145
  typhoeus (1.4.0)
89
146
  ethon (>= 0.9.0)
90
147
  tzinfo (1.2.9)
91
148
  thread_safe (~> 0.1)
149
+ unicode-display_width (2.0.0)
92
150
  xcodeproj (1.19.0)
93
151
  CFPropertyList (>= 2.3.3, < 4.0)
94
152
  atomos (~> 0.1.3)
@@ -100,7 +158,14 @@ PLATFORMS
100
158
  ruby
101
159
 
102
160
  DEPENDENCIES
161
+ bacon
162
+ coveralls
163
+ mocha
164
+ mocha-on-bacon
103
165
  podsorz!
166
+ prettybacon
167
+ rspec
168
+ rubocop
104
169
 
105
170
  BUNDLED WITH
106
171
  1.17.2
data/lib/podsorz.rb CHANGED
@@ -8,6 +8,8 @@ require "podsorz/command/publish"
8
8
  require "podsorz/command/sync"
9
9
  require "podsorz/command/binary"
10
10
  require "podsorz/command/install"
11
+ require "podsorz/command/check"
12
+ require "podsorz/command/sort"
11
13
 
12
14
  require 'gli'
13
15
 
@@ -40,6 +42,8 @@ module PodsOrz
40
42
  install_command()
41
43
  sync_command()
42
44
  binary_command()
45
+ check_command()
46
+ sort_command()
43
47
 
44
48
  desc "Show podsorz version"
45
49
  command :version do |version|
@@ -14,7 +14,7 @@ module PodsOrz
14
14
  prepare_work(dir_path)
15
15
 
16
16
  git_manager = PodsOrz::PodsGitManager.new(dir_path)
17
- result_hash = filter_binary_pods_list(git_manager, :package)
17
+ result_hash = filter_binary_pods_list(dir_path,git_manager, :package)
18
18
  package_list = result_hash[:package]
19
19
 
20
20
  binary_manager = PodsOrz::BinaryManager.new(dir_path)
@@ -32,7 +32,7 @@ module PodsOrz
32
32
  prepare_work(dir_path)
33
33
 
34
34
  git_manager = PodsOrz::PodsGitManager.new(dir_path)
35
- filter_binary_pods_list(git_manager, :show)
35
+ filter_binary_pods_list(dir_path,git_manager, :show)
36
36
  end
37
37
 
38
38
  end
@@ -45,7 +45,7 @@ module PodsOrz
45
45
  prepare_work(dir_path)
46
46
 
47
47
  git_manager = PodsOrz::PodsGitManager.new(dir_path)
48
- result_hash = filter_binary_pods_list(git_manager, :package)
48
+ result_hash = filter_binary_pods_list(dir_path,git_manager, :package)
49
49
  package_list = result_hash[:package]
50
50
 
51
51
  binary_manager = PodsOrz::BinaryManager.new(dir_path)
@@ -59,12 +59,12 @@ module PodsOrz
59
59
  end
60
60
 
61
61
  def self.prepare_work(dir_path)
62
- pods_repo = PodsOrz::PodsRepo.new()
62
+ pods_repo = PodsOrz::PodsRepo.new(dir_path)
63
63
  pods_repo.check_repo_exist()
64
64
  end
65
65
 
66
66
 
67
- def self.filter_binary_pods_list(git_manager, cmd_type)
67
+ def self.filter_binary_pods_list(dir_path,git_manager, cmd_type)
68
68
  result_hash = {
69
69
  :binary => [],
70
70
  :package => []
@@ -104,7 +104,7 @@ module PodsOrz
104
104
  can_package_list = []
105
105
 
106
106
  #2.查询Podfile_orz是否为已发版本状态
107
- binary_repo = PodsOrz::BinaryRepo.new()
107
+ binary_repo = PodsOrz::BinaryRepo.new(dir_path)
108
108
  binary_repo.check_binary_repo_exist()
109
109
 
110
110
  origin_binary_list.each do |pod|
@@ -134,10 +134,17 @@ module PodsOrz
134
134
  end
135
135
  end
136
136
 
137
- Logger.highlight("[cmd:#{cmd_type}] Exist static library pods : \n #{exist_binary_list.inspect}")
137
+ Logger.highlight("[cmd:#{cmd_type}] Exist static library pods :")
138
+ exist_binary_list.each do |item|
139
+ puts item.colorize(:green)
140
+ end
141
+
138
142
  Logger.separator
139
- Logger.warning("[cmd:#{cmd_type}] Not exist static library pods: \n #{empty_binary_list.inspect}")
140
143
 
144
+ Logger.warning("[cmd:#{cmd_type}] Not exist static library pods:")
145
+ empty_binary_list.each do |item|
146
+ puts item.colorize(:yellow)
147
+ end
141
148
 
142
149
  result_hash[:binary] = has_binary_list
143
150
  result_hash[:package] = can_package_list
@@ -0,0 +1,31 @@
1
+ # require "podsorz/core/PodsOrz/pods_check_merge"
2
+ # require "../../PodsOrz/lib/podsorz/core/PodsOrz/pods_check_merge.rb"
3
+ require "podsorz/core/PodsOrz/pods_check_merge"
4
+ require "podsorz/core/Config/pod_orzconfig_parse"
5
+
6
+
7
+ module PodsOrz
8
+ def self.check_command
9
+ desc "Check Pods not merge"
10
+ command :check do |check|
11
+ check.action do |global_options, options, args|
12
+ dir_path = global_options[:path]
13
+
14
+ is_directory = File.directory?(dir_path)
15
+
16
+ unless is_directory
17
+ Logger.error("Check failure, it is not a directory path: #{dir_path}")
18
+ exit()
19
+ end
20
+
21
+ @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(dir_path)
22
+ kx_pods_path = File.expand_path("../#{@orzconfig_parse.file_devpods_name}", dir_path)
23
+ # puts "kx_pods_path #{kx_pods_path}"
24
+ checkManger = PodsOrz::PodsCheckMerge.new()
25
+ checkManger.branchList(kx_pods_path)
26
+
27
+ end
28
+ end
29
+ end
30
+
31
+ end
@@ -18,7 +18,7 @@ module PodsOrz
18
18
  exit() unless is_same
19
19
 
20
20
  #获取binary 列表
21
- list_hash = PodsOrz.filter_binary_pods_list(git_manager, :binary)
21
+ list_hash = PodsOrz.filter_binary_pods_list(dir_path,git_manager, :binary)
22
22
 
23
23
  git_manager.install_pod(dir_path, list_hash[:binary])
24
24
  end
@@ -0,0 +1,34 @@
1
+ require "podsorz/core/PodsOrz/pods_sort"
2
+ require "podsorz/core/Config/pod_orzconfig_parse"
3
+
4
+ module PodsOrz
5
+ def self.sort_command
6
+ desc "Prioritize the pods to be released and check for loops. Output the number of dependency"
7
+ command :sort do |sort|
8
+ sort.action do |global_options, options, args|
9
+ dir_path = global_options[:path]
10
+
11
+ is_directory = File.directory?(dir_path)
12
+
13
+ unless is_directory
14
+ Logger.error("Check failure, it is not a directory path: #{dir_path}")
15
+ exit()
16
+ end
17
+
18
+
19
+ @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(dir_path)
20
+ kx_pods_path = File.expand_path("../#{@orzconfig_parse.file_devpods_name}", dir_path)
21
+ pods_list = @orzconfig_parse.fix_pod_list
22
+ if pods_list.empty?
23
+ Logger.warning("fix_pods is empty nothing to do")
24
+ else
25
+ pods_sort = PodsOrz::PodsSort.new()
26
+ pods_list = pods_sort.sort(pods_list,kx_pods_path)
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+
34
+ end
@@ -6,16 +6,17 @@ require "open3"
6
6
 
7
7
  module PodsOrz
8
8
  class BinaryBuilder
9
- attr_accessor :main_path, :kx_binary_path, :podfile_io, :pod_repo, :http_host
9
+ attr_accessor :main_path, :kx_binary_path, :podfile_io, :pod_repo, :http_host, :remote_binary_directory
10
10
 
11
11
  def initialize(main_path, podfile_io)
12
12
  @main_path = main_path
13
13
  @kx_binary_path = File.expand_path("../kx_binary", main_path)
14
14
 
15
15
  @podfile_io = podfile_io
16
- @pod_repo = PodsOrz::PodsRepo.new()
16
+ @pod_repo = PodsOrz::PodsRepo.new(main_path)
17
17
 
18
- @http_host = "http://192.168.6.23:8080"
18
+ @http_host = "http://192.168.6.127:8899"
19
+ @remote_binary_directory = "binary_pod"
19
20
  end
20
21
 
21
22
  def start_package_pod(pod)
@@ -82,7 +83,7 @@ module PodsOrz
82
83
  binary_result = File.directory?(@kx_binary_path)
83
84
  unless binary_result
84
85
  Logger.warning("kx_binary directory not exist, generate default 'kx_binary' directory")
85
- Dir.mkdir(@kx_pods_path)
86
+ FileUtils.mkdir_p(@kx_binary_path, :mode => 0777)
86
87
  end
87
88
  end
88
89
  end
@@ -99,7 +100,7 @@ module PodsOrz
99
100
  pod_result = File.directory?(pod_path)
100
101
  unless pod_result
101
102
  Logger.warning("#{pod_path} directory not exist, generate default '#{pod_path}' directory")
102
- Dir.mkdir(pod_path)
103
+ FileUtils.mkdir_p(pod_path, :mode => 0777)
103
104
  end
104
105
  end
105
106
 
@@ -107,8 +108,8 @@ module PodsOrz
107
108
  pod_version_path = File.expand_path("#{pod}/#{pod_version}", @kx_binary_path)
108
109
  pod_version_result = File.directory?(pod_version_path)
109
110
  unless pod_version_result
110
- Logger.warning("#{pod_version_path} directory not exist, generate default '#{pod_version_path}' directory")
111
- Dir.mkdir(pod_version_path)
111
+ Logger.warning("#{pod_version_path} directory not exist, generate default '#{pod_version_path}' directory")
112
+ FileUtils.mkdir_p(pod_version_path, :mode => 0777)
112
113
  end
113
114
 
114
115
  pod_version_path
@@ -241,7 +242,7 @@ module PodsOrz
241
242
  unless sentence_content.start_with?("#")
242
243
  mt = /.*s.source = /.match(sentence)
243
244
  unless mt.nil?
244
- sentence = mt[0] + "{:http => \'#{http_host}/#{pod}/#{pod_version}/#{pod}.framework.zip\'}"
245
+ sentence = mt[0] + "{:http => \'#{@http_host}/#{remote_binary_directory}/#{pod}/#{pod_version}/#{pod}.framework.zip\'}"
245
246
  end
246
247
 
247
248
  mt = /.*s.ios.vendored_framework = /.match(sentence)
@@ -11,7 +11,7 @@ module PodsOrz
11
11
  @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(main_path)
12
12
  @podfile_io = PodsOrz::PodfileIO.new(main_path)
13
13
 
14
- @binary_repo = PodsOrz::BinaryRepo.new()
14
+ @binary_repo = PodsOrz::BinaryRepo.new(main_path)
15
15
  @binary_repo.check_binary_repo_exist()
16
16
 
17
17
  @binary_builder = PodsOrz::BinaryBuilder.new(main_path, @podfile_io)
@@ -150,7 +150,11 @@ module PodsOrz
150
150
  dest_dir = @binary_builder.detect_version_directory(pod, pod_version)
151
151
 
152
152
  each_result = @binary_repo.push_binary_remote(pod, dest_dir, pod_version, false)
153
- is_publish_success = false unless each_result
153
+ unless each_result
154
+ is_publish_success = false
155
+ Logger.error("#{pod}(#{pod_version}) publish failure!")
156
+ end
157
+
154
158
  end
155
159
 
156
160
  command.join
@@ -1,14 +1,21 @@
1
1
  require "podsorz/util/logger"
2
2
  require 'open3'
3
+ require "podsorz/core/Binary/binary_server"
4
+ require "podsorz/core/Config/pod_orzconfig_parse"
5
+
3
6
 
4
7
  module PodsOrz
5
8
  class BinaryRepo
6
- attr_accessor :repo_name, :repo_url
9
+ attr_accessor :repo_name, :repo_url, :binary_server
7
10
 
8
- def initialize()
11
+ def initialize(main_path)
9
12
  @repo_name = "kuxiu_binary_specs"
10
13
  @repo_url = "git@gitlab.91banban.com:ios_pods/binary-specs.git"
11
- @source_code_repo_url = "git@gitlab.91banban.com:ios_pods/Specs.git"
14
+ @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(main_path)
15
+ # 替换成config配置参数
16
+ # @source_code_repo_url = "git@gitlab.91banban.com:ios_pods/Specs.git"
17
+ @source_code_repo_url = @orzconfig_parse.remote_url_codespec
18
+ @binary_server = PodsOrz::BinaryServer.new()
12
19
  end
13
20
 
14
21
  def check_binary_repo_exist()
@@ -132,6 +139,19 @@ module PodsOrz
132
139
  def push_binary_remote(pod, file_path, pod_version, is_swift)
133
140
  is_push_success = false
134
141
 
142
+ #1.上传文件到服务器
143
+ is_push_success = @binary_server.upload_pod_file(pod, file_path, pod_version)
144
+ return is_push_success unless is_push_success
145
+
146
+ #2.发布到binary_repo
147
+ is_push_success = start_publish_binary(pod, file_path, pod_version, is_swift)
148
+
149
+ is_push_success
150
+ end
151
+
152
+ def start_publish_binary(pod, file_path, pod_version, is_swift)
153
+ is_push_success = false
154
+
135
155
  command = Thread.new do
136
156
  repo_push_cmd = []
137
157
  repo_push_cmd << "cd #{file_path}"
@@ -168,9 +188,6 @@ module PodsOrz
168
188
  is_push_success
169
189
  end
170
190
 
171
-
172
-
173
-
174
191
  #Class End
175
192
 
176
193
  end