podsorz 0.0.10 → 0.0.16

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: 728879be777d0fc735cb208e256f5397a4930a712ae2da103fdf971698cde73c
4
- data.tar.gz: 49e47437e30d2dbfa2ac8984ff0c8370e772c527c493183e0c6edd253ffc0797
3
+ metadata.gz: 1cda97fc6e3f8d32835447c79c16ee066b46e30e637ae1886c47d02ee5f713d7
4
+ data.tar.gz: fd509646cfb5c7e46990772350534dec9e372793a6760eb0b052ee09a1a351a4
5
5
  SHA512:
6
- metadata.gz: 3627912e4815e19f3ac624017c952a581c9909d57140316e258f5d8e8162fd216fd67f45e1aca4221efcc1325a2223481e8ca7408e6773ac69545ec6d0ca7c9a
7
- data.tar.gz: aa28aaafbbe094033e71380bde262f01b9401fa2ee5a15b9e73f1a2b8d5fd266da70a0dda2ba79040032b8d9348ad912828fe0cd703266f904ea91ac888d9811
6
+ metadata.gz: 9fa515f5789e098e8c203a16ff9c05616f32da7cc36fbd8274d486ba934ddec83563aa052c6ce16854d11531fe38e4ec1b2e1787dfd5d09d92810a302f847e66
7
+ data.tar.gz: 3f28e79b36f487470d94dca15b0334e81377004ea127e9d82aa6068f59b3fa9c411d7c62d1d59d5c2fbc23b028fd8cc4f7d4866b60d394cc07cce81c0562ec6d
data/.bundle/config ADDED
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_CLEAN: "true"
@@ -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
+ }
@@ -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
@@ -1,6 +1,8 @@
1
1
  # require "podsorz/core/PodsOrz/pods_check_merge"
2
2
  # require "../../PodsOrz/lib/podsorz/core/PodsOrz/pods_check_merge.rb"
3
3
  require "podsorz/core/PodsOrz/pods_check_merge"
4
+ require "podsorz/core/Config/pod_orzconfig_parse"
5
+
4
6
 
5
7
  module PodsOrz
6
8
  def self.check_command
@@ -16,7 +18,8 @@ module PodsOrz
16
18
  exit()
17
19
  end
18
20
 
19
- kx_pods_path = File.expand_path("../kx_pods", dir_path)
21
+ @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(dir_path)
22
+ kx_pods_path = File.expand_path("../#{@orzconfig_parse.file_devpods_name}", dir_path)
20
23
  # puts "kx_pods_path #{kx_pods_path}"
21
24
  checkManger = PodsOrz::PodsCheckMerge.new()
22
25
  checkManger.branchList(kx_pods_path)
@@ -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
@@ -15,8 +15,9 @@ module PodsOrz
15
15
  exit()
16
16
  end
17
17
 
18
- kx_pods_path = File.expand_path("../kx_pods", dir_path)
18
+
19
19
  @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(dir_path)
20
+ kx_pods_path = File.expand_path("../#{@orzconfig_parse.file_devpods_name}", dir_path)
20
21
  pods_list = @orzconfig_parse.fix_pod_list
21
22
  if pods_list.empty?
22
23
  Logger.warning("fix_pods is empty nothing to do")
@@ -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_binary_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
@@ -1,21 +1,127 @@
1
1
  require "podsorz/util/logger"
2
+ require "open3"
3
+ require "thread"
2
4
 
3
5
 
4
6
  module PodsOrz
5
7
  class BinaryServer
6
- attr_accessor :remote_host
8
+ attr_accessor :http_host
7
9
 
8
10
  def initialize()
9
- @remote_host = "http://192.168.6.23:8080"
11
+ @http_host = "http://192.168.6.127:8899"
10
12
  end
11
13
 
14
+ def upload_pod_file(pod, file_path, pod_version)
15
+ is_upload_success = false
12
16
 
13
- def has_remote_source(pod, version)
14
-
17
+ # uplaod zip
18
+ is_upload_success = __action_upload(pod,file_path,pod_version,".framework.zip")
19
+ return is_upload_success unless is_upload_success
20
+
21
+ # upload .podspec
22
+ is_upload_success = __action_upload(pod,file_path,pod_version,".podspec")
15
23
 
24
+ is_upload_success
16
25
  end
17
26
 
27
+ def __action_upload(pod, file_path, pod_version, extension)
28
+ is_upload_success = false
29
+
30
+ file_name = "#{pod}#{extension}"
31
+ file_name_path = File.expand_path(file_name, file_path)
32
+
33
+ unless File.exist?(file_name_path)
34
+ Logger.error("#{file_name_path} not exist!")
35
+ is_upload_success = false
36
+ return is_upload_success
37
+ end
38
+
39
+ mutex = Mutex.new()
40
+ condition_var = ConditionVariable.new
41
+
42
+ wait_thread = Thread.new do
43
+ mutex.synchronize {
44
+ condition_var.wait(mutex, 30)
45
+ }
46
+ end
47
+
48
+ command = Thread.new do
49
+ mutex.synchronize {
50
+ upload_cmd = "curl #{@http_host}/upload -F \"podname=#{pod}\" -F \"version=#{pod_version}\" -F \"file=@#{file_name_path};filename=#{file_name}\""
51
+
52
+ Logger.warning("upload #{file_name}...\n #{upload_cmd}")
53
+
54
+ Open3.popen3(cmd_list.join(";")) do |stdin , stdout , stderr, wait_thr|
55
+ while line = stdout.gets
56
+ puts line
57
+ if line.include? "\"success\":"
58
+ is_upload_success = true if line.include? "true"
59
+ condition_var.signal
60
+ end
61
+ end
62
+ end
63
+
64
+ IO.popen(upload_cmd) do |io|
65
+ io_lines = io.readlines
66
+ io_lines.each do |line|
67
+ puts line
68
+
69
+ end
70
+ io.close
71
+ end
72
+ }
73
+ end
74
+
75
+ wait_thread.join()
76
+
77
+ Logger.error("upload #{file_name} failure!") unless is_upload_success
78
+
79
+ is_upload_success
80
+ end
81
+
82
+ def delete_pod_file(pod, pod_version)
83
+ is_delete_success = false
84
+
85
+ mutex = Mutex.new()
86
+ condition_var = ConditionVariable.new
87
+
88
+ wait_thread = Thread.new do
89
+ mutex.synchronize {
90
+ condition_var.wait(mutex, 2)
91
+ }
92
+ end
93
+
94
+ command = Thread.new do
95
+ mutex.synchronize {
96
+ delete_cmd = ""
97
+ if pod_version && pod_version.length > 0
98
+ delete_cmd = "curl #{@http_host}/delete -d \"podname=#{pod}\";\"version=#{pod_version}\""
99
+ else
100
+ delete_cmd = "curl #{@http_host}/delete -d \"podname=#{pod}\""
101
+ end
102
+
103
+ Logger.warning("delete #{pod}...\n #{delete_cmd}")
104
+
105
+ Open3.popen3(delete_cmd) do |stdin , stdout , stderr, wait_thr|
106
+ while line = stdout.gets
107
+ puts line
108
+ if line.include? "\"success\":"
109
+ is_delete_success = true if line.include? "true"
110
+ condition_var.signal
111
+ end
112
+ end
113
+ end
114
+ }
115
+ end
116
+
117
+ wait_thread.join()
118
+
119
+ Logger.error("delete #{pod} failure!") unless is_delete_success
120
+
121
+ is_delete_success
122
+ end
18
123
 
124
+ #Class end
19
125
  end
20
126
 
21
127
  end
@@ -1,31 +1,67 @@
1
- module GitConfig
2
- #App 当前版本
3
- APP_RELEASE_VERSION = "2.0.12"
4
-
5
- #作者姓名xiangqi简写
6
- BRANCH_AUTHOR_SUFFIX = "xq"
7
- end
1
+ #############
2
+ #开发人员专用
3
+ #############
8
4
 
9
5
  #想要开发修改的的Pod
10
- $FIX_POD_LIST = [
6
+ $FIX_POD_LIST = [
11
7
  # "KXModuleOrz",
12
8
  # "KXModuleQuestionRepo",
13
- ]
9
+ ]
10
+
11
+
12
+ module GitConfig
13
+ #App 当前版本
14
+ APP_RELEASE_VERSION = "2.1.2"
15
+
16
+ #作者姓名xiangqi简写
17
+ BRANCH_AUTHOR_SUFFIX = "yyt"
14
18
 
15
19
 
16
20
 
17
- #------Binary Static library------#
21
+ #App pods的远端仓库地址 源码
22
+ REMOTE_URL_SOURCECODE = 'git@gitlab.91banban.com:zhuita-ios/pod_group/pods'
23
+ #App podspec的发布地址仓库
24
+ REMOTE_URL_CODESPEC = 'git@gitlab.91banban.com:zhuita-ios/pod_group/specs.git'
25
+ #App 二进制存放地址 service
26
+ REMOTE_URL_SOURCEBINARY = 'http://192.168.6.127:8899'
27
+ #App 二进制 podspec的发布地址仓库
28
+ REMOTE_URL_BINARYSPEC = 'git@gitlab.91banban.com:zhuita-ios/pod_group/specs.git'
29
+
30
+ end
31
+
32
+ module FileConfig
33
+ #开发pods组件时仓库名称(需要与主工程同一级文件夹)
34
+ FILE_DEVPODS_NAME = 'zt_pods'
35
+
36
+ #ztPods/kxPods下的Pod源码库打包成二进制库相关 需要用到该行标识注释
37
+ FILE_PACKAGE_FILTER_MARK = 'ztPods'
38
+
39
+ #与cocoapods同一级的私有repo仓库文件夹名称
40
+ FILE_CODEREPO_NAME = "ZhuiTaRepo"
41
+
42
+ #与cocoapods同一级的私有二进制 repo仓库文件夹名称
43
+ FILE_BINARYREPO_NAME = "ZhuiTaRepo"
44
+
45
+ end
46
+
47
+
48
+
49
+
50
+
51
+ #############
52
+ #打包人员专用
53
+ #############
54
+
55
+ #------Binary Static library ------#
18
56
  #是否全部Pod以二进制静态库加载,false代表以源码显示【打包机】请用源码
19
- $is_all_binary = false
57
+ $is_all_binary = false
20
58
  #当is_all_binary = false 所有pod即将显示源码时,仍然希望部分Pod二进制静态库加载
21
- $static_lib_list = [
59
+ $static_lib_list = [
22
60
  # "AFNetworking",
23
- ]
61
+ ]
24
62
 
25
63
  #------Package Action------#
26
64
  #当is_all_binary = false 并不是针对所有pod 打binary包,仍然希望部分pod打包成二进制静态库的Pod
27
- $will_package_list = [
65
+ $will_package_list = [
28
66
  # "AFNetworking",
29
- ]
30
-
31
- #
67
+ ]
@@ -15,7 +15,7 @@ module PodsOrz
15
15
  result = File.exist?(podfile_path)
16
16
  unless result
17
17
  Logger.warning("Podfile not exist, create empty Podfile")
18
- IO.popen("cd #{directoryPath};touch Podfile")
18
+ IO.popen("cd #{directoryPath};pod init")
19
19
  end
20
20
  end
21
21
 
@@ -23,12 +23,30 @@ module PodsOrz
23
23
  podfile_path = File.expand_path("Podfile_orz.rb", directoryPath)
24
24
  result = File.exist?(podfile_path)
25
25
  unless result
26
- Logger.error("Podfile_orz.rb not exist, please manual makeup one. Copy content from project Podfile")
26
+ Logger.error("Podfile_orz.rb not exist,auto generate one which content is copy from origin Podfile")
27
+ IO.popen("cd #{directoryPath};touch Podfile_orz.rb")
28
+ copy_content_from_podfile(directoryPath)
27
29
  end
28
30
 
29
31
  result
30
32
  end
31
33
 
34
+ def copy_content_from_podfile(directoryPath)
35
+ podfile_path = File.expand_path("Podfile", directoryPath)
36
+ total_sentences = []
37
+ File.open(podfile_path, "r") { |io|
38
+ total_sentences = io.readlines
39
+ }
40
+
41
+ dest_path = File.expand_path("Podfile_orz.rb", directoryPath)
42
+ File.open(dest_path, "w+") {|io|
43
+ total_sentences.each do |sentence|
44
+ io.write(sentence)
45
+ end
46
+ }
47
+
48
+ end
49
+
32
50
  def detect_PodsOrzConfig(directoryPath)
33
51
  orzconfig_path = File.expand_path("PodsOrzConfig.rb", directoryPath)
34
52
  orzconfig_result = File.exist?(orzconfig_path)
@@ -3,7 +3,7 @@ require "podsorz/util/logger"
3
3
 
4
4
  module PodsOrz
5
5
  class PodOrzconfigParse
6
- attr_accessor :app_release_version, :branch_author_suffix, :fix_pod_list, :is_all_binary, :static_lib_list, :will_package_list
6
+ attr_accessor :app_release_version, :branch_author_suffix, :fix_pod_list, :is_all_binary, :static_lib_list, :will_package_list,:remote_url_sourcecode,:remote_url_codespec,:file_devpods_name, :file_package_filter_mark, :file_coderepo_name,:file_binaryrepo_name
7
7
 
8
8
  def initialize(main_path)
9
9
  orzconfig_path = File.expand_path("PodsOrzConfig.rb", main_path)
@@ -22,6 +22,24 @@ module PodsOrz
22
22
  @branch_author_suffix = GitConfig::BRANCH_AUTHOR_SUFFIX
23
23
  @branch_author_suffix = "" if @branch_author_suffix.nil?
24
24
 
25
+ @remote_url_sourcecode = GitConfig::REMOTE_URL_SOURCECODE
26
+ @remote_url_sourcecode = "" if @remote_url_sourcecode.nil?
27
+
28
+ @remote_url_codespec = GitConfig::REMOTE_URL_CODESPEC
29
+ @remote_url_codespec = "" if @remote_url_codespec.nil?
30
+
31
+ @file_devpods_name = FileConfig::FILE_DEVPODS_NAME
32
+ @file_devpods_name = "" if @file_devpods_name.nil?
33
+
34
+ @file_package_filter_mark = FileConfig::FILE_PACKAGE_FILTER_MARK
35
+ @file_package_filter_mark = "" if @file_package_filter_mark.nil?
36
+
37
+ @file_coderepo_name = FileConfig::FILE_CODEREPO_NAME
38
+ @file_coderepo_name = "" if @file_coderepo_name.nil?
39
+
40
+ @file_binaryrepo_name = FileConfig::FILE_BINARYREPO_NAME
41
+ @file_binaryrepo_name = "" if @file_binaryrepo_name.nil?
42
+
25
43
  @fix_pod_list = $FIX_POD_LIST
26
44
  @fix_pod_list = [] if @fix_pod_list.nil?
27
45
 
@@ -1,22 +1,25 @@
1
1
  require "podsorz/util/logger"
2
2
  require "podsorz/core/PodFile/podfile_model"
3
+ require "podsorz/core/Config/pod_orzconfig_parse"
4
+
3
5
 
4
6
  module PodsOrz
5
7
 
6
8
  class PodfileIO
7
- attr_accessor :main_path, :total_sentences, :usable_sentences, :total_pod_models, :http_host
9
+ attr_accessor :main_path, :total_sentences, :usable_sentences, :total_pod_models, :http_host, :remote_binary_directory
8
10
 
9
11
  def initialize(main_path)
10
12
  @main_path = main_path
11
- @http_host = "http://192.168.6.23:8080"
12
-
13
+ @http_host = "http://192.168.6.127:8899"
14
+ @remote_binary_directory = "binary_pod"
15
+ @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(main_path)
13
16
  self.parse_podfile_orz
14
17
  end
15
18
 
16
19
  def filter_binary_pod_models()
17
20
  filter_result_models = []
18
21
 
19
- filter_strings = ["sourceVendorPods", "subspecPods", "kxPods"]
22
+ filter_strings = ["sourceVendorPods", "subspecPods", @orzconfig_parse.file_package_filter_mark]
20
23
 
21
24
  result_lines = []
22
25
 
@@ -103,7 +106,7 @@ module PodsOrz
103
106
  pod_name_list.each do |podname|
104
107
  @total_pod_models.map { |model|
105
108
  if model.name.start_with? podname.to_s
106
- model.path = "../kx_pods/" + podname.to_s
109
+ model.path = "../#{@orzconfig_parse.file_devpods_name}/" + podname.to_s
107
110
  end
108
111
  }
109
112
  end
@@ -114,7 +117,8 @@ module PodsOrz
114
117
  pod_name_list.each do |podname|
115
118
  @total_pod_models.map { |model|
116
119
  if model.name.start_with? podname.to_s
117
- model.git = "git@gitlab.91banban.com:ios_pods/Pods/" + podname.to_s + ".git"
120
+ # 替换为config参数
121
+ model.git = "#{@orzconfig_parse.remote_url_sourcecode}/" + podname.to_s + ".git"
118
122
  model.branch = branch_name.to_s
119
123
  end
120
124
  }
@@ -314,7 +318,7 @@ module PodsOrz
314
318
  pod_name_list.each do |podname|
315
319
  @total_pod_models.map { |model|
316
320
  if model.name.start_with? podname.to_s
317
- model.podspec = "#{@http_host}/#{model.name}/#{model.version}/#{model.name}.podspec" unless model.version.nil?
321
+ model.podspec = "#{@http_host}/#{remote_binary_directory}/#{model.name}/#{model.version}/#{model.name}.podspec" unless model.version.nil?
318
322
  end
319
323
  }
320
324
  end
@@ -32,7 +32,6 @@ module PodsOrz
32
32
  # puts("branch- #{line}")
33
33
  # end
34
34
  # }
35
- # @kx_pods_directory = File.expand_path("../kx_pods", File.dirname(__FILE__))
36
35
  # puts "里层 #{@kx_pods_directory}"
37
36
 
38
37
  # kx_pods_path /Users/yuyutao/Desktop/rubyGem/kx_pods
@@ -6,10 +6,10 @@ module PodsOrz
6
6
  attr_accessor :kx_pods_path, :orzconfig_parse
7
7
 
8
8
  def initialize(main_path)
9
- @kx_pods_path = File.expand_path("../kx_pods", main_path)
10
-
11
- detect_kx_pods(main_path)
9
+
12
10
  @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(main_path)
11
+ @kx_pods_path = File.expand_path("../#{@orzconfig_parse.file_devpods_name}", main_path)
12
+ detect_kx_pods(main_path)
13
13
  end
14
14
 
15
15
  def check_directory(main_path)
@@ -26,8 +26,8 @@ module PodsOrz
26
26
  if result
27
27
  pods_result = File.directory?(@kx_pods_path)
28
28
  unless pods_result
29
- Logger.warning("kx_pods directory not exist, generate default 'kx_pods' directory")
30
- Dir.mkdir(@kx_pods_path)
29
+ Logger.warning("#{@orzconfig_parse.file_devpods_name} directory not exist, generate default directory")
30
+ FileUtils.mkdir_p(@kx_pods_path, :mode => 0777)
31
31
  end
32
32
  end
33
33
  end
@@ -63,7 +63,7 @@ module PodsOrz
63
63
  result = false if file_entries.empty?
64
64
  result = false unless file_entries.include?(".git")
65
65
 
66
- Logger.error("【#{pod}】 at #{pod_path} exist, but .git not work success, please manual check.") unless result
66
+ Logger.error("【#{pod}】 at #{pod_path} exist, but .git not work success, please manual check.") unless result
67
67
  else
68
68
  result = clone_orz_pod(pod)
69
69
  end
@@ -77,7 +77,8 @@ module PodsOrz
77
77
 
78
78
  Logger.default("Start clone 【#{pod}】 Project...")
79
79
  git_clone_content = ""
80
- IO.popen("git clone git@gitlab.91banban.com:ios_pods/Pods/#{pod}.git #{pod_directory}", :err=>[:child, :out]) {|io|
80
+ # 替换为config参数
81
+ IO.popen("git clone #{@orzconfig_parse.remote_url_sourcecode}/#{pod}.git #{pod_directory}", :err=>[:child, :out]) {|io|
81
82
  git_clone_content = io.read
82
83
  puts(git_clone_content)
83
84
  is_clone_success = false if git_clone_content.to_s.include? "fatal"
@@ -13,7 +13,7 @@ module PodsOrz
13
13
  def initialize(main_path)
14
14
  @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(main_path)
15
15
 
16
- kx_pods_path = File.expand_path("../kx_pods", main_path)
16
+ kx_pods_path = File.expand_path("../#{@orzconfig_parse.file_devpods_name}", main_path)
17
17
  @pods_git_operator = PodsOrz::PodsGitOperator.new(kx_pods_path, @orzconfig_parse.app_release_version, @orzconfig_parse.branch_author_suffix)
18
18
 
19
19
  @podfile_io = PodsOrz::PodfileIO.new(main_path)
@@ -21,7 +21,7 @@ module PodsOrz
21
21
 
22
22
  @pods_version = PodsOrz::PodsVersion.new(main_path)
23
23
 
24
- @pods_repo = PodsOrz::PodsRepo.new()
24
+ @pods_repo = PodsOrz::PodsRepo.new(main_path)
25
25
  end
26
26
 
27
27
  #Switch Command --
@@ -383,8 +383,7 @@ module PodsOrz
383
383
  else
384
384
  pods_sort = PodsOrz::PodsSort.new()
385
385
  kx_pods_subPath = @pods_git_operator.get_pod_file_path("")
386
- pods_list = pods_sort.sort(pods_list,kx_pods_subPath)
387
-
386
+ pods_list = pods_sort.sort(pods_list,kx_pods_subPath)
388
387
  end
389
388
 
390
389
  pods_list.each {|pod|
@@ -478,7 +477,7 @@ module PodsOrz
478
477
  command.join
479
478
 
480
479
  command = Thread.new do
481
- Open3.popen3("cd #{main_path};pod update --no-repo-update --verbose") do |stdin , stdout , stderr, wait_thr|
480
+ Open3.popen3("cd #{main_path};pod update") do |stdin , stdout , stderr, wait_thr|
482
481
  while line = stdout.gets
483
482
  puts line
484
483
  end
@@ -40,7 +40,7 @@ module PodsOrz
40
40
 
41
41
  def switch_feature_pod(pod)
42
42
  previous_branch = self.current_pod_branch(pod)
43
- next_branch = "feature/" + "#{@author_suffix}" + "_#{@app_release_version}"
43
+ next_branch = "feature/" + "#{@author_suffix}"
44
44
 
45
45
  is_ready = true
46
46
  is_same = previous_branch.include? next_branch
@@ -116,7 +116,7 @@ module PodsOrz
116
116
 
117
117
  def switch_bugfix_pod(pod)
118
118
  previous_branch = self.current_pod_branch(pod)
119
- next_branch = "bugfix/" + "#{@author_suffix}" + "_#{@app_release_version}"
119
+ next_branch = "bugfix/" + "#{@author_suffix}"
120
120
 
121
121
  is_ready = true
122
122
  is_same = previous_branch.include? next_branch
@@ -1,13 +1,18 @@
1
1
  require "podsorz/util/logger"
2
2
  require 'open3'
3
+ require "podsorz/core/Config/pod_orzconfig_parse"
4
+
3
5
 
4
6
  module PodsOrz
5
7
  class PodsRepo
6
8
  attr_accessor :repo_name, :repo_url
7
9
 
8
- def initialize()
9
- @repo_name = "kuxiu_specs"
10
- @repo_url = "git@gitlab.91banban.com:ios_pods/Specs.git"
10
+ def initialize(main_path)
11
+ # @repo_name = "kuxiu_specs"
12
+ # 替换成config配置参数
13
+ @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(main_path)
14
+ @repo_url = @orzconfig_parse.remote_url_codespec
15
+ @repo_name = @orzconfig_parse.file_coderepo_name
11
16
  end
12
17
 
13
18
  def check_repo_exist
@@ -1,4 +1,5 @@
1
1
  require "podsorz/util/logger"
2
+ require "podsorz/core/Config/pod_orzconfig_parse"
2
3
 
3
4
 
4
5
  module PodsOrz
@@ -6,7 +7,8 @@ module PodsOrz
6
7
  attr_accessor :kx_pods_path
7
8
 
8
9
  def initialize(main_path)
9
- @kx_pods_path = File.expand_path("../kx_pods", main_path)
10
+ @orzconfig_parse = PodsOrz::PodOrzconfigParse.new(main_path)
11
+ @kx_pods_path = File.expand_path("../#{@orzconfig_parse.file_devpods_name}", main_path)
10
12
  end
11
13
 
12
14
  def increase_pod_version(pod)
@@ -24,7 +24,7 @@ module PodsOrz
24
24
  has_branch = false
25
25
  IO.popen("cd '#{path}';git branch") do |io|
26
26
  io.each do |line|
27
- has_branch = true if line.include? branch_name
27
+ has_branch = true if line.strip.eql? branch_name
28
28
  end
29
29
 
30
30
  io.close
@@ -36,7 +36,8 @@ module PodsOrz
36
36
  has_branch = false
37
37
  IO.popen("cd '#{path}';git fetch --all;git branch -a") do |io|
38
38
  io.each do |line|
39
- has_branch = true if line.include? branch_name
39
+ # has_branch = true if line.strip.eql? branch_name
40
+ has_branch = true if line.to_s.chomp.strip.end_with? branch_name
40
41
  end
41
42
 
42
43
  io.close
@@ -1,3 +1,3 @@
1
1
  module PodsOrz
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.16"
3
3
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podsorz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xiangqi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -76,12 +76,13 @@ executables:
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
+ - ".bundle/config"
79
80
  - ".gitignore"
80
81
  - ".rspec"
82
+ - ".vscode/launch.json"
81
83
  - Gemfile
82
84
  - Gemfile.lock
83
85
  - LICENSE.txt
84
- - Podfile
85
86
  - README.md
86
87
  - Rakefile
87
88
  - bin/podsorz
@@ -116,6 +117,12 @@ files:
116
117
  - lib/podsorz/util/logger.rb
117
118
  - lib/podsorz/util/process_operator.rb
118
119
  - lib/podsorz/version.rb
120
+ - pkg/podsorz-0.0.10.gem
121
+ - pkg/podsorz-0.0.11.gem
122
+ - pkg/podsorz-0.0.12.gem
123
+ - pkg/podsorz-0.0.7.gem
124
+ - pkg/podsorz-0.0.8.gem
125
+ - pkg/podsorz-0.0.9.gem
119
126
  - podsorz.gemspec
120
127
  homepage: https://github.com/XiangqiTu
121
128
  licenses:
data/Podfile DELETED
File without changes