bigkeeper 0.8.2 → 0.8.3

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
  SHA1:
3
- metadata.gz: b2455c224a1bb937f05c9a99a1a0deaad0650e08
4
- data.tar.gz: 7432572e163736ebee2275bce07d97f0c5952bcf
3
+ metadata.gz: b0865993502adc9ea5a674ce5201cc9d28cad25b
4
+ data.tar.gz: 98224dd734ab65172620028b5a6138fa0a73d872
5
5
  SHA512:
6
- metadata.gz: f5f8c0aa2f96982f35358911c2b5ade8eb2d1d2b4ab4b3f66ca63e0e3b85815d75af40efc2a963a8e8e7527f2e5f1996cf82c95c174cdde477340c4e85ece4f4
7
- data.tar.gz: f011e953b604e0311c46d7f9eef03c263aadf5e0d6da515605b1c8f9c7b16b96e962e704412a5c5b10aa1ca2243e72ac73e8238eca49ed7f28d63c6bc0a9e2c4
6
+ metadata.gz: eb028888e708fd0156d0d1a4c03d6d107ac5f1c64b4138ecd8922e78a3048051d6f87dcf87a46b66ac0a5fb68f404463a9a13737ff9a6f4aed82a4109874d2ef
7
+ data.tar.gz: fcecfc0731700f362578423571b472fa1b277421df0653e88f79ac457b06462f7618315e4597f373754c690c7b1765ca7f2a07d4d159a082a1d233a1ecfb0e9e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bigkeeper (0.8.0)
4
+ bigkeeper (0.8.2)
5
5
  big_stash (~> 0.1)
6
6
  cocoapods
7
7
  colorize
data/lib/big_keeper.rb CHANGED
@@ -11,6 +11,7 @@ require 'big_keeper/model/gitflow_type'
11
11
  require 'big_keeper/command/feature&hotfix'
12
12
  require 'big_keeper/command/release'
13
13
  require 'big_keeper/command/pod'
14
+ require 'big_keeper/command/module'
14
15
 
15
16
  require 'big_keeper/service/git_service'
16
17
 
@@ -44,6 +45,8 @@ module BigKeeper
44
45
 
45
46
  pod_command
46
47
 
48
+ module_command
49
+
47
50
  desc 'Show version of bigkeeper'
48
51
  command :version do |version|
49
52
  version.action do |global_options, options, args|
@@ -22,7 +22,7 @@ module BigKeeper
22
22
  file = File.new(json_path, 'w')
23
23
  begin
24
24
  #get all modules info
25
- module_list_dic = get_module_info(path, user, type, version, branches)
25
+ module_list_dic = get_module_info(path, user, type, version, branches, is_print_log)
26
26
  file << module_list_dic.to_json
27
27
  file.close
28
28
  end
@@ -33,7 +33,7 @@ module BigKeeper
33
33
  end
34
34
  end
35
35
 
36
- def self.get_module_info(path, user, type, version, home_branches)
36
+ def self.get_module_info(path, user, type, version, home_branches, is_print_log)
37
37
  #get module list
38
38
  modules = BigkeeperParser.module_names
39
39
  git_operator = GitOperator.new
@@ -7,13 +7,12 @@ require 'big_keeper/util/xcode_operator'
7
7
  require 'big_keeper/dependency/dep_service'
8
8
 
9
9
  module BigKeeper
10
- def self.switch_to(path, version, user, name, type)
10
+ def self.switch_to(path, version, user, full_name, type)
11
11
  begin
12
12
  # Parse Bigkeeper file
13
13
  BigkeeperParser.parse("#{path}/Bigkeeper")
14
14
 
15
15
  version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
16
- full_name = "#{version}_#{user}_#{name}"
17
16
  branch_name = "#{GitflowType.name(type)}/#{full_name}"
18
17
 
19
18
  GitService.new.verify_home_branch(path, branch_name, OperateType::SWITCH)
@@ -0,0 +1,23 @@
1
+ require 'big_keeper/command/module/list'
2
+
3
+ module BigKeeper
4
+
5
+ def self.module_command
6
+
7
+ desc 'Module operation'
8
+ command :module do | mod |
9
+
10
+ mod.desc 'module'
11
+ mod.desc 'Prase module relevant infomation.'
12
+ mod.command :list do | list |
13
+ list.action do |global_options, options, args|
14
+ path = File.expand_path(global_options[:path])
15
+ version = global_options[:ver]
16
+ user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
17
+
18
+ module_list(path, user, options)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ require 'logger'
2
+ require 'json'
3
+
4
+ module BigKeeper
5
+ def self.module_list(path, user, options)
6
+ BigkeeperParser.parse("#{path}/Bigkeeper")
7
+ module_dic = BigkeeperParser.parse_modules
8
+ module_list = Array.new
9
+ module_dic.keys.each do | key |
10
+ dic = Hash["module_name" => key,
11
+ "git" => module_dic[key][:git],
12
+ "pulls" => module_dic[key][:pulls]]
13
+ module_list << dic
14
+ end
15
+ json = JSON.pretty_generate(module_list)
16
+ Logger.default(json)
17
+ end
18
+ end
@@ -10,13 +10,15 @@ module BigKeeper
10
10
  def self.release_home_start(path, version, user)
11
11
  BigkeeperParser.parse("#{path}/Bigkeeper")
12
12
 
13
+ version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
13
14
  modules = BigkeeperParser.module_names
14
15
 
16
+ CacheOperator.new(path).save('Podfile')
17
+
15
18
  #stash
16
19
  StashService.new.stash_all(path, GitOperator.new.current_branch(path), user, modules)
17
20
 
18
21
  # check
19
- GitOperator.new.check_merge(path, "feature/#{version}")
20
22
  GitOperator.new.check_diff(path, "develop", "master")
21
23
 
22
24
  #checkout release branch
@@ -45,22 +47,41 @@ module BigKeeper
45
47
  end
46
48
 
47
49
  def self.release_home_finish(path, version)
50
+ BigkeeperParser.parse("#{path}/Bigkeeper")
51
+ version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
52
+ Logger.highlight("Start finish release home for #{version}")
48
53
  if GitOperator.new.has_branch(path, "release/#{version}")
49
- if GitOperator.new.current_branch(path) == "release/#{version}"
50
- GitOperator.new.commit(path, "release: V #{version}")
51
- GitOperator.new.push_to_remote(path, "release/#{version}")
52
- GitflowOperator.new.finish_release(path, version)
53
- if GitOperator.new.current_branch(path) == "master"
54
- GitOperator.new.tag(path, version)
55
- else
56
- GitOperator.new.checkout(path, "master")
57
- GitOperator.new.tag(path, version)
58
- end
59
- else
60
- raise Logger.error("Not in release branch, please check your branches.")
54
+ if GitOperator.new.current_branch(path) != "release/#{version}"
55
+ GitOperator.new.checkout(path, "release/#{version}")
61
56
  end
57
+
58
+ GitOperator.new.commit(path, "release: V #{version}")
59
+ GitOperator.new.push_to_remote(path, "release/#{version}")
60
+
61
+ # master
62
+ GitOperator.new.checkout(path, "master")
63
+ GitOperator.new.merge(path, "release/#{version}")
64
+ GitOperator.new.push_to_remote(path, "master")
65
+ if GitOperator.new.current_branch(path) != "master"
66
+ GitOperator.new.checkout(path, "master")
67
+ end
68
+ GitOperator.new.tag(path, version)
69
+
70
+ # develop
71
+ GitOperator.new.checkout(path, "release/#{version}")
72
+ CacheOperator.new(path).load('Podfile')
73
+ CacheOperator.new(path).clean()
74
+ GitOperator.new.commit(path, "reset #{verbose} Podfile")
75
+ GitOperator.new.push_to_remote(path, "release/#{version}")
76
+
77
+ GitOperator.new.checkout(path, "develop")
78
+ GitOperator.new.merge(path, "release/#{version}")
79
+ GitOperator.new.push_to_remote(path, "develop")
80
+ GitOperator.new.check_diff(path, "develop", "master")
81
+
82
+ Logger.highlight("Finish release home for #{version}")
62
83
  else
63
- raise Logger.error("Not has release branch, please use release start first.")
84
+ raise Logger.error("Dont have release/#{version} branch, please use release home start first.")
64
85
  end
65
86
  end
66
87
 
@@ -36,6 +36,12 @@ module BigKeeper
36
36
 
37
37
  # check commit
38
38
  Logger.error("current branch has unpush files") if GitOperator.new.has_changes(module_path)
39
+
40
+ #修改 podspec 文件
41
+ # TO DO: - advanced to use Regular Expression
42
+ has_change = PodfileOperator.new.podspec_change(%Q(#{module_path}/#{module_name}.podspec), version, module_name)
43
+ GitService.new.verify_push(module_path, "Change version number", "develop", "#{module_name}") if has_change == true
44
+
39
45
  # check out master
40
46
  Logger.highlight("'#{module_name}' checkout branch to master...")
41
47
  GitService.new.verify_checkout_pull(module_path, "master")
@@ -43,13 +49,9 @@ module BigKeeper
43
49
  Logger.highlight(%Q(Merge develop to master))
44
50
  # merge develop to master
45
51
  GitOperator.new.merge(module_path, "develop")
46
- GitOperator.new.push_to_remote(module_path, "master")
52
+ # GitOperator.new.push_to_remote(module_path, "master")
47
53
 
48
- #修改 podspec 文件
49
- # TO DO: - advanced to use Regular Expression
50
- has_change = PodfileOperator.new.podspec_change(%Q(#{module_path}/#{module_name}.podspec), version, module_name)
51
- GitService.new.verify_push(module_path, "Change version number", "master", "#{module_name}") if has_change == true
52
- GitOperator.new.tag(module_path, version)
54
+ # GitOperator.new.tag(module_path, version)
53
55
  # pod repo push
54
56
  if spec == true
55
57
  PodOperator.pod_repo_push(module_path, module_name, BigkeeperParser.source_spec_path(module_name), version)
@@ -184,8 +184,9 @@ module BigKeeper
184
184
  compare_branch_commits.map { |item|
185
185
  Logger.default(item)
186
186
  }
187
- Logger.error("#{compare_branch} branch has commit dont committed in #{branch}, please check")
188
- return
187
+ Logger.error("#{compare_branch} branch has commit doesn't committed in #{branch}, please check")
188
+ else
189
+ Logger.highlight("#{compare_branch} branch doesn't has commit before #{branch}")
189
190
  end
190
191
  end
191
192
 
@@ -39,7 +39,26 @@ module BigKeeper
39
39
  end
40
40
  end
41
41
  end
42
- branch_dic["home_branche_name"] = home_branch_name
42
+
43
+ branch_dic["is_remote"] = false
44
+ if home_branch_name =~ /^remotes\//
45
+ home_branch_name = $~.post_match
46
+ branch_dic["is_remote"] = true
47
+ end
48
+
49
+ if home_branch_name =~ /^origin\//
50
+ home_branch_name = $~.post_match
51
+ end
52
+
53
+ if home_branch_name =~ /^feature\//
54
+ home_branch_name = $~.post_match
55
+ end
56
+
57
+ if home_branch_name =~ /^hotfix\//
58
+ home_branch_name = $~.post_match
59
+ end
60
+
61
+ branch_dic["home_branch_name"] = home_branch_name
43
62
  branch_dic["involve_modules"] = involve_modules
44
63
  json_array << branch_dic
45
64
  end
@@ -1,3 +1,3 @@
1
1
  module BigKeeper
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigkeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-14 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -235,6 +235,8 @@ files:
235
235
  - lib/big_keeper/command/feature&hotfix/start.rb
236
236
  - lib/big_keeper/command/feature&hotfix/switch.rb
237
237
  - lib/big_keeper/command/feature&hotfix/update.rb
238
+ - lib/big_keeper/command/module.rb
239
+ - lib/big_keeper/command/module/list.rb
238
240
  - lib/big_keeper/command/pod.rb
239
241
  - lib/big_keeper/command/pod/podfile.rb
240
242
  - lib/big_keeper/command/release.rb