kookeeper 2.0.0 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/big +1 -1
- data/bin/koo +1 -1
- metadata +10 -104
- data/.github/ISSUE_TEMPLATE.md +0 -20
- data/.gitignore +0 -50
- data/.travis.yml +0 -19
- data/CODE_OF_CONDUCT.md +0 -46
- data/CONTRIBUTING.md +0 -70
- data/Gemfile +0 -10
- data/Gemfile.lock +0 -125
- data/LICENSE +0 -21
- data/README.md +0 -113
- data/Rakefile +0 -2
- data/big_keeper.gemspec +0 -50
- data/docs/en-US/FEATURE.md +0 -0
- data/docs/en-US/README.md +0 -54
- data/docs/zh-CN/BIGKEEPER_FILE.md +0 -84
- data/docs/zh-CN/FEATURE&HOTFIX.md +0 -88
- data/docs/zh-CN/IMAGE.md +0 -0
- data/docs/zh-CN/PODFILE.md +0 -43
- data/docs/zh-CN/README.md +0 -113
- data/docs/zh-CN/RECOMMEND.md +0 -22
- data/docs/zh-CN/RELEASE.md +0 -60
- data/docs/zh-CN/SPEC.md +0 -39
- data/lib/big_keeper/command/client.rb +0 -50
- data/lib/big_keeper/command/feature&hotfix/delete.rb +0 -40
- data/lib/big_keeper/command/feature&hotfix/finish.rb +0 -54
- data/lib/big_keeper/command/feature&hotfix/list.rb +0 -63
- data/lib/big_keeper/command/feature&hotfix/publish.rb +0 -56
- data/lib/big_keeper/command/feature&hotfix/pull.rb +0 -26
- data/lib/big_keeper/command/feature&hotfix/push.rb +0 -27
- data/lib/big_keeper/command/feature&hotfix/rebase.rb +0 -32
- data/lib/big_keeper/command/feature&hotfix/start.rb +0 -74
- data/lib/big_keeper/command/feature&hotfix/switch.rb +0 -46
- data/lib/big_keeper/command/feature&hotfix/update.rb +0 -66
- data/lib/big_keeper/command/feature&hotfix.rb +0 -167
- data/lib/big_keeper/command/image/image.rb +0 -0
- data/lib/big_keeper/command/image.rb +0 -28
- data/lib/big_keeper/command/init.rb +0 -36
- data/lib/big_keeper/command/pod/podfile.rb +0 -72
- data/lib/big_keeper/command/pod.rb +0 -55
- data/lib/big_keeper/command/release/finish.rb +0 -36
- data/lib/big_keeper/command/release/home.rb +0 -92
- data/lib/big_keeper/command/release/module.rb +0 -65
- data/lib/big_keeper/command/release/publish.rb +0 -4
- data/lib/big_keeper/command/release/start.rb +0 -78
- data/lib/big_keeper/command/release.rb +0 -100
- data/lib/big_keeper/command/spec/add.rb +0 -9
- data/lib/big_keeper/command/spec/analyze.rb +0 -88
- data/lib/big_keeper/command/spec/delete.rb +0 -9
- data/lib/big_keeper/command/spec/list.rb +0 -19
- data/lib/big_keeper/command/spec/search.rb +0 -9
- data/lib/big_keeper/command/spec/sync.rb +0 -12
- data/lib/big_keeper/command/spec.rb +0 -78
- data/lib/big_keeper/dependency/dep_gradle_operator.rb +0 -74
- data/lib/big_keeper/dependency/dep_operator.rb +0 -48
- data/lib/big_keeper/dependency/dep_pod_operator.rb +0 -130
- data/lib/big_keeper/dependency/dep_service.rb +0 -14
- data/lib/big_keeper/dependency/dep_type.rb +0 -33
- data/lib/big_keeper/model/gitflow_type.rb +0 -43
- data/lib/big_keeper/model/library_model.rb +0 -116
- data/lib/big_keeper/model/operate_type.rb +0 -30
- data/lib/big_keeper/model/podfile_model.rb +0 -33
- data/lib/big_keeper/service/git_service.rb +0 -211
- data/lib/big_keeper/service/module_service.rb +0 -224
- data/lib/big_keeper/service/stash_service.rb +0 -45
- data/lib/big_keeper/util/bigkeeper_parser.rb +0 -260
- data/lib/big_keeper/util/cache_operator.rb +0 -118
- data/lib/big_keeper/util/code_operator.rb +0 -37
- data/lib/big_keeper/util/command_line_util.rb +0 -9
- data/lib/big_keeper/util/file_operator.rb +0 -33
- data/lib/big_keeper/util/git_operator.rb +0 -242
- data/lib/big_keeper/util/gitflow_operator.rb +0 -51
- data/lib/big_keeper/util/gradle_content_generator.rb +0 -26
- data/lib/big_keeper/util/gradle_file_operator.rb +0 -339
- data/lib/big_keeper/util/gradle_module_operator.rb +0 -70
- data/lib/big_keeper/util/info_plist_operator.rb +0 -46
- data/lib/big_keeper/util/leancloud_logger.rb +0 -84
- data/lib/big_keeper/util/list_generator.rb +0 -101
- data/lib/big_keeper/util/lockfile_parser.rb +0 -143
- data/lib/big_keeper/util/logger.rb +0 -47
- data/lib/big_keeper/util/pod_operator.rb +0 -70
- data/lib/big_keeper/util/podfile_detector.rb +0 -102
- data/lib/big_keeper/util/podfile_module.rb +0 -63
- data/lib/big_keeper/util/podfile_operator.rb +0 -125
- data/lib/big_keeper/util/verify_operator.rb +0 -17
- data/lib/big_keeper/util/version_config_operator.rb +0 -29
- data/lib/big_keeper/util/xcode_operator.rb +0 -15
- data/lib/big_keeper/version.rb +0 -3
- data/lib/big_keeper.rb +0 -81
- 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
- data/resources/template/Bigkeeper +0 -23
@@ -1,36 +0,0 @@
|
|
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
|
@@ -1,72 +0,0 @@
|
|
1
|
-
require 'big_keeper/util/podfile_detector'
|
2
|
-
require 'big_keeper/util/podfile_operator'
|
3
|
-
require 'big_keeper/util/podfile_module'
|
4
|
-
require 'big_keeper/util/gitflow_operator'
|
5
|
-
require 'big_keeper/util/bigkeeper_parser'
|
6
|
-
require 'big_keeper/dependency/dep_type'
|
7
|
-
require 'big_keeper/util/logger'
|
8
|
-
require 'big_keeper/util/lockfile_parser'
|
9
|
-
|
10
|
-
module BigKeeper
|
11
|
-
|
12
|
-
def self.podfile_detect(path)
|
13
|
-
# Parse Bigkeeper file
|
14
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
15
|
-
# Get modules' name
|
16
|
-
# module_list = BigkeeperParser.module_names
|
17
|
-
# initialize PodfileDetector
|
18
|
-
detector = PodfileParser.instance
|
19
|
-
detactor.parse
|
20
|
-
# Get unlocked third party pods list
|
21
|
-
unlock_pod_list = detector.get_unlock_pod_list
|
22
|
-
# Print out unlock pod list
|
23
|
-
unlock_pod_list.each do |pod_name|
|
24
|
-
Logger.default("#{pod_name} should be locked.")
|
25
|
-
end
|
26
|
-
Logger.separator
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.podfile_lock(path, is_all)
|
31
|
-
# Parse Bigkeeper file
|
32
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
33
|
-
# initialize PodfileDetector
|
34
|
-
pod_parser = PodfileParser.instance
|
35
|
-
#Parser Podfile.lock
|
36
|
-
pod_parser.parse(path)
|
37
|
-
#initialize LockfileParser
|
38
|
-
lock_parser = LockfileParser.instance
|
39
|
-
#Parser Podfile.lock
|
40
|
-
lock_parser.parse(path)
|
41
|
-
# Get unlocked third party pods list
|
42
|
-
unlock_pod_info = lock_parser.get_unlock_pod_list(is_all)
|
43
|
-
# Lock modules in podfile
|
44
|
-
if unlock_pod_info.empty?
|
45
|
-
Logger.warning("There is nothing to be locked.")
|
46
|
-
else
|
47
|
-
PodfileOperator.new.find_and_lock("#{path}/Podfile", unlock_pod_info)
|
48
|
-
Logger.highlight("The Podfile has been changed.")
|
49
|
-
Logger.separator
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.podfile_modules_update(path)
|
55
|
-
# Parse Bigkeeper file
|
56
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
57
|
-
# Get modules' name
|
58
|
-
module_list = BigkeeperParser.module_names
|
59
|
-
# initialize PodfileDetector
|
60
|
-
detector = PodfileModuleDetector.new(path)
|
61
|
-
# Get module latest version
|
62
|
-
module_dictionary = detector.check_version_list
|
63
|
-
# Check if anything should be upgrade
|
64
|
-
if module_dictionary.empty?
|
65
|
-
Logger.warning("There is nothing to be upgrade.")
|
66
|
-
else
|
67
|
-
PodfileOperator.new.find_and_upgrade("#{path}/Podfile", module_dictionary)
|
68
|
-
Logger.highlight("The Podfile has been changed.")
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'big_keeper/command/pod/podfile'
|
2
|
-
require 'big_keeper/util/leancloud_logger'
|
3
|
-
|
4
|
-
module BigKeeper
|
5
|
-
|
6
|
-
def self.pod_command
|
7
|
-
desc 'Podfile operation'
|
8
|
-
command :podfile do |podfile|
|
9
|
-
podfile.desc 'Podfile'
|
10
|
-
|
11
|
-
podfile.desc 'Detect podname should be locked.'
|
12
|
-
podfile.command :detect do |detect|
|
13
|
-
detect.action do |global_options, options, args|
|
14
|
-
LeanCloudLogger.instance.set_command("podfile/detect")
|
15
|
-
|
16
|
-
path = File.expand_path(global_options[:path])
|
17
|
-
podfile_detect(path)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
podfile.desc 'Lock podname should be locked.'
|
22
|
-
podfile.command :lock do |lock|
|
23
|
-
lock.desc 'Lock pods accouding to Podfile.'
|
24
|
-
lock.command :module do |m|
|
25
|
-
m.action do |global_options, options, args|
|
26
|
-
LeanCloudLogger.instance.set_command("podfile/lock/module")
|
27
|
-
|
28
|
-
path = File.expand_path(global_options[:path])
|
29
|
-
podfile_lock(path, false)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
lock.desc 'Lock pods accouding to Podfile.lock.'
|
33
|
-
lock.command :submodule do |s|
|
34
|
-
s.action do |global_options, options, args|
|
35
|
-
LeanCloudLogger.instance.set_command("podfile/lock/submodule")
|
36
|
-
|
37
|
-
path = File.expand_path(global_options[:path])
|
38
|
-
podfile_lock(path, true)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
podfile.desc 'Update modules should be upgrade.'
|
45
|
-
podfile.command :update do |update|
|
46
|
-
update.action do |global_options, options, args|
|
47
|
-
LeanCloudLogger.instance.set_command("podfile/update")
|
48
|
-
|
49
|
-
path = File.expand_path(global_options[:path])
|
50
|
-
podfile_modules_update(path)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module BigKeeper
|
2
|
-
def self.release_finish(path, version, user, modules)
|
3
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
4
|
-
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
5
|
-
modules = release_check_changed_modules(path, user) if (modules.nil? || modules.empty?)
|
6
|
-
|
7
|
-
if modules.nil? || modules.empty?
|
8
|
-
Logger.error('no module need to release')
|
9
|
-
end
|
10
|
-
if !CommandLineUtil.double_check("module #{modules} will changed version to #{version}, are you sure?")
|
11
|
-
Logger.error('release finish interrupt')
|
12
|
-
end
|
13
|
-
#stash home
|
14
|
-
StashService.new.stash(path, GitOperator.new.current_branch(path), 'home')
|
15
|
-
# delete cache
|
16
|
-
CacheOperator.new(path).clean()
|
17
|
-
# checkout develop
|
18
|
-
GitService.new.verify_checkout_pull(path, 'develop')
|
19
|
-
|
20
|
-
modules.each do |module_name|
|
21
|
-
Logger.highlight("release start module #{module_name}")
|
22
|
-
ModuleService.new.release_finish(path, user, modules, module_name, version)
|
23
|
-
end
|
24
|
-
|
25
|
-
#release home
|
26
|
-
DepService.dep_operator(path, user).release_home_finish(modules, version)
|
27
|
-
|
28
|
-
# Push home changes to remote
|
29
|
-
Logger.highlight("Push branch 'develop' for 'Home'...")
|
30
|
-
GitService.new.verify_push(
|
31
|
-
path,
|
32
|
-
"release finish for #{version}",
|
33
|
-
'develop',
|
34
|
-
'Home')
|
35
|
-
end
|
36
|
-
end
|
@@ -1,92 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
require 'big_keeper/util/podfile_operator'
|
3
|
-
require 'big_keeper/util/gitflow_operator'
|
4
|
-
require 'big_keeper/dependency/dep_type'
|
5
|
-
require 'big_keeper/util/info_plist_operator'
|
6
|
-
require 'big_keeper/util/logger'
|
7
|
-
require 'big_keeper/util/xcode_operator'
|
8
|
-
require 'big_keeper/model/operate_type'
|
9
|
-
|
10
|
-
module BigKeeper
|
11
|
-
def self.release_home_start(path, version, user)
|
12
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
13
|
-
|
14
|
-
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
15
|
-
modules = BigkeeperParser.module_names
|
16
|
-
|
17
|
-
#stash
|
18
|
-
StashService.new.stash_all(path, GitOperator.new.current_branch(path), user, modules)
|
19
|
-
|
20
|
-
# delete cache
|
21
|
-
CacheOperator.new(path).clean()
|
22
|
-
# cache Podfile
|
23
|
-
CacheOperator.new(path).save('Podfile')
|
24
|
-
|
25
|
-
# check
|
26
|
-
GitOperator.new.check_diff(path, "develop", "master")
|
27
|
-
|
28
|
-
#checkout release branch
|
29
|
-
Logger.highlight(%Q(Start to checkout Branch release/#{version}))
|
30
|
-
if GitOperator.new.current_branch(path) != "release/#{version}"
|
31
|
-
if GitOperator.new.has_branch(path, "release/#{version}")
|
32
|
-
GitOperator.new.checkout(path, "release/#{version}")
|
33
|
-
else
|
34
|
-
GitflowOperator.new.start(path, version, GitflowType::RELEASE)
|
35
|
-
GitOperator.new.push_to_remote(path, "release/#{version}")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
Logger.highlight(%Q(Start to release/#{version}))
|
40
|
-
# step 2 replace_modules
|
41
|
-
PodfileOperator.new.replace_all_module_release(path,
|
42
|
-
user,
|
43
|
-
modules,
|
44
|
-
ModuleOperateType::RELEASE)
|
45
|
-
|
46
|
-
# step 3 change Info.plist value
|
47
|
-
InfoPlistOperator.new.change_version_build(path, version)
|
48
|
-
|
49
|
-
GitService.new.verify_push(path, "Change version to #{version}", "release/#{version}", 'Home')
|
50
|
-
DepService.dep_operator(path, user).install(modules, OperateType::RELEASE, true)
|
51
|
-
XcodeOperator.open_workspace(path)
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.release_home_finish(path, version)
|
55
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
56
|
-
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
57
|
-
Logger.highlight("Start finish release home for #{version}")
|
58
|
-
|
59
|
-
if GitOperator.new.has_branch(path, "release/#{version}")
|
60
|
-
if GitOperator.new.current_branch(path) != "release/#{version}"
|
61
|
-
GitOperator.new.checkout(path, "release/#{version}")
|
62
|
-
end
|
63
|
-
|
64
|
-
GitService.new.verify_push(path, "finish release branch", "release/#{version}", 'Home')
|
65
|
-
|
66
|
-
# master
|
67
|
-
GitOperator.new.checkout(path, "master")
|
68
|
-
GitOperator.new.merge(path, "release/#{version}")
|
69
|
-
GitService.new.verify_push(path, "release V#{version}", "master", 'Home')
|
70
|
-
|
71
|
-
GitOperator.new.tag(path, version)
|
72
|
-
|
73
|
-
# release branch
|
74
|
-
GitOperator.new.checkout(path, "release/#{version}")
|
75
|
-
CacheOperator.new(path).load('Podfile')
|
76
|
-
CacheOperator.new(path).clean()
|
77
|
-
GitOperator.new.commit(path, "reset #{version} Podfile")
|
78
|
-
GitService.new.verify_push(path, "reset #{version} Podfile", "release/#{version}", 'Home')
|
79
|
-
|
80
|
-
# develop
|
81
|
-
GitOperator.new.checkout(path, "develop")
|
82
|
-
GitOperator.new.merge(path, "release/#{version}")
|
83
|
-
GitService.new.verify_push(path, "merge release/#{version} to develop", "develop", 'Home')
|
84
|
-
GitOperator.new.check_diff(path, "develop", "master")
|
85
|
-
|
86
|
-
Logger.highlight("Finish release home for #{version}")
|
87
|
-
else
|
88
|
-
raise Logger.error("There is no release/#{version} branch, please use release home start first.")
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
require 'big_keeper/util/podfile_operator'
|
3
|
-
require 'big_keeper/util/gitflow_operator'
|
4
|
-
require 'big_keeper/dependency/dep_type'
|
5
|
-
require 'big_keeper/util/info_plist_operator'
|
6
|
-
require 'big_keeper/util/git_operator'
|
7
|
-
require 'big_keeper/util/logger'
|
8
|
-
require 'big_keeper/util/pod_operator'
|
9
|
-
|
10
|
-
module BigKeeper
|
11
|
-
def self.release_module_start(path, version, user, module_name, ignore)
|
12
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
13
|
-
|
14
|
-
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
15
|
-
module_path = BigkeeperParser.module_full_path(path, user, module_name)
|
16
|
-
|
17
|
-
# stash
|
18
|
-
StashService.new.stash(module_path, GitOperator.new.current_branch(module_path), module_name)
|
19
|
-
|
20
|
-
#check
|
21
|
-
if ignore != true
|
22
|
-
GitOperator.new.check_merge(module_path, "feature/#{version}")
|
23
|
-
GitOperator.new.check_diff(module_path, "develop", "master")
|
24
|
-
Logger.highlight(%Q(#{module_name} release check finish))
|
25
|
-
end
|
26
|
-
|
27
|
-
# checkout to develop branch
|
28
|
-
Logger.highlight(%Q(Start checkout #{module_name} to Branch develop))
|
29
|
-
GitService.new.verify_checkout_pull(module_path, "develop")
|
30
|
-
|
31
|
-
Logger.highlight(%Q(#{module_name} release start finish))
|
32
|
-
end
|
33
|
-
|
34
|
-
## release finish
|
35
|
-
def self.release_module_finish(path, version, user, module_name, spec)
|
36
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
37
|
-
|
38
|
-
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
39
|
-
module_path = BigkeeperParser.module_full_path(path, user, module_name)
|
40
|
-
|
41
|
-
# check commit
|
42
|
-
Logger.error("current branch has unpush files") if GitOperator.new.has_changes(module_path)
|
43
|
-
|
44
|
-
#修改 podspec 文件
|
45
|
-
# TO DO: - advanced to use Regular Expression
|
46
|
-
has_change = PodfileOperator.new.podspec_change(%Q(#{module_path}/#{module_name}.podspec), version, module_name)
|
47
|
-
GitService.new.verify_push(module_path, "Change version number", "develop", "#{module_name}") if has_change == true
|
48
|
-
|
49
|
-
# check out master
|
50
|
-
Logger.highlight("'#{module_name}' checkout branch to master...")
|
51
|
-
GitService.new.verify_checkout_pull(module_path, "master")
|
52
|
-
|
53
|
-
Logger.highlight(%Q(Merge develop to master))
|
54
|
-
# merge develop to master
|
55
|
-
GitOperator.new.merge(module_path, "develop")
|
56
|
-
GitOperator.new.push_to_remote(module_path, "master")
|
57
|
-
|
58
|
-
GitOperator.new.tag(module_path, version)
|
59
|
-
# pod repo push
|
60
|
-
if spec == true
|
61
|
-
PodOperator.pod_repo_push(module_path, module_name, BigkeeperParser.source_spec_path(module_name), version)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
module BigKeeper
|
2
|
-
def self.release_start(path, version, user, modules)
|
3
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
4
|
-
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
5
|
-
modules = release_check_changed_modules(path, user) if (modules.nil? || modules.empty?)
|
6
|
-
|
7
|
-
if modules.nil? || modules.empty?
|
8
|
-
Logger.error('no module need to release')
|
9
|
-
end
|
10
|
-
|
11
|
-
if !CommandLineUtil.double_check("module #{modules} will changed version to #{version}-SNAPSHOT, are you sure?")
|
12
|
-
Logger.error('release start interrupt')
|
13
|
-
end
|
14
|
-
|
15
|
-
#stash home
|
16
|
-
StashService.new.stash(path, GitOperator.new.current_branch(path), 'home')
|
17
|
-
# delete cache
|
18
|
-
CacheOperator.new(path).clean()
|
19
|
-
# checkout develop
|
20
|
-
GitService.new.verify_checkout_pull(path, 'develop')
|
21
|
-
|
22
|
-
modules.each do |module_name|
|
23
|
-
Logger.highlight("release start module #{module_name}")
|
24
|
-
ModuleService.new.release_start(path, user, modules, module_name, version)
|
25
|
-
end
|
26
|
-
|
27
|
-
#release home
|
28
|
-
DepService.dep_operator(path, user).release_home_start(modules, version)
|
29
|
-
|
30
|
-
# Push home changes to remote
|
31
|
-
Logger.highlight("Push branch 'develop' for 'Home'...")
|
32
|
-
GitService.new.verify_push(
|
33
|
-
path,
|
34
|
-
"release start for #{version}",
|
35
|
-
'develop',
|
36
|
-
'Home')
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.release_finish(path, version, user, modules)
|
40
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
41
|
-
version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
|
42
|
-
|
43
|
-
#stash home
|
44
|
-
StashService.new.stash(path, GitOperator.new.current_branch(path), 'home')
|
45
|
-
# delete cache
|
46
|
-
CacheOperator.new(path).clean()
|
47
|
-
# checkout develop
|
48
|
-
GitService.new.verify_checkout_pull(path, 'develop')
|
49
|
-
|
50
|
-
modules.each do |module_name|
|
51
|
-
Logger.highlight("release start module #{module_name}")
|
52
|
-
ModuleService.new.release_finish(path, user, modules, module_name, version)
|
53
|
-
end
|
54
|
-
|
55
|
-
#release home
|
56
|
-
DepService.dep_operator(path, user).release_home_finish(modules, version)
|
57
|
-
|
58
|
-
# Push home changes to remote
|
59
|
-
Logger.highlight("Push branch 'develop' for 'Home'...")
|
60
|
-
GitService.new.verify_push(
|
61
|
-
path,
|
62
|
-
"release finish for #{version}",
|
63
|
-
'develop',
|
64
|
-
'Home')
|
65
|
-
end
|
66
|
-
|
67
|
-
def self.release_check_changed_modules(path, user)
|
68
|
-
changed_modules = []
|
69
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
70
|
-
allModules = BigkeeperParser.module_names
|
71
|
-
allModules.each do |module_name|
|
72
|
-
if ModuleService.new.release_check_changed(path, user, module_name)
|
73
|
-
changed_modules << module_name
|
74
|
-
end
|
75
|
-
end
|
76
|
-
changed_modules
|
77
|
-
end
|
78
|
-
end
|
@@ -1,100 +0,0 @@
|
|
1
|
-
require 'big_keeper/command/release/home'
|
2
|
-
require 'big_keeper/command/release/module'
|
3
|
-
require 'big_keeper/util/leancloud_logger'
|
4
|
-
require 'big_keeper/command/release/start'
|
5
|
-
require 'big_keeper/command/release/finish'
|
6
|
-
require 'big_keeper/util/command_line_util'
|
7
|
-
|
8
|
-
module BigKeeper
|
9
|
-
def self.release_command
|
10
|
-
desc 'Gitflow release operations'
|
11
|
-
command :release do |c|
|
12
|
-
|
13
|
-
c.desc 'release project start'
|
14
|
-
c.command :start do |start|
|
15
|
-
start.action do |global_options, options, args|
|
16
|
-
path = File.expand_path(global_options[:path])
|
17
|
-
version = global_options[:ver]
|
18
|
-
user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
|
19
|
-
modules = args[(0...args.length)] if args.length > 0
|
20
|
-
release_start(path, version, user, modules)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
c.desc 'release project finish'
|
25
|
-
c.command :finish do |finish|
|
26
|
-
finish.action do |global_options, options, args|
|
27
|
-
path = File.expand_path(global_options[:path])
|
28
|
-
version = global_options[:ver]
|
29
|
-
user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
|
30
|
-
modules = args[(0...args.length)] if args.length > 0
|
31
|
-
release_finish(path, version, user, modules)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
c.desc 'Release home project operations'
|
36
|
-
c.command :home do |home|
|
37
|
-
home.desc 'Start release home project'
|
38
|
-
home.command :start do |start|
|
39
|
-
start.action do |global_options, options, args|
|
40
|
-
path = File.expand_path(global_options[:path])
|
41
|
-
version = global_options[:ver]
|
42
|
-
user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
|
43
|
-
LeanCloudLogger.instance.set_command("release/home/start")
|
44
|
-
|
45
|
-
help_now!('user name is required') if user and user.empty?
|
46
|
-
raise Logger.error("release version is required") if version == nil
|
47
|
-
release_home_start(path, version, user)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
home.desc 'Finish release home project'
|
52
|
-
home.command :finish do |finish|
|
53
|
-
finish.action do |global_options, options, args|
|
54
|
-
path = File.expand_path(global_options[:path])
|
55
|
-
version = global_options[:ver]
|
56
|
-
LeanCloudLogger.instance.set_command("release/home/finish")
|
57
|
-
|
58
|
-
raise Logger.error("release version is required") if version == nil
|
59
|
-
release_home_finish(path, version)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
c.desc 'release module'
|
65
|
-
c.switch [:i,:ignore]
|
66
|
-
c.command :module do |m|
|
67
|
-
m.desc 'Start release module project'
|
68
|
-
m.command :start do |start|
|
69
|
-
start.action do |global_options, options, args|
|
70
|
-
path = File.expand_path(global_options[:path])
|
71
|
-
version = global_options[:ver]
|
72
|
-
user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
|
73
|
-
LeanCloudLogger.instance.set_command("release/module/start")
|
74
|
-
|
75
|
-
help_now!('module name is required') if args.length != 1
|
76
|
-
raise Logger.error("release version is required") if version == nil
|
77
|
-
module_name = args[0]
|
78
|
-
release_module_start(path, version, user, module_name, options[:ignore])
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
m.desc 'finish release module project'
|
83
|
-
m.switch [:s,:spec]
|
84
|
-
m.command :finish do |finish|
|
85
|
-
finish.action do |global_options, options, args|
|
86
|
-
path = File.expand_path(global_options[:path])
|
87
|
-
version = global_options[:ver]
|
88
|
-
user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
|
89
|
-
LeanCloudLogger.instance.set_command("release/module/finish")
|
90
|
-
|
91
|
-
help_now!('module name is required') if args.length != 1
|
92
|
-
raise Logger.error("release version is required") if version == nil
|
93
|
-
module_name = args[0]
|
94
|
-
release_module_finish(path, version, user, module_name, options[:spec])
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
require 'big_keeper/util/bigkeeper_parser'
|
2
|
-
require 'big_keeper/dependency/dep_type'
|
3
|
-
require 'big_keeper/util/logger'
|
4
|
-
require 'big_keeper/model/library_model'
|
5
|
-
|
6
|
-
module BigKeeper
|
7
|
-
def self.spec_analyze(path,is_all,find_module_names)
|
8
|
-
# Parse Bigkeeper file
|
9
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
10
|
-
|
11
|
-
is_default = !is_all&&find_module_names.size==0
|
12
|
-
if is_all && find_module_names.size>0
|
13
|
-
Logger.error("parameter conflict: [--all] | [module_names]")
|
14
|
-
return
|
15
|
-
end
|
16
|
-
Logger.highlight('Start spec analyze...')
|
17
|
-
Logger.default(Time.now.to_s)
|
18
|
-
|
19
|
-
# Parse Bigkeeper file
|
20
|
-
# BigkeeperParser.parse("#{path}/Bigkeeper")
|
21
|
-
# module_names = BigkeeperParser.module_names
|
22
|
-
|
23
|
-
# find modules
|
24
|
-
Logger.highlight('Get all modules...')
|
25
|
-
module_names = []
|
26
|
-
pod_path = path+"/Pods/"
|
27
|
-
dir = Dir.open(pod_path)
|
28
|
-
dir.each do |dir_name|
|
29
|
-
if !dir_name.include?(".") && dir_name != "Headers" && dir_name != "Local Podspecs" && dir_name != "Target Support Files"
|
30
|
-
module_names[module_names.size]=dir_name
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
for input_moudle_name in find_module_names do
|
35
|
-
if !module_names.include?(input_moudle_name)
|
36
|
-
Logger.error("["+input_moudle_name+"] not exist.")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# setup modules
|
41
|
-
module_list = []
|
42
|
-
module_keyword_map = Hash.new
|
43
|
-
file_count = 0
|
44
|
-
for module_name in module_names do
|
45
|
-
library = LibraryModel.new(module_name)
|
46
|
-
library.get_all_public_file(path)
|
47
|
-
module_list[module_list.size]=library
|
48
|
-
module_keyword_map[module_name]=library.keyword_list
|
49
|
-
if is_all || find_module_names.include?(library.name)
|
50
|
-
file_count = file_count + library.file_list.size
|
51
|
-
end
|
52
|
-
end
|
53
|
-
# analyze modules spec
|
54
|
-
|
55
|
-
Logger.highlight('Analyze modules...')
|
56
|
-
Logger.default(Time.now.to_s)
|
57
|
-
file_index = 0
|
58
|
-
for library in module_list do
|
59
|
-
if is_all || find_module_names.include?(library.name)
|
60
|
-
Logger.default('Analyzing ' + library.name)
|
61
|
-
file_index = file_index + library.file_list.size
|
62
|
-
library.spec_dependece_library(module_keyword_map.clone)#(Hash.new(module_keyword_map)).to_hash)
|
63
|
-
progress = (file_index*100.0)/file_count
|
64
|
-
progress = format("%.02f", progress).to_f
|
65
|
-
Logger.default('progress >>>> ' + String(progress) + '% [' + library.name + ' done] ')
|
66
|
-
end
|
67
|
-
end
|
68
|
-
Logger.highlight('Analyze complete.')
|
69
|
-
Logger.default(Time.now.to_s)
|
70
|
-
|
71
|
-
# log spec info
|
72
|
-
for library in module_list do
|
73
|
-
if is_all || find_module_names.include?(library.name)
|
74
|
-
Logger.highlight("\n-"+library.name+":")
|
75
|
-
for spec_library in library.spec_library do
|
76
|
-
puts " -"+spec_library
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
# save cache to file
|
82
|
-
if is_all
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'logger'
|
2
|
-
require 'json'
|
3
|
-
|
4
|
-
module BigKeeper
|
5
|
-
def self.spec_list(path, user, options)
|
6
|
-
BigkeeperParser.parse("#{path}/Bigkeeper")
|
7
|
-
|
8
|
-
module_dic = BigkeeperParser.parse_modules
|
9
|
-
module_list = Array.new
|
10
|
-
module_dic.keys.each do | key |
|
11
|
-
dic = Hash["module_name" => key,
|
12
|
-
"git" => module_dic[key][:git],
|
13
|
-
"pulls" => module_dic[key][:pulls]]
|
14
|
-
module_list << dic
|
15
|
-
end
|
16
|
-
json = JSON.pretty_generate(module_list)
|
17
|
-
puts json
|
18
|
-
end
|
19
|
-
end
|