bigkeeper 0.9.2 → 0.9.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: 984646f715b01935f0df1fc84d7bbab58ed75b4a
4
- data.tar.gz: 202103da5bdd8813bafae83bb02a8f06102d8a05
3
+ metadata.gz: 47bab02441e1139a0e26323e7dece4f0c9d1dd48
4
+ data.tar.gz: 509045ecb854e6a6e384fd7b5efb8f990daab35b
5
5
  SHA512:
6
- metadata.gz: 0351cf5e60e4cd89e9e6ca803871593de5d74170525eec45226798030c6f30138693cf47449f77ab2f5ff69201ccc1a66f401055563afaf3a470492c9dce3cdd
7
- data.tar.gz: f155c7d12a092fc9016ee9bca4466a3b7a31c33285e309f5adc9ee90bc85161cc41bb286c9d7bc720c62a17b587f8194e40738f5c830251fe175939fa2c472ea
6
+ metadata.gz: a2104b4839d5f0b4ca6147609f5b74ecc772b1ad67281e99346ea5d0422f8cb6f60984c6ad168e9055adbbd7968c3b73ebcadc98e8884a1855fe8ddf5ab6d2f2
7
+ data.tar.gz: be8bb68375888689e666f0d291efaad4e3b7064a547fcc468a9a79194d38072b3fed9376c838a5c109dbe12f0dc911c975bc2066277beca04822a00e595fa18f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bigkeeper (0.9.2)
4
+ bigkeeper (0.9.3)
5
5
  big_resources
6
6
  big_stash (~> 0.1)
7
7
  cocoapods
data/bin/big CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # require "bundler/setup"
3
+ #require "bundler/setup"
4
4
  require "big_keeper"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
@@ -13,7 +13,7 @@ require 'big_keeper/command/release'
13
13
  require 'big_keeper/command/pod'
14
14
  require 'big_keeper/command/spec'
15
15
  require 'big_keeper/command/image'
16
-
16
+ require 'big_keeper/command/init'
17
17
  require 'big_keeper/service/git_service'
18
18
  require 'big_keeper/util/leancloud_logger'
19
19
 
@@ -59,6 +59,8 @@ module BigKeeper
59
59
 
60
60
  image_command
61
61
 
62
+ init_command
63
+
62
64
  desc 'Show version of bigkeeper'
63
65
  command :version do |version|
64
66
  version.action do |global_options, options, args|
@@ -6,7 +6,7 @@ require 'big_keeper/util/pod_operator'
6
6
  require 'big_keeper/util/xcode_operator'
7
7
  require 'big_keeper/util/cache_operator'
8
8
  require 'big_keeper/util/bigkeeper_parser'
9
-
9
+ require 'big_keeper/model/operate_type'
10
10
  require 'big_keeper/dependency/dep_service'
11
11
 
12
12
  require 'big_keeper/dependency/dep_type'
@@ -41,7 +41,7 @@ module BigKeeper
41
41
  ModuleCacheOperator.new(path).cache_path_modules([], [], [])
42
42
 
43
43
  # Install
44
- DepService.dep_operator(path, user).install(false)
44
+ DepService.dep_operator(path, user).install(modules, OperateType::FINISH, false)
45
45
 
46
46
  # Open home workspace
47
47
  DepService.dep_operator(path, user).open
@@ -6,7 +6,7 @@ require 'big_keeper/util/pod_operator'
6
6
  require 'big_keeper/util/xcode_operator'
7
7
  require 'big_keeper/util/cache_operator'
8
8
  require 'big_keeper/util/bigkeeper_parser'
9
-
9
+ require 'big_keeper/model/operate_type'
10
10
  require 'big_keeper/dependency/dep_service'
11
11
 
12
12
  require 'big_keeper/dependency/dep_type'
@@ -32,7 +32,7 @@ module BigKeeper
32
32
  end
33
33
 
34
34
  # Install
35
- DepService.dep_operator(path, user).install(false)
35
+ DepService.dep_operator(path, user).install(modules, OperateType::PUBLISH, false)
36
36
 
37
37
  # Modify module as git
38
38
  modules.each do |module_name|
@@ -7,7 +7,7 @@ require 'big_keeper/util/logger'
7
7
  require 'big_keeper/util/pod_operator'
8
8
  require 'big_keeper/util/xcode_operator'
9
9
  require 'big_keeper/util/cache_operator'
10
-
10
+ require 'big_keeper/model/operate_type'
11
11
  require 'big_keeper/dependency/dep_service'
12
12
 
13
13
  require 'big_keeper/dependency/dep_type'
@@ -56,7 +56,7 @@ module BigKeeper
56
56
  end
57
57
 
58
58
  # install
59
- DepService.dep_operator(path, user).install(true)
59
+ DepService.dep_operator(path, user).install(modules, OperateType::START, true)
60
60
 
61
61
  # Open home workspace
62
62
  DepService.dep_operator(path, user).open
@@ -3,7 +3,7 @@ require 'big_stash/stash_operator'
3
3
  require 'big_keeper/util/logger'
4
4
  require 'big_keeper/util/pod_operator'
5
5
  require 'big_keeper/util/xcode_operator'
6
-
6
+ require 'big_keeper/model/operate_type'
7
7
  require 'big_keeper/dependency/dep_service'
8
8
 
9
9
  module BigKeeper
@@ -36,7 +36,7 @@ module BigKeeper
36
36
  end
37
37
 
38
38
  # Install
39
- DepService.dep_operator(path, user).install(false)
39
+ DepService.dep_operator(path, user).install(modules, OperateType::SWITCH, false)
40
40
 
41
41
  # Open home workspace
42
42
  DepService.dep_operator(path, user).open
@@ -7,7 +7,7 @@ require 'big_keeper/util/logger'
7
7
  require 'big_keeper/util/pod_operator'
8
8
  require 'big_keeper/util/xcode_operator'
9
9
  require 'big_keeper/util/cache_operator'
10
-
10
+ require 'big_keeper/model/operate_type'
11
11
  require 'big_keeper/dependency/dep_service'
12
12
 
13
13
  require 'big_keeper/dependency/dep_type'
@@ -56,7 +56,7 @@ module BigKeeper
56
56
  end
57
57
 
58
58
  # Install
59
- DepService.dep_operator(path, user).install(false)
59
+ DepService.dep_operator(path, user).install(modules, OperateType::UPDATE, false)
60
60
 
61
61
  # Open home workspace
62
62
  DepService.dep_operator(path, user).open
@@ -0,0 +1,36 @@
1
+ require 'big_keeper/util/leancloud_logger'
2
+ require 'big_keeper/util/file_operator'
3
+ require 'fileutils'
4
+ require 'big_keeper/util/logger'
5
+
6
+ module BigKeeper
7
+ def self.init_command
8
+ desc 'BigKeeper file initialize'
9
+ command :init do | c |
10
+ c.desc "BigKeeper template file initialize."
11
+ c.action do | global_options, options, args |
12
+ LeanCloudLogger.instance.set_command("big/init")
13
+
14
+ bin_path = File.dirname(__FILE__)
15
+ bin_path = File.dirname(bin_path)
16
+ bin_path = File.dirname(bin_path)
17
+ bin_path = File.dirname(bin_path)
18
+ path = global_options['path']
19
+ Logger.highlight("Initialize BigKeeper File...")
20
+ #template path
21
+ source_file = File.join(bin_path, 'resources/template/BigKeeper')
22
+ #BigKeeper file need exist path
23
+ target_path = File.join(path, 'BigKeeper')
24
+
25
+ if !File.exists?(target_path)
26
+ FileUtils.cp(source_file, target_path)
27
+ Logger.highlight("Initialize BigKeeper Complete!")
28
+ else
29
+ Logger.highlight("BigKeeper File Has Exist!")
30
+ end
31
+
32
+ LeanCloudLogger.instance.set_command("file/init")
33
+ end
34
+ end
35
+ end
36
+ end
@@ -5,6 +5,7 @@ require 'big_keeper/dependency/dep_type'
5
5
  require 'big_keeper/util/info_plist_operator'
6
6
  require 'big_keeper/util/logger'
7
7
  require 'big_keeper/util/xcode_operator'
8
+ require 'big_keeper/model/operate_type'
8
9
 
9
10
  module BigKeeper
10
11
  def self.release_home_start(path, version, user)
@@ -46,7 +47,7 @@ module BigKeeper
46
47
  InfoPlistOperator.new.change_version_build(path, version)
47
48
 
48
49
  GitService.new.verify_push(path, "Change version to #{version}", "release/#{version}", 'Home')
49
- DepService.dep_operator(path, user).install(true)
50
+ DepService.dep_operator(path, user).install(modules, OperateType::RELEASE, true)
50
51
  XcodeOperator.open_workspace(path)
51
52
  end
52
53
 
@@ -1,11 +1,14 @@
1
1
  require 'big_keeper/dependency/dep_operator'
2
2
  require 'big_keeper/util/gradle_operator'
3
+ require 'big_keeper/model/operate_type'
3
4
 
4
5
  module BigKeeper
5
6
  # Operator for podfile
6
7
  class DepGradleOperator < DepOperator
7
8
 
8
9
  PATH_VERSION_CONFIG = "doc/config/version-config.gradle"
10
+ LOCAL_MODULE_BUILD = "module/module.gradle"
11
+ GLOBAL_MODULE_BUILD = "module/global.gradle"
9
12
 
10
13
  def backup
11
14
  GradleOperator.new(@path).backup
@@ -15,7 +18,12 @@ module BigKeeper
15
18
  GradleOperator.new(@path).recover
16
19
  end
17
20
 
21
+ def update_project_config(modules, type)
22
+ raise "You should override this method in subclass."
23
+ end
24
+
18
25
  def update_module_config(module_name, module_operate_type)
26
+ update_local_depend(module_name, module_operate_type)
19
27
  update_project_version_config(module_name, module_operate_type)
20
28
  module_full_path = BigkeeperParser.module_full_path(@path, @user, module_name)
21
29
  GradleOperator.new(module_full_path).update_version_config(module_name, module_operate_type)
@@ -41,6 +49,29 @@ module BigKeeper
41
49
  end
42
50
  end
43
51
 
52
+ def update_local_depend(module_name, module_operate_type)
53
+ if !File.exist?("#{@path}/#{LOCAL_MODULE_BUILD}")
54
+ FileUtils.cp("#{@path}/#{GLOBAL_MODULE_BUILD}", "#{@path}/#{LOCAL_MODULE_BUILD}")
55
+ end
56
+ temp_file = Tempfile.new('.module.gradle.tmp')
57
+ begin
58
+ File.open("#{@path}/#{LOCAL_MODULE_BUILD}", 'r') do |file|
59
+ file.each_line do |line|
60
+ new_line = generate_local_depend_of_line(
61
+ line,
62
+ module_name,
63
+ module_operate_type)
64
+ temp_file.puts(new_line)
65
+ end
66
+ end
67
+ temp_file.close
68
+ FileUtils.mv(temp_file.path, "#{@path}/#{LOCAL_MODULE_BUILD}")
69
+ ensure
70
+ temp_file.close
71
+ temp_file.unlink
72
+ end
73
+ end
74
+
44
75
  def generate_version_config_of_line(line, module_name, module_operate_type)
45
76
  if line.downcase.match(/([\s\S]*)#{module_name.downcase.gsub('-','')}version(\s*)=(\s*)('|")(\S*)('|")([\s\S]*)/)
46
77
  branch_name = GitOperator.new.current_branch(@path)
@@ -62,6 +93,18 @@ module BigKeeper
62
93
  line
63
94
  end
64
95
 
96
+ def generate_local_depend_of_line(line, module_name, module_operate_type)
97
+ if line.downcase.match(/([\s\S]*):module:#{module_name.downcase.gsub('-','')}([\s\S]*)/)
98
+ if ModuleOperateType::ADD == module_operate_type
99
+ line = line.gsub('//','')
100
+ else
101
+ line = line.gsub('//','')
102
+ line = '//' + line
103
+ end
104
+ end
105
+ line
106
+ end
107
+
65
108
  def origin_config_of_module(module_name)
66
109
  origin_config = ''
67
110
  File.open("#{@path}/.bigkeeper/#{PATH_VERSION_CONFIG}", 'r') do |file|
@@ -75,7 +118,20 @@ module BigKeeper
75
118
  origin_config.chop
76
119
  end
77
120
 
78
- def install(should_update)
121
+ def install(modules, type, should_update)
122
+ if OperateType::SWITCH == type
123
+ all_modules = BigkeeperParser.module_names
124
+
125
+ #close all
126
+ all_modules.each do |module_name|
127
+ update_local_depend(module_name, ModuleOperateType::DELETE)
128
+ end
129
+
130
+ #open modules
131
+ modules.each do |module_name|
132
+ update_local_depend(module_name, ModuleOperateType::ADD)
133
+ end
134
+ end
79
135
  end
80
136
 
81
137
  def open
@@ -21,7 +21,7 @@ module BigKeeper
21
21
  raise "You should override this method in subclass."
22
22
  end
23
23
 
24
- def install(should_update)
24
+ def install(modules, type, should_update)
25
25
  raise "You should override this method in subclass."
26
26
  end
27
27
 
@@ -3,6 +3,9 @@ module BigKeeper
3
3
  START = 1
4
4
  UPDATE = 2
5
5
  SWITCH = 3
6
+ FINISH = 4
7
+ PUBLISH = 5
8
+ RELEASE = 6
6
9
 
7
10
  def self.name(type)
8
11
  if START == type
@@ -1,3 +1,3 @@
1
1
  module BigKeeper
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
@@ -0,0 +1,23 @@
1
+ # TEMPLATE FOR BIGKEEPER
2
+ # PLEASE CHANGE THE CONTENT FOR YOUR PROJECT
3
+ # REMEMBER DELETE THESE TIPS
4
+
5
+ # version '0.0.1'
6
+
7
+ # home 'BigkeeperMain', :git => 'git@github.com:BigKeeper/BigKeeperMain.git', :pulls => 'https://github.com/BigKeeper/BigKeeperMain/pulls'
8
+
9
+ # source 'git@github.com:CocoaPods/Specs.git, CocoaPods' do
10
+ # modules do
11
+ # mod 'BigKeeperUserCenterModule', :git => 'git@github.com:BigKeeper/BigKeeperUserCenterModule.git', :pulls => 'https://github.com/BigKeeper/BigKeeperUserCenterModule/pulls'
12
+ # mod 'BigKeeperOrderModule', :git => 'git@github.com:BigKeeper/BigKeeperOrderModule.git', :pulls => 'https://github.com/BigKeeper/BigKeeperOrderModule/pulls'
13
+ # end
14
+ # end
15
+
16
+
17
+ # user 'perry' do
18
+ # mod 'BigKeeperModular', :path => '../BigKeeperModular'
19
+ # end
20
+
21
+ # user 'tom' do
22
+ # mod 'BigKeeperModular', :path => '../BigKeeperModular'
23
+ # 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.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-04 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -267,6 +267,7 @@ files:
267
267
  - lib/big_keeper/command/feature&hotfix/update.rb
268
268
  - lib/big_keeper/command/image.rb
269
269
  - lib/big_keeper/command/image/image.rb
270
+ - lib/big_keeper/command/init.rb
270
271
  - lib/big_keeper/command/pod.rb
271
272
  - lib/big_keeper/command/pod/podfile.rb
272
273
  - lib/big_keeper/command/release.rb
@@ -317,6 +318,7 @@ files:
317
318
  - resources/keynote/big-keeper-readme-feature.key
318
319
  - resources/keynote/big-keeper-readme-release.key
319
320
  - resources/readme/big-keeper-readme.001.png
321
+ - resources/template/Bigkeeper
320
322
  homepage: https://github.com/BigKeeper/bigkeeper
321
323
  licenses:
322
324
  - MIT