bigkeeper 0.9.17 → 0.9.18

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
  SHA256:
3
- metadata.gz: c2241a06a8957bc229f966705191bca6e0088a1ee9ae8658a5b46aa1fbe67afa
4
- data.tar.gz: 6331390f7fc6701c22bc25118fa1e93381dbb88b2ac71f1ea5b1d12c253b7122
3
+ metadata.gz: fd7362d98b471a417a54fa026978d8b090d99957c40bb69b98faf8e105bfdc41
4
+ data.tar.gz: a9740d5b04a663b085135c8d98fbc4174dce6f70c3b7511d80fae3fca9833f9d
5
5
  SHA512:
6
- metadata.gz: 6fa57906062b4563110e53f62b6bcba614db052d2a808bff826a5775d92c665b41f74d419a4ff3c1487cca63d90e584b70647c89a97dea32d9fc931c47a3f5d2
7
- data.tar.gz: 677aa18e051ae029e749ea2d9ef15a608b2f98136dc7de8aaa6fd5781563c0be83923083d4fd8ade33bc759ecd387d8be76611e96e53f206ca110ae850d79410
6
+ metadata.gz: c1dc2ee479cfc5cc9c62fb59ee1cf2316db5f0a2cb34a9c8e305ba01fdf2656ae1bef1c9faccad07e1c09e9e7f4ef3d1a9098965c499a05fdcb28c4f689aca5f
7
+ data.tar.gz: d24cde1b07508171c49447d6e722184b1dba0cc15f6fb854f5b04809417cd8461ce96f16dfe8db2ff5c8bab84777ab9848011b9e0c1799eab7fa3cf3c210e20a
@@ -11,7 +11,6 @@ module BigKeeper
11
11
  def self.prerelease_start(path, version, user, modules)
12
12
  BigkeeperParser.parse("#{path}/Bigkeeper")
13
13
  version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
14
- modules = BigkeeperParser.module_names
15
14
  DepService.dep_operator(path, user).prerelease_start(path, version, user, modules)
16
15
  end
17
16
 
@@ -42,13 +42,11 @@ module BigKeeper
42
42
  spec.command :sync do | sync|
43
43
  sync.action do |global_options, options, args|
44
44
  LeanCloudLogger.instance.set_command("spec/sync")
45
-
46
45
  path = File.expand_path(global_options[:path])
47
- version = global_options[:ver]
48
46
  user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
49
- module_name = args
50
-
51
- spec_sync(path, version, user, module_name)
47
+ help_now!('module name is required') if args.length != 1
48
+ module_name = args[0]
49
+ spec_sync(path, user, module_name)
52
50
  end
53
51
  end
54
52
 
@@ -1,12 +1,39 @@
1
1
  require 'big_keeper/util/bigkeeper_parser'
2
2
  require 'big_keeper/dependency/dep_type'
3
3
  require 'big_keeper/util/logger'
4
+ require 'big_keeper/util/podspec_operator'
5
+ require 'big_keeper/util/lockfile_parser'
4
6
 
5
7
  module BigKeeper
6
- def self.spec_sync(path, version, user, module_name)
8
+ def self.spec_sync(path, user, module_name)
7
9
  # Parse Bigkeeper file
8
10
  BigkeeperParser.parse("#{path}/Bigkeeper")
9
11
 
10
- Logger.default('Coming soon.')
12
+ module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
13
+
14
+ detector = PodspecOperator.instance
15
+ detector.parse(module_full_path, module_name)
16
+
17
+ lock_parser = LockfileParser.instance
18
+ lock_parser.parse(path)
19
+
20
+ pod_versions = Hash.new
21
+ for pod in detector.pod_list
22
+ pod_ver = get_pod_version(lock_parser.pods, pod)
23
+ if pod_ver != nil
24
+ pod_versions = pod_versions.merge(pod_ver)
25
+ end
26
+ end
27
+
28
+ PodfileOperator.new.find_and_lock("#{module_full_path}/Example/Podfile", pod_versions)
29
+ Logger.highlight("The Podfile has been changed.")
11
30
  end
31
+
32
+ def self.get_pod_version(locks, pod_name)
33
+ pod_version = Hash.new
34
+ if locks[pod_name]
35
+ pod_version = {"#{pod_name}" => locks[pod_name]}
36
+ end
37
+ end
38
+
12
39
  end
@@ -77,7 +77,7 @@ module BigKeeper
77
77
  BigkeeperParser.parse("#{path}/Bigkeeper")
78
78
  version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
79
79
  modules = BigkeeperParser.module_names
80
-
80
+
81
81
  if modules.nil? || modules.empty?
82
82
  Logger.default('no module need to release')
83
83
  end
@@ -201,8 +201,8 @@ module BigKeeper
201
201
  BigkeeperParser.parse("#{path}/Bigkeeper")
202
202
 
203
203
  version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
204
+ modules = BigkeeperParser.module_names if (modules.nil? || modules.empty?)
204
205
  modules = release_check_changed_modules(path, user) if (modules.nil? || modules.empty?)
205
-
206
206
  if modules.nil? || modules.empty?
207
207
  Logger.error('no module need to release')
208
208
  end
@@ -170,7 +170,7 @@ module BigKeeper
170
170
 
171
171
  DepService.dep_operator(path, user).update_module_config(
172
172
  module_name,
173
- ModuleOperateType::RELEASE_START)
173
+ ModuleOperateType::FINISH)
174
174
  end
175
175
  end
176
176
 
@@ -36,10 +36,10 @@ module BigKeeper
36
36
  $mode = 'PODFILE CHECKSUM'
37
37
  else
38
38
  if $mode == 'PODS'
39
- deal_pod(sentence.strip.delete('\n'))
39
+ deal_pod(sentence.strip.chomp)
40
40
  end
41
41
  if $mode == 'SPEC CHECKSUMS'
42
- deal_spec(sentence.strip.delete('\n'))
42
+ deal_spec(sentence.strip.chomp)
43
43
  end
44
44
  end
45
45
  end
@@ -105,10 +105,10 @@ module BigKeeper
105
105
 
106
106
  #处理SPEC CHECKSUMS
107
107
  def deal_spec(s)
108
- if /: +/ =~ s
108
+ if /: +/ =~ s
109
109
  dependency = $~.pre_match.strip
110
110
  self.dependencies << dependency unless self.dependencies.include?(dependency)
111
- end
111
+ end
112
112
  end
113
113
 
114
114
  def get_lock_podname(sentence) #获得lock pod名称
@@ -20,9 +20,9 @@ module BigKeeper
20
20
  def generate_pod_config(pod_name, version, comment)
21
21
  module_config = ''
22
22
  if comment != nil
23
- module_config = " pod '#{pod_name}' , '#{version}' # #{comment}"
23
+ module_config = " pod '#{pod_name}', '#{version}' # #{comment}"
24
24
  else
25
- module_config = " pod '#{pod_name}' , '#{version}'"
25
+ module_config = " pod '#{pod_name}', '#{version}'"
26
26
  end
27
27
  end
28
28
 
@@ -50,6 +50,7 @@ module BigKeeper
50
50
  end
51
51
  end
52
52
  if !dictionary.empty?
53
+ temp_file.puts ''
53
54
  temp_file.puts 'def sub_dependency'
54
55
  dictionary.keys.each do |sub_pod|
55
56
  temp_file.puts generate_pod_config(sub_pod, dictionary[sub_pod], 'bigkeeper')
@@ -0,0 +1,55 @@
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 podspec file
8
+ class PodspecOperator
9
+ include Singleton
10
+ attr_accessor :module_list, :main_path, :pod_list
11
+ $unlock_pod_list = []
12
+ $modify_pod_list = {}
13
+
14
+ def initialize
15
+ @module_list = BigkeeperParser.module_names
16
+ @pod_list = []
17
+ end
18
+
19
+ def parse(path, module_name)
20
+ @main_path = path
21
+ podspec_lines = File.readlines("#{@main_path}/#{module_name}.podspec", :encoding => 'UTF-8')
22
+ Logger.highlight("Analyzing Podspec...") unless podspec_lines.size.zero?
23
+ podspec_lines.collect do |sentence|
24
+ if /dependency / =~ sentence
25
+ pod_name = get_pod_name(sentence)
26
+ @pod_list << pod_name
27
+ end
28
+ end
29
+ end
30
+
31
+ def get_pod_name(sentence)
32
+ pod_model = deal_podfile_line(sentence)
33
+ if pod_model != nil
34
+ return pod_model.chomp.gsub("'", "")
35
+ end
36
+ end
37
+
38
+ def deal_podfile_line(sentence)
39
+ pod_name = ''
40
+ if sentence.strip.include?('dependency ')
41
+ pod_dep = sentence.split('dependency ')
42
+ if pod_dep.size > 1
43
+ pod_names = pod_dep[1].split(',')
44
+ if pod_names.size > 1
45
+ pod_name = pod_names[0]
46
+ else
47
+ pod_name = pod_dep[1]
48
+ end
49
+ end
50
+ pod_name
51
+ end
52
+ end
53
+
54
+ end
55
+ end
@@ -1,3 +1,3 @@
1
1
  module BigKeeper
2
- VERSION = "0.9.17"
2
+ VERSION = "0.9.18"
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.9.17
4
+ version: 0.9.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - mmoaay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-07 00:00:00.000000000 Z
11
+ date: 2019-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -314,6 +314,7 @@ files:
314
314
  - lib/big_keeper/util/podfile_detector.rb
315
315
  - lib/big_keeper/util/podfile_module.rb
316
316
  - lib/big_keeper/util/podfile_operator.rb
317
+ - lib/big_keeper/util/podspec_operator.rb
317
318
  - lib/big_keeper/util/verify_operator.rb
318
319
  - lib/big_keeper/util/version_config_operator.rb
319
320
  - lib/big_keeper/util/xcode_operator.rb
@@ -346,8 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
346
347
  - !ruby/object:Gem::Version
347
348
  version: '0'
348
349
  requirements: []
349
- rubyforge_project:
350
- rubygems_version: 2.7.6
350
+ rubygems_version: 3.0.3
351
351
  signing_key:
352
352
  specification_version: 4
353
353
  summary: Efficiency improvement for iOS&Android modular development.