kookeeper 3.0.0 → 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/Gemfile.lock +68 -48
- data/big_keeper.gemspec +3 -3
- data/bin/big +1 -1
- data/bin/koo +1 -1
- data/lib/big_keeper/command/feature&hotfix/delete.rb +1 -1
- data/lib/big_keeper/command/feature&hotfix/finish.rb +2 -2
- data/lib/big_keeper/command/feature&hotfix/list.rb +1 -1
- data/lib/big_keeper/command/feature&hotfix/publish.rb +2 -2
- data/lib/big_keeper/command/feature&hotfix/start.rb +2 -2
- data/lib/big_keeper/command/feature&hotfix/switch.rb +2 -2
- data/lib/big_keeper/command/feature&hotfix/update.rb +2 -2
- data/lib/big_keeper/command/pod/podfile.rb +13 -16
- data/lib/big_keeper/command/pod.rb +5 -18
- data/lib/big_keeper/command/release/home.rb +1 -2
- data/lib/big_keeper/command/release/module.rb +0 -4
- data/lib/big_keeper/command/release.rb +0 -25
- data/lib/big_keeper/dependency/dep_gradle_operator.rb +29 -47
- data/lib/big_keeper/dependency/dep_operator.rb +1 -17
- data/lib/big_keeper/dependency/dep_pod_operator.rb +10 -10
- data/lib/big_keeper/model/operate_type.rb +0 -3
- data/lib/big_keeper/service/git_service.rb +2 -3
- data/lib/big_keeper/service/module_service.rb +0 -65
- data/lib/big_keeper/util/bigkeeper_parser.rb +1 -17
- data/lib/big_keeper/util/cache_operator.rb +4 -6
- data/lib/big_keeper/util/file_operator.rb +1 -1
- data/lib/big_keeper/util/git_operator.rb +4 -25
- data/lib/big_keeper/util/gradle_operator.rb +209 -0
- data/lib/big_keeper/util/leancloud_logger.rb +7 -19
- data/lib/big_keeper/util/list_generator.rb +2 -2
- data/lib/big_keeper/util/logger.rb +1 -2
- data/lib/big_keeper/util/podfile_detector.rb +44 -35
- data/lib/big_keeper/util/podfile_module.rb +1 -1
- data/lib/big_keeper/util/podfile_operator.rb +8 -16
- data/lib/big_keeper/version.rb +1 -1
- data/lib/big_keeper.rb +9 -19
- metadata +14 -25
- data/.github/ISSUE_TEMPLATE.md +0 -20
- data/.gitignore +0 -50
- data/.travis.yml +0 -19
- data/Rakefile +0 -2
- data/lib/big_keeper/command/client.rb +0 -50
- data/lib/big_keeper/command/init.rb +0 -36
- data/lib/big_keeper/command/release/finish.rb +0 -36
- data/lib/big_keeper/command/release/publish.rb +0 -4
- data/lib/big_keeper/command/release/start.rb +0 -78
- data/lib/big_keeper/util/command_line_util.rb +0 -9
- 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/lockfile_parser.rb +0 -143
- data/lib/big_keeper/util/version_config_operator.rb +0 -29
- data/resources/template/Bigkeeper +0 -23
@@ -1,143 +0,0 @@
|
|
1
|
-
require 'big_keeper/util/bigkeeper_parser'
|
2
|
-
require 'big_keeper/util/logger'
|
3
|
-
require 'big_keeper/util/podfile_detector'
|
4
|
-
require 'Singleton'
|
5
|
-
|
6
|
-
module BigKeeper
|
7
|
-
class LockfileParser
|
8
|
-
include Singleton
|
9
|
-
attr_accessor :main_path, :dependencies, :pods, :podfile_hash
|
10
|
-
$mode = 'PODS'
|
11
|
-
|
12
|
-
def initialize
|
13
|
-
self.pods = {}
|
14
|
-
self.dependencies = []
|
15
|
-
end
|
16
|
-
|
17
|
-
def parse(main_path)
|
18
|
-
self.main_path = main_path
|
19
|
-
$mode = 'PODS'
|
20
|
-
podfile_lock_lines = File.readlines("#{main_path}/Podfile.lock", :encoding => 'UTF-8')
|
21
|
-
Logger.highlight("Analyzing Podfile.lock...")
|
22
|
-
podfile_lock_lines.each do |sentence|
|
23
|
-
if sentence.include?('PODS')
|
24
|
-
$mode = 'PODS'
|
25
|
-
elsif sentence.include?('DEPENDENCIES')
|
26
|
-
$mode = 'DEPENDENCIES'
|
27
|
-
elsif sentence.include?('SPEC REPOS')
|
28
|
-
$mode = 'SPEC REPOS'
|
29
|
-
elsif sentence.include?('SPEC CHECKSUMS')
|
30
|
-
$mode = 'SPEC CHECKSUMS'
|
31
|
-
elsif sentence.include?('CHECKOUT OPTIONS')
|
32
|
-
$mode = 'CHECKOUT OPTIONS'
|
33
|
-
elsif sentence.include?('EXTERNAL SOURCES')
|
34
|
-
$mode = 'EXTERNAL SOURCES'
|
35
|
-
elsif sentence.include?('PODFILE CHECKSUM')
|
36
|
-
$mode = 'PODFILE CHECKSUM'
|
37
|
-
else
|
38
|
-
if $mode == 'PODS'
|
39
|
-
deal_pod(sentence.strip.delete('\n'))
|
40
|
-
end
|
41
|
-
if $mode == 'SPEC CHECKSUMS'
|
42
|
-
deal_spec(sentence.strip.delete('\n'))
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def get_unlock_pod_list(is_all)
|
49
|
-
result = {}
|
50
|
-
pod_parser = PodfileParser.instance
|
51
|
-
#podfile 中 unlock pods
|
52
|
-
unlock_pods = pod_parser.get_unlock_pod_list
|
53
|
-
# @unlock_pod_list << pod_name unless @module_list.include pod_name
|
54
|
-
if is_all
|
55
|
-
self.dependencies.each do |pod_name|
|
56
|
-
if pod_parser.pod_list.include?(pod_name)
|
57
|
-
next
|
58
|
-
end
|
59
|
-
if self.pods[pod_name] != nil
|
60
|
-
result[pod_name] = self.pods[pod_name]
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
unlock_pods.each do |pod_name|
|
65
|
-
if self.pods[pod_name] != nil
|
66
|
-
result[pod_name] = self.pods[pod_name]
|
67
|
-
end
|
68
|
-
end
|
69
|
-
return result
|
70
|
-
else
|
71
|
-
unlock_pods.each do |pod_name|
|
72
|
-
if self.pods[pod_name] != nil
|
73
|
-
result[pod_name] = self.pods[pod_name]
|
74
|
-
end
|
75
|
-
end
|
76
|
-
return result
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
#处理PODS
|
81
|
-
# TODO 去除重复
|
82
|
-
def deal_pod(s)
|
83
|
-
pod_name = get_lock_podname(s)
|
84
|
-
return if pod_name == nil
|
85
|
-
pod_version = get_lock_version(s)
|
86
|
-
if self.pods.keys.include?(pod_name)
|
87
|
-
current_version = self.pods[pod_name]
|
88
|
-
if pod_version != nil && current_version != nil
|
89
|
-
self.pods[pod_name] = chose_version(current_version, pod_version)
|
90
|
-
else
|
91
|
-
self.pods[pod_name] = pod_version unless pod_version == nil
|
92
|
-
end
|
93
|
-
end
|
94
|
-
self.pods[pod_name] = pod_version unless pod_version == nil
|
95
|
-
end
|
96
|
-
#
|
97
|
-
# #处理EXTERNAL SOURCES
|
98
|
-
# def deal_sources(s)
|
99
|
-
#
|
100
|
-
# end
|
101
|
-
# #处理CHECKOUT OPTIONS
|
102
|
-
# def deal_checkout(s)
|
103
|
-
#
|
104
|
-
# end
|
105
|
-
|
106
|
-
#处理SPEC CHECKSUMS
|
107
|
-
def deal_spec(s)
|
108
|
-
if /: +/ =~ s
|
109
|
-
dependency = $~.pre_match.strip
|
110
|
-
self.dependencies << dependency unless self.dependencies.include?(dependency)
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
def get_lock_podname(sentence) #获得lock pod名称
|
115
|
-
match_result = /(\d+.){1,2}\d+/.match(sentence.delete('- :~>='))
|
116
|
-
pod_name = match_result.pre_match unless match_result == nil
|
117
|
-
return pod_name.delete('()') unless pod_name == nil
|
118
|
-
end
|
119
|
-
|
120
|
-
def get_lock_version(sentence)#获得lock pod版本号
|
121
|
-
match_result = /(\d+.){1,2}\d+/.match(sentence)
|
122
|
-
return match_result[0].strip unless match_result == nil
|
123
|
-
end
|
124
|
-
|
125
|
-
def chose_version(cur_version,temp_version)
|
126
|
-
# p "cur:#{cur_version},temp:#{temp_version}"
|
127
|
-
cur_list = cur_version.split('.')
|
128
|
-
temp_list = temp_version.split('.')
|
129
|
-
cur_list << 0.to_s if cur_list.size == 2
|
130
|
-
temp_list << 0.to_s if temp_list.size == 2
|
131
|
-
if cur_list[0] >= temp_list[0]
|
132
|
-
if cur_list[1] >= temp_list[1]
|
133
|
-
if cur_list[2] > temp_list[2]
|
134
|
-
return cur_version
|
135
|
-
end
|
136
|
-
return temp_version
|
137
|
-
end
|
138
|
-
return temp_version
|
139
|
-
end
|
140
|
-
return temp_version
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module BigKeeper
|
2
|
-
class VersionConfigOperator
|
3
|
-
def self.change_version(version_config_file, modules, version)
|
4
|
-
temp_file = Tempfile.new('.version-config.gradle.tmp')
|
5
|
-
begin
|
6
|
-
File.open(version_config_file, 'r') do |file|
|
7
|
-
file.each_line do |line|
|
8
|
-
temp_file.puts(replace_module_version(line, modules, version))
|
9
|
-
end
|
10
|
-
end
|
11
|
-
temp_file.close
|
12
|
-
FileUtils.mv(temp_file.path, version_config_file)
|
13
|
-
ensure
|
14
|
-
temp_file.close
|
15
|
-
temp_file.unlink
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.replace_module_version(line, modules, version)
|
20
|
-
modules.each do |module_name|
|
21
|
-
version_alias = BigkeeperParser.module_version_alias(module_name)
|
22
|
-
if !version_alias.nil? && !version_alias.empty? && line.match(/\s*#{version_alias}\s*=\s*('|")([\s\S]*)('|")\s*/)
|
23
|
-
return line.sub(/(\s*#{version_alias}\s*=\s*)('|")([\s\S]*)('|")\s*/){"#{$1}\'#{version}\'"}
|
24
|
-
end
|
25
|
-
end
|
26
|
-
line
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,23 +0,0 @@
|
|
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
|