pod-builder 0.3.4 ā†’ 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2b15a3539bfaa5271eb74891d1bed4036fd42a599470dbcf938858ad10b08a3
4
- data.tar.gz: fef9f31b21b1830cd4042484d7327e599229d4090fa96d967265124e709d0046
3
+ metadata.gz: 4cd79078e29962f8d13a9a306462aaa99a0a0bfccc86cf401bba8fe0f39547bf
4
+ data.tar.gz: 211898086a3b86013c16c3281e9170adac80fd95165c081076424b74cecea63d
5
5
  SHA512:
6
- metadata.gz: c4ad04ab32b1193a2050b257eb7cc2f22633f93c09cc793c214b23243337d637020237739ce28c76e1234844f93021990ff0637eb9443a6492647fed76e1d75a
7
- data.tar.gz: d46e70d979b2b0b2ee837d2e6f4548f1051666f9f052c5e6206dde72a15c7db81ae49adc5bfeafcc9d26985e916112ab3bfa6ba53070cbe1894d98596368f39c
6
+ metadata.gz: 95b42aaef813c53f251a1fc80b9321302b6d8d64bcd90be2ff5215a32e252f041aaa60f774228f296a27d356a5a0022f29522e6a1d7dbb4508991195237111fb
7
+ data.tar.gz: 4375249f5461a9da244c828e8d2b1fa2e04c7e5ccc49c0d177c5a2ea4b72ad7259e573e52ecaa57af58ec1b5745b2618badfa10ab5252b55b4fc960db3744a57
data/exe/pod_builder CHANGED
@@ -119,6 +119,9 @@ Options:
119
119
  opts.on("-w", "--allow-warnings", "Allow warnings") do |o|
120
120
  OPTIONS[:allow_warnings] = o
121
121
  end
122
+ opts.on("-r", "--dry", "Determine which frameworks need update") do |o|
123
+ OPTIONS[:dry_run] = o
124
+ end
122
125
  opts.on("-d", "--debug", "Don't clean build folder") do |o|
123
126
  OPTIONS[:debug] = o
124
127
  end
@@ -286,6 +289,7 @@ Usage:
286
289
 
287
290
  subcommand = subcommands[ARGV.shift]
288
291
 
292
+ ret = -1
289
293
  if subcommand
290
294
  if ARGV.include?("--help") || ARGV.include?("-h")
291
295
  puts subcommand[:opts].help
@@ -294,29 +298,27 @@ Usage:
294
298
 
295
299
  subcommand[:opts].order!
296
300
  subcommand[:call].each do |k|
297
- if !k.call(OPTIONS)
301
+ if (ret = k.call(OPTIONS)) && ret == -1
298
302
  puts subcommand[:opts].help
299
303
  end
300
304
  end
301
- end
302
-
303
- return true
305
+ end
304
306
  else
305
307
  if !subcommands["none"][:call].first&.call(OPTIONS)
306
308
  puts subcommands["none"][:opts].help
307
309
  end
308
-
309
- return false
310
310
  end
311
+
312
+ return ret
311
313
  end
312
314
 
313
- command_executed = false
315
+ command_ret = -1
314
316
  begin
315
317
  unless ENV['USER'] != "root"
316
318
  raise "\n\nFor safety do not run this as root\n".red
317
319
  end
318
320
 
319
- command_executed = parse_commandline
321
+ command_ret = parse_commandline
320
322
  rescue Exception => e
321
323
  error = e.to_s
322
324
 
@@ -330,12 +332,12 @@ rescue Exception => e
330
332
  File.write(error_log, error)
331
333
  end
332
334
  ensure
333
- unless command_executed
334
- exit(0)
335
+ if command_ret == 0
336
+ PodBuilder::clean_basepath
337
+ if !OPTIONS.has_key?(:debug)
338
+ PodBuilder::safe_rm_rf(PodBuilder::Configuration.build_path)
339
+ end
335
340
  end
336
341
 
337
- PodBuilder::clean_basepath
338
- if !OPTIONS.has_key?(:debug)
339
- PodBuilder::safe_rm_rf(PodBuilder::Configuration.build_path)
340
- end
342
+ exit(command_ret)
341
343
  end
@@ -10,7 +10,7 @@ module PodBuilder
10
10
  argument_pods = ARGV.dup
11
11
 
12
12
  unless argument_pods.count > 0
13
- return false
13
+ return -1
14
14
  end
15
15
 
16
16
  Podfile.sanity_check()
@@ -100,7 +100,7 @@ module PodBuilder
100
100
  end
101
101
 
102
102
  puts "\n\nšŸŽ‰ done!\n".green
103
- return true
103
+ return 0
104
104
  end
105
105
 
106
106
  private
@@ -36,7 +36,7 @@ module PodBuilder
36
36
  clean_sources(podspec_names)
37
37
 
38
38
  puts "\n\nšŸŽ‰ done!\n".green
39
- return true
39
+ return 0
40
40
  end
41
41
 
42
42
  def self.clean_sources(podspec_names)
@@ -48,7 +48,7 @@ module PodBuilder
48
48
  update_gemfile
49
49
 
50
50
  puts "\n\nšŸŽ‰ done!\n".green
51
- return true
51
+ return 0
52
52
  end
53
53
 
54
54
  private
@@ -7,7 +7,7 @@ module PodBuilder
7
7
  Configuration.check_inited
8
8
 
9
9
  unless Configuration.lfs_update_gitattributes
10
- return false
10
+ return -1
11
11
  end
12
12
 
13
13
  gitattributes_excludes = ["*.h", "*.hh", "*.m", "*.mm", "*.i", "*.c", "*.cc", "*.cxx", "*.cpp", "*.def", "*.inc", "*.inl", "*.swift", "*.modulemap", "*.strings", "*.png", "*.jpg", "*.gif", "*.html", "*.htm", "*.js", "*.json", "*.xml", "*.txt", "*.md", "*.rb", "*.sh", "*.py", "*.plist", "*.resolved", ".*", "README*", "LICENSE*"]
@@ -20,6 +20,8 @@ module PodBuilder
20
20
  gitattributes_includes_pods = ["**/*.framework/**/* filter=lfs diff=lfs merge=lfs !text"]
21
21
  write_attributes(PodBuilder::project_path("Pods"), gitattributes_includes_pods, gitattributes_excludes)
22
22
  end
23
+
24
+ return 0
23
25
  end
24
26
 
25
27
  private
@@ -12,7 +12,7 @@ module PodBuilder
12
12
  Podspec::generate(analyzer)
13
13
 
14
14
  puts "\n\nšŸŽ‰ done!\n".green
15
- return true
15
+ return 0
16
16
  end
17
17
  end
18
18
  end
@@ -47,7 +47,7 @@ module PodBuilder
47
47
  update_gemfile
48
48
 
49
49
  puts "\n\nšŸŽ‰ done!\n".green
50
- return true
50
+ return 0
51
51
  end
52
52
 
53
53
  private
@@ -28,7 +28,7 @@ module PodBuilder
28
28
  rewrite_lldinit
29
29
 
30
30
  puts "\n\nšŸŽ‰ done!\n".green
31
- return true
31
+ return 0
32
32
  end
33
33
 
34
34
  private
@@ -6,10 +6,10 @@ module PodBuilder
6
6
  def self.call(options)
7
7
  unless !options.has_key?(:version)
8
8
  puts VERSION
9
- return true
9
+ return 0
10
10
  end
11
11
 
12
- return false
12
+ return -1
13
13
  end
14
14
  end
15
15
  end
@@ -5,20 +5,19 @@ module PodBuilder
5
5
  class RestoreAll
6
6
  def self.call(options)
7
7
  unless Configuration.restore_enabled
8
- return
8
+ raise "Restore not enabled!".red
9
9
  end
10
10
 
11
11
  Configuration.check_inited
12
12
  PodBuilder::prepare_basepath
13
13
 
14
- ret = false
15
14
  begin
16
15
  File.rename(PodBuilder::basepath("Podfile"), PodBuilder::basepath("Podfile.tmp2"))
17
16
  File.rename(PodBuilder::basepath("Podfile.restore"), PodBuilder::basepath("Podfile"))
18
17
 
19
18
  ARGV << "*"
20
19
  options[:skip_prebuild_update] = true
21
- ret = Command::Build::call(options)
20
+ return Command::Build::call(options)
22
21
  rescue Exception => e
23
22
  raise e
24
23
  ensure
@@ -27,7 +26,7 @@ module PodBuilder
27
26
  File.rename(PodBuilder::basepath("Podfile.tmp2"), PodBuilder::basepath("Podfile"))
28
27
  end
29
28
 
30
- return ret
29
+ return -1
31
30
  end
32
31
  end
33
32
  end
@@ -10,11 +10,10 @@ module PodBuilder
10
10
  argument_pods = ARGV.dup
11
11
 
12
12
  unless argument_pods.count > 0
13
- return false
13
+ return -1
14
14
  end
15
15
  unless argument_pods.count == 1
16
16
  raise "\n\nSpecify a single pod to switch\n\n".red
17
- return false
18
17
  end
19
18
 
20
19
  pod_name_to_switch = argument_pods.first
@@ -31,7 +30,7 @@ module PodBuilder
31
30
  options[:switch_mode] = request_switch_mode(pod_name_to_switch, podfile_item)
32
31
 
33
32
  if options[:switch_mode].nil?
34
- return true
33
+ return 0
35
34
  end
36
35
  end
37
36
 
@@ -101,6 +100,8 @@ module PodBuilder
101
100
 
102
101
  Dir.chdir(PodBuilder::project_path)
103
102
  system("pod install")
103
+
104
+ return 0
104
105
  end
105
106
 
106
107
  private
@@ -24,7 +24,7 @@ module PodBuilder
24
24
  system("pod install")
25
25
  end
26
26
 
27
- return true
27
+ return 0
28
28
  end
29
29
  end
30
30
  end
@@ -48,7 +48,12 @@ module PodBuilder
48
48
 
49
49
  unless pod_entries.count > 0
50
50
  puts "Frameworks in sync!\n".green
51
- return true
51
+ return 0
52
+ end
53
+ if options.has_key?(:dry_run)
54
+ rebuilding_pods = pod_entries.map { |x| x.match(/(^pod')(.*?)(')/)[2] }.compact
55
+ puts "`#{rebuilding_pods.join("`, `")}` need to be rebuilt!\n".red
56
+ return -2
52
57
  end
53
58
 
54
59
  ARGV.clear
@@ -59,7 +64,7 @@ module PodBuilder
59
64
  }
60
65
 
61
66
  options[:auto_resolve_dependencies] = true
62
- PodBuilder::Command::Build.call(options)
67
+ return PodBuilder::Command::Build.call(options)
63
68
  end
64
69
 
65
70
  private
@@ -1,4 +1,4 @@
1
1
  module PodBuilder
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pod-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Camin