kookeeper 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/.gitignore +8 -0
- data/.idea/bigkeeper.iml +68 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/CODE_OF_CONDUCT.md +46 -0
- data/CONTRIBUTING.md +70 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +145 -0
- data/LICENSE +21 -0
- data/README.md +113 -0
- data/big_keeper.gemspec +50 -0
- data/docs/en-US/FEATURE.md +0 -0
- data/docs/en-US/README.md +54 -0
- data/docs/zh-CN/BIGKEEPER_FILE.md +84 -0
- data/docs/zh-CN/FEATURE&HOTFIX.md +88 -0
- data/docs/zh-CN/IMAGE.md +0 -0
- data/docs/zh-CN/PODFILE.md +43 -0
- data/docs/zh-CN/README.md +113 -0
- data/docs/zh-CN/RECOMMEND.md +22 -0
- data/docs/zh-CN/RELEASE.md +60 -0
- data/docs/zh-CN/SPEC.md +39 -0
- data/lib/big_keeper/command/feature&hotfix/delete.rb +40 -0
- data/lib/big_keeper/command/feature&hotfix/finish.rb +54 -0
- data/lib/big_keeper/command/feature&hotfix/list.rb +63 -0
- data/lib/big_keeper/command/feature&hotfix/publish.rb +56 -0
- data/lib/big_keeper/command/feature&hotfix/pull.rb +26 -0
- data/lib/big_keeper/command/feature&hotfix/push.rb +27 -0
- data/lib/big_keeper/command/feature&hotfix/rebase.rb +32 -0
- data/lib/big_keeper/command/feature&hotfix/start.rb +74 -0
- data/lib/big_keeper/command/feature&hotfix/switch.rb +46 -0
- data/lib/big_keeper/command/feature&hotfix/update.rb +66 -0
- data/lib/big_keeper/command/feature&hotfix.rb +167 -0
- data/lib/big_keeper/command/image/image.rb +0 -0
- data/lib/big_keeper/command/image.rb +28 -0
- data/lib/big_keeper/command/pod/podfile.rb +69 -0
- data/lib/big_keeper/command/pod.rb +42 -0
- data/lib/big_keeper/command/release/home.rb +91 -0
- data/lib/big_keeper/command/release/module.rb +61 -0
- data/lib/big_keeper/command/release.rb +75 -0
- data/lib/big_keeper/command/spec/add.rb +9 -0
- data/lib/big_keeper/command/spec/analyze.rb +88 -0
- data/lib/big_keeper/command/spec/delete.rb +9 -0
- data/lib/big_keeper/command/spec/list.rb +19 -0
- data/lib/big_keeper/command/spec/search.rb +9 -0
- data/lib/big_keeper/command/spec/sync.rb +12 -0
- data/lib/big_keeper/command/spec.rb +78 -0
- data/lib/big_keeper/dependency/dep_gradle_operator.rb +56 -0
- data/lib/big_keeper/dependency/dep_operator.rb +32 -0
- data/lib/big_keeper/dependency/dep_pod_operator.rb +130 -0
- data/lib/big_keeper/dependency/dep_service.rb +14 -0
- data/lib/big_keeper/dependency/dep_type.rb +33 -0
- data/lib/big_keeper/model/gitflow_type.rb +43 -0
- data/lib/big_keeper/model/library_model.rb +116 -0
- data/lib/big_keeper/model/operate_type.rb +27 -0
- data/lib/big_keeper/model/podfile_model.rb +33 -0
- data/lib/big_keeper/service/git_service.rb +210 -0
- data/lib/big_keeper/service/module_service.rb +159 -0
- data/lib/big_keeper/service/stash_service.rb +45 -0
- data/lib/big_keeper/util/bigkeeper_parser.rb +244 -0
- data/lib/big_keeper/util/cache_operator.rb +116 -0
- data/lib/big_keeper/util/code_operator.rb +37 -0
- data/lib/big_keeper/util/file_operator.rb +33 -0
- data/lib/big_keeper/util/git_operator.rb +221 -0
- data/lib/big_keeper/util/gitflow_operator.rb +51 -0
- data/lib/big_keeper/util/gradle_operator.rb +209 -0
- data/lib/big_keeper/util/info_plist_operator.rb +46 -0
- data/lib/big_keeper/util/leancloud_logger.rb +72 -0
- data/lib/big_keeper/util/list_generator.rb +101 -0
- data/lib/big_keeper/util/logger.rb +46 -0
- data/lib/big_keeper/util/pod_operator.rb +70 -0
- data/lib/big_keeper/util/podfile_detector.rb +111 -0
- data/lib/big_keeper/util/podfile_module.rb +63 -0
- data/lib/big_keeper/util/podfile_operator.rb +117 -0
- data/lib/big_keeper/util/verify_operator.rb +17 -0
- data/lib/big_keeper/util/xcode_operator.rb +15 -0
- data/lib/big_keeper/version.rb +3 -0
- data/lib/big_keeper.rb +71 -0
- data/resources/banner.png +0 -0
- data/resources/command.png +0 -0
- data/resources/keynote/big-keeper-readme-analyze.key +0 -0
- data/resources/keynote/big-keeper-readme-example.key +0 -0
- data/resources/keynote/big-keeper-readme-feature.key +0 -0
- data/resources/keynote/big-keeper-readme-release.key +0 -0
- data/resources/readme/big-keeper-readme.001.png +0 -0
- metadata +85 -2
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'big_keeper/util/bigkeeper_parser'
|
2
|
+
require 'big_keeper/util/podfile_detector'
|
3
|
+
require 'big_keeper/model/podfile_model'
|
4
|
+
require 'big_keeper/util/logger'
|
5
|
+
|
6
|
+
module BigKeeper
|
7
|
+
|
8
|
+
class PodfileModuleDetector
|
9
|
+
@module_list = []
|
10
|
+
|
11
|
+
def initialize(main_path)
|
12
|
+
@module_list = BigkeeperParser.module_names
|
13
|
+
@main_path = main_path
|
14
|
+
@update_modules = {}
|
15
|
+
# check_version_list
|
16
|
+
end
|
17
|
+
|
18
|
+
#检查需要更新业务库列表
|
19
|
+
def check_version_list
|
20
|
+
if @module_list.empty?
|
21
|
+
Logger.highlight('There is not any module should to be check.')
|
22
|
+
return
|
23
|
+
else
|
24
|
+
Logger.highlight('Checking..')
|
25
|
+
@module_list.each do |module_name|
|
26
|
+
get_pod_search_result(module_name)
|
27
|
+
end
|
28
|
+
|
29
|
+
#获得pod信息后
|
30
|
+
deal_module_info
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_pod_search_result(pod_name)
|
35
|
+
#输入pod Search 结果
|
36
|
+
`pod search #{pod_name} --ios --simple >> #{@main_path}/bigKeeperPodInfo.tmp`
|
37
|
+
end
|
38
|
+
|
39
|
+
def deal_module_info
|
40
|
+
podfile_lines = File.readlines("#{@main_path}/bigKeeperPodInfo.tmp")
|
41
|
+
Logger.highlight("Analyzing modules info...") unless podfile_lines.size.zero?
|
42
|
+
podfile_lines.collect do |sentence|
|
43
|
+
if sentence =~(/pod/)
|
44
|
+
sentence = sentence.sub('pod', '')
|
45
|
+
sentence = sentence.delete('\n\'')
|
46
|
+
match_result = sentence.split(',')
|
47
|
+
pod_name = match_result[0].strip
|
48
|
+
latest_version = match_result[1].strip
|
49
|
+
@update_modules[pod_name] = latest_version unless @update_modules.include?(pod_name)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
p @update_modules
|
53
|
+
File.delete("#{@main_path}/bigKeeperPodInfo.tmp")
|
54
|
+
@update_modules
|
55
|
+
end
|
56
|
+
|
57
|
+
def get_module_latest_version(pod_model)
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'tempfile'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'big_keeper/dependency/dep_type'
|
4
|
+
require 'big_keeper/util/podfile_detector'
|
5
|
+
|
6
|
+
module BigKeeper
|
7
|
+
# Operator for podfile
|
8
|
+
class PodfileOperator
|
9
|
+
def has(podfile, module_name)
|
10
|
+
File.open(podfile, 'r') do |file|
|
11
|
+
file.each_line do |line|
|
12
|
+
if line.include?module_name
|
13
|
+
return true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
false
|
18
|
+
end
|
19
|
+
|
20
|
+
def generate_pod_config(pod_name, version, comment)
|
21
|
+
module_config = ''
|
22
|
+
if comment != nil
|
23
|
+
module_config = " pod '#{pod_name}' , '#{version}' # #{comment}"
|
24
|
+
else
|
25
|
+
module_config = " pod '#{pod_name}' , '#{version}'"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def replace_all_module_release(path, user, module_names, version)
|
30
|
+
module_names.each do |module_name|
|
31
|
+
DepService.dep_operator(path, user).update_module_config(
|
32
|
+
module_name,
|
33
|
+
ModuleOperateType::RELEASE)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def find_and_lock(podfile, dictionary)
|
39
|
+
temp_file = Tempfile.new('.Podfile.tmp')
|
40
|
+
begin
|
41
|
+
File.open(podfile, 'r') do |file|
|
42
|
+
file.each_line do |line|
|
43
|
+
pod_model = PodfileDetector.get_pod_model(line)
|
44
|
+
if pod_model != nil && pod_model.name != nil && dictionary[pod_model.name] != nil
|
45
|
+
# p "#{pod_name},#{dictionary[pod_name]}"
|
46
|
+
temp_file.puts generate_pod_config(pod_model.name, dictionary[pod_model.name], pod_model.comment)
|
47
|
+
else
|
48
|
+
temp_file.puts line
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
temp_file.close
|
53
|
+
FileUtils.mv(temp_file.path, podfile)
|
54
|
+
ensure
|
55
|
+
temp_file.close
|
56
|
+
temp_file.unlink
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def find_and_upgrade(podfile, dictionary)
|
61
|
+
temp_file = Tempfile.new('.Podfile.tmp')
|
62
|
+
begin
|
63
|
+
File.open(podfile, 'r') do |file|
|
64
|
+
file.each_line do |line|
|
65
|
+
pod_model = PodfileDetector.get_pod_model(line)
|
66
|
+
if pod_model != nil && pod_model.name != nil && dictionary[pod_model.name] != nil
|
67
|
+
temp_file.puts generate_pod_config(pod_model.name, dictionary[pod_model.name], pod_model.comment)
|
68
|
+
else
|
69
|
+
temp_file.puts line
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
temp_file.close
|
74
|
+
FileUtils.mv(temp_file.path, podfile)
|
75
|
+
ensure
|
76
|
+
temp_file.close
|
77
|
+
temp_file.unlink
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def podspec_change(podspec_file, version, module_name)
|
82
|
+
temp_file = Tempfile.new(".#{module_name}.podspec")
|
83
|
+
has_change = false
|
84
|
+
begin
|
85
|
+
File.open(podspec_file, 'r') do |file|
|
86
|
+
file.each_line do |line|
|
87
|
+
if line.include?("s.version")
|
88
|
+
temp_line = line
|
89
|
+
temp_line_arr = temp_line.split("=")
|
90
|
+
if temp_line_arr[0].delete(" ") == "s.version"
|
91
|
+
unless temp_line_arr[temp_line_arr.length - 1].include? "#{version}"
|
92
|
+
temp_file.puts "s.version = '#{version}'"
|
93
|
+
has_change = true
|
94
|
+
else
|
95
|
+
temp_file.puts line
|
96
|
+
Logger.highlight("The version in PodSpec is equal your input version")
|
97
|
+
end
|
98
|
+
else
|
99
|
+
temp_file.puts line
|
100
|
+
end
|
101
|
+
else
|
102
|
+
temp_file.puts line
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
temp_file.close
|
107
|
+
FileUtils.mv(temp_file.path, podspec_file)
|
108
|
+
ensure
|
109
|
+
temp_file.close
|
110
|
+
temp_file.unlink
|
111
|
+
end
|
112
|
+
has_change
|
113
|
+
end
|
114
|
+
|
115
|
+
private :generate_pod_config
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module BigKeeper
|
2
|
+
# Operator for got
|
3
|
+
class VerifyOperator
|
4
|
+
def self.already_in_process?
|
5
|
+
already_in_process = false
|
6
|
+
Open3.popen3('ps aux | grep \<big\> -c') do |stdin , stdout , stderr, wait_thr|
|
7
|
+
while line = stdout.gets
|
8
|
+
if line.rstrip.to_i > 2
|
9
|
+
already_in_process = true
|
10
|
+
break
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
already_in_process
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/big_keeper.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'big_keeper/version'
|
4
|
+
|
5
|
+
require 'big_keeper/util/bigkeeper_parser'
|
6
|
+
require 'big_keeper/util/git_operator'
|
7
|
+
require 'big_keeper/util/verify_operator'
|
8
|
+
|
9
|
+
require 'big_keeper/model/gitflow_type'
|
10
|
+
|
11
|
+
require 'big_keeper/command/feature&hotfix'
|
12
|
+
require 'big_keeper/command/release'
|
13
|
+
require 'big_keeper/command/pod'
|
14
|
+
require 'big_keeper/command/spec'
|
15
|
+
require 'big_keeper/command/image'
|
16
|
+
|
17
|
+
require 'big_keeper/service/git_service'
|
18
|
+
require 'big_keeper/util/leancloud_logger'
|
19
|
+
|
20
|
+
require 'gli'
|
21
|
+
|
22
|
+
include GLI::App
|
23
|
+
|
24
|
+
module BigKeeper
|
25
|
+
# Your code goes here...
|
26
|
+
program_desc 'Efficiency improvement for iOS&Android module development, iOSer&Android using this tool can make module development easier.'
|
27
|
+
|
28
|
+
flag %i[p path], default_value: './'
|
29
|
+
flag %i[v ver], default_value: 'Version in Bigkeeper file'
|
30
|
+
flag %i[u user], default_value: GitOperator.new.user.gsub(/[^0-9A-Za-z]/, '').downcase
|
31
|
+
|
32
|
+
if VerifyOperator.already_in_process?
|
33
|
+
p %Q(There is another 'big' command in process, please wait)
|
34
|
+
exit
|
35
|
+
end
|
36
|
+
|
37
|
+
if !GitflowOperator.new.verify_git_flow_command
|
38
|
+
p %Q('git-flow' not found, use 'brew install git-flow' to install it)
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
|
42
|
+
pre do |global_options,command,options,args|
|
43
|
+
LeanCloudLogger.instance.start_log(global_options, args)
|
44
|
+
end
|
45
|
+
|
46
|
+
post do |global_options,command,options,args|
|
47
|
+
LeanCloudLogger.instance.end_log(true)
|
48
|
+
end
|
49
|
+
|
50
|
+
feature_and_hotfix_command(GitflowType::FEATURE)
|
51
|
+
|
52
|
+
feature_and_hotfix_command(GitflowType::HOTFIX)
|
53
|
+
|
54
|
+
release_command
|
55
|
+
|
56
|
+
pod_command
|
57
|
+
|
58
|
+
spec_command
|
59
|
+
|
60
|
+
image_command
|
61
|
+
|
62
|
+
desc 'Show version of bigkeeper'
|
63
|
+
command :version do |version|
|
64
|
+
version.action do |global_options, options, args|
|
65
|
+
LeanCloudLogger.instance.set_command("version")
|
66
|
+
p "bigkeeper (#{VERSION})"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
exit run(ARGV)
|
71
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kookeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mmoaay
|
@@ -226,14 +226,97 @@ email:
|
|
226
226
|
- mmoaay@sina.com
|
227
227
|
executables:
|
228
228
|
- koo
|
229
|
-
- big
|
230
229
|
- setup
|
231
230
|
extensions: []
|
232
231
|
extra_rdoc_files: []
|
233
232
|
files:
|
233
|
+
- ".idea/.gitignore"
|
234
|
+
- ".idea/bigkeeper.iml"
|
235
|
+
- ".idea/modules.xml"
|
236
|
+
- ".idea/vcs.xml"
|
237
|
+
- CODE_OF_CONDUCT.md
|
238
|
+
- CONTRIBUTING.md
|
239
|
+
- Gemfile
|
240
|
+
- Gemfile.lock
|
241
|
+
- LICENSE
|
242
|
+
- README.md
|
243
|
+
- big_keeper.gemspec
|
234
244
|
- bin/big
|
235
245
|
- bin/koo
|
236
246
|
- bin/setup
|
247
|
+
- docs/en-US/FEATURE.md
|
248
|
+
- docs/en-US/README.md
|
249
|
+
- docs/zh-CN/BIGKEEPER_FILE.md
|
250
|
+
- docs/zh-CN/FEATURE&HOTFIX.md
|
251
|
+
- docs/zh-CN/IMAGE.md
|
252
|
+
- docs/zh-CN/PODFILE.md
|
253
|
+
- docs/zh-CN/README.md
|
254
|
+
- docs/zh-CN/RECOMMEND.md
|
255
|
+
- docs/zh-CN/RELEASE.md
|
256
|
+
- docs/zh-CN/SPEC.md
|
257
|
+
- lib/big_keeper.rb
|
258
|
+
- lib/big_keeper/command/feature&hotfix.rb
|
259
|
+
- lib/big_keeper/command/feature&hotfix/delete.rb
|
260
|
+
- lib/big_keeper/command/feature&hotfix/finish.rb
|
261
|
+
- lib/big_keeper/command/feature&hotfix/list.rb
|
262
|
+
- lib/big_keeper/command/feature&hotfix/publish.rb
|
263
|
+
- lib/big_keeper/command/feature&hotfix/pull.rb
|
264
|
+
- lib/big_keeper/command/feature&hotfix/push.rb
|
265
|
+
- lib/big_keeper/command/feature&hotfix/rebase.rb
|
266
|
+
- lib/big_keeper/command/feature&hotfix/start.rb
|
267
|
+
- lib/big_keeper/command/feature&hotfix/switch.rb
|
268
|
+
- lib/big_keeper/command/feature&hotfix/update.rb
|
269
|
+
- lib/big_keeper/command/image.rb
|
270
|
+
- lib/big_keeper/command/image/image.rb
|
271
|
+
- lib/big_keeper/command/pod.rb
|
272
|
+
- lib/big_keeper/command/pod/podfile.rb
|
273
|
+
- lib/big_keeper/command/release.rb
|
274
|
+
- lib/big_keeper/command/release/home.rb
|
275
|
+
- lib/big_keeper/command/release/module.rb
|
276
|
+
- lib/big_keeper/command/spec.rb
|
277
|
+
- lib/big_keeper/command/spec/add.rb
|
278
|
+
- lib/big_keeper/command/spec/analyze.rb
|
279
|
+
- lib/big_keeper/command/spec/delete.rb
|
280
|
+
- lib/big_keeper/command/spec/list.rb
|
281
|
+
- lib/big_keeper/command/spec/search.rb
|
282
|
+
- lib/big_keeper/command/spec/sync.rb
|
283
|
+
- lib/big_keeper/dependency/dep_gradle_operator.rb
|
284
|
+
- lib/big_keeper/dependency/dep_operator.rb
|
285
|
+
- lib/big_keeper/dependency/dep_pod_operator.rb
|
286
|
+
- lib/big_keeper/dependency/dep_service.rb
|
287
|
+
- lib/big_keeper/dependency/dep_type.rb
|
288
|
+
- lib/big_keeper/model/gitflow_type.rb
|
289
|
+
- lib/big_keeper/model/library_model.rb
|
290
|
+
- lib/big_keeper/model/operate_type.rb
|
291
|
+
- lib/big_keeper/model/podfile_model.rb
|
292
|
+
- lib/big_keeper/service/git_service.rb
|
293
|
+
- lib/big_keeper/service/module_service.rb
|
294
|
+
- lib/big_keeper/service/stash_service.rb
|
295
|
+
- lib/big_keeper/util/bigkeeper_parser.rb
|
296
|
+
- lib/big_keeper/util/cache_operator.rb
|
297
|
+
- lib/big_keeper/util/code_operator.rb
|
298
|
+
- lib/big_keeper/util/file_operator.rb
|
299
|
+
- lib/big_keeper/util/git_operator.rb
|
300
|
+
- lib/big_keeper/util/gitflow_operator.rb
|
301
|
+
- lib/big_keeper/util/gradle_operator.rb
|
302
|
+
- lib/big_keeper/util/info_plist_operator.rb
|
303
|
+
- lib/big_keeper/util/leancloud_logger.rb
|
304
|
+
- lib/big_keeper/util/list_generator.rb
|
305
|
+
- lib/big_keeper/util/logger.rb
|
306
|
+
- lib/big_keeper/util/pod_operator.rb
|
307
|
+
- lib/big_keeper/util/podfile_detector.rb
|
308
|
+
- lib/big_keeper/util/podfile_module.rb
|
309
|
+
- lib/big_keeper/util/podfile_operator.rb
|
310
|
+
- lib/big_keeper/util/verify_operator.rb
|
311
|
+
- lib/big_keeper/util/xcode_operator.rb
|
312
|
+
- lib/big_keeper/version.rb
|
313
|
+
- resources/banner.png
|
314
|
+
- resources/command.png
|
315
|
+
- resources/keynote/big-keeper-readme-analyze.key
|
316
|
+
- resources/keynote/big-keeper-readme-example.key
|
317
|
+
- resources/keynote/big-keeper-readme-feature.key
|
318
|
+
- resources/keynote/big-keeper-readme-release.key
|
319
|
+
- resources/readme/big-keeper-readme.001.png
|
237
320
|
homepage: https://github.com/BigKeeper/bigkeeper
|
238
321
|
licenses:
|
239
322
|
- MIT
|