fastlane-plugin-flutter 0.3.2 → 0.3.3

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
  SHA1:
3
- metadata.gz: 71b75b4acebe52bb46d4b6a1bef25fce042dc93c
4
- data.tar.gz: e75c011fe43192ba4bc99a82da5a1fcd262f96bf
3
+ metadata.gz: 6e6a88f1db8b61e5437c89b66268d9665f85b5b2
4
+ data.tar.gz: ef730cd4ff058b3d6b347312f55f35926cac6bb3
5
5
  SHA512:
6
- metadata.gz: 674121b5b3ed1046086c06382f565546b121ff3fc5b9175114eede689ed069ce62a98a656a484ad156846f1f1dd25b0dd7d91fe6b68df3e2362e0f737312b14b
7
- data.tar.gz: 2dd5e57c2804f935133373ee5e35680c83326c1964815232c3600cac0de79d6c5fb034572d77b6bd632d7d75a14dc52de70ca017b4d7d4b5a8c8ad0dc6c63de6
6
+ metadata.gz: f89d1e9ef42289a526b60e198871f137a51cf549e8a811e9bc6444cf413604076a5b042719117be15eb4c3cb1c7480053cd61992921cf93544e619d467e74762
7
+ data.tar.gz: 24585aeeeea8bc8db4778fad5dde4b0362915f5c6860bde8afb1c958931ce07b0a180abf0b4a20c5ec87da26fad3b2351ed7d63510a7da5a96ab1129107ee774
@@ -23,23 +23,21 @@ module Fastlane
23
23
  UI.message("Upgrading Flutter SDK in #{flutter_sdk_root}...")
24
24
  if flutter_channel
25
25
  UI.message("Making sure Flutter is on channel #{flutter_channel}")
26
- Helper::FlutterHelper.flutter(
27
- 'channel', flutter_channel,
28
- log: false
29
- )
26
+ Helper::FlutterHelper.flutter('channel', flutter_channel) {}
30
27
  end
31
- Helper::FlutterHelper.flutter('upgrade', log: false)
28
+ Helper::FlutterHelper.flutter('upgrade') {}
32
29
  else
33
30
  Helper::FlutterHelper.git(
34
31
  'clone', # no --depth to keep Flutter tag-based versioning.
35
32
  "--branch=#{flutter_channel || 'beta'}",
33
+ '--quiet',
36
34
  '--',
37
35
  'https://github.com/flutter/flutter.git',
38
36
  flutter_sdk_root,
39
37
  )
40
38
  end
41
39
  UI.message('Precaching Flutter SDK binaries...')
42
- Helper::FlutterHelper.flutter('precache', log: false)
40
+ Helper::FlutterHelper.flutter('precache') {}
43
41
  end
44
42
 
45
43
  def self.android_sdk_root!
@@ -58,10 +58,9 @@ module Fastlane
58
58
  else
59
59
  UI.important('Cannot parse built file path from "flutter build"')
60
60
  end
61
- else
62
- # fastlane does not fail automatically if we provide a block.
63
- UI.build_failure!('"flutter build" has failed')
64
61
  end
62
+ # Tell upstream to NOT ignore error.
63
+ false
65
64
  end
66
65
 
67
66
  lane_context[SharedValues::FLUTTER_OUTPUT]
@@ -10,7 +10,7 @@ module Fastlane
10
10
  extend FlutterActionBase
11
11
 
12
12
  def self.run(params)
13
- Helper::FlutterHelper.flutter(*%w(packages get), log: false)
13
+ Helper::FlutterHelper.flutter(*%w(packages get)) {}
14
14
 
15
15
  # In an ideal world, this should be a part of build_runner:
16
16
  # https://github.com/dart-lang/intl_translation/issues/32
@@ -6,8 +6,7 @@ module Fastlane
6
6
  def self.build
7
7
  Helper::FlutterHelper.flutter(
8
8
  *%w(packages pub run build_runner build --delete-conflicting-outputs),
9
- log: false,
10
- )
9
+ ) {}
11
10
  end
12
11
  end
13
12
  end
@@ -5,21 +5,11 @@ module Fastlane
5
5
  module Helper
6
6
  class FlutterHelper
7
7
  def self.flutter(*argv, &block)
8
- # TODO(dotdoom): use CommandExecutor instead of Actions.sh.
9
- # TODO(dotdoom): explain special keys in params, like "log" etc.
10
- # TODO(dotdoom): most commands set "log: false", which means that the
11
- # output is lost (even in case of error). Perhaps we
12
- # could print the output here, via error_callback?
13
- # https://github.com/fastlane/fastlane/blob/b1495d134eec6681c8d7a544aa3520f1da00c80e/fastlane/lib/fastlane/helper/sh_helper.rb#L73
14
- # Workaround for Fastlane not printing output if block is not given.
15
- block ||= proc {}
16
- Actions.sh(File.join(flutter_sdk_root, 'bin', 'flutter'), *argv, &block)
8
+ execute(File.join(flutter_sdk_root, 'bin', 'flutter'), *argv, &block)
17
9
  end
18
10
 
19
11
  def self.git(*argv, &block)
20
- # Workaround for Fastlane not printing output if block is not given.
21
- block ||= proc {}
22
- Actions.sh('git', *argv, &block)
12
+ execute('git', *argv, &block)
23
13
  end
24
14
 
25
15
  def self.flutter_sdk_root
@@ -37,6 +27,36 @@ module Fastlane
37
27
  def self.dev_dependency?(package)
38
28
  (YAML.load_file('pubspec.yaml')['dev_dependencies'] || {}).key?(package)
39
29
  end
30
+
31
+ def self.execute(*command)
32
+ # TODO(dotdoom): make CommandExecutor (and Actions.sh) behave similarly.
33
+ command = command.shelljoin
34
+ UI.command(command)
35
+ Open3.popen3(command) do |stdin, stdout, stderr, wait_thread|
36
+ errors_thread = Thread.new { stderr.read }
37
+ stdin.close
38
+
39
+ if block_given?
40
+ output = stdout.read
41
+ ignore_error = yield(wait_thread.value, output, errors_thread)
42
+ else
43
+ stdout.each_line do |stdout_line|
44
+ UI.command_output(stdout_line.chomp)
45
+ end
46
+ end
47
+
48
+ unless wait_thread.value.success? || (ignore_error == true)
49
+ UI.shell_error!(<<-ERROR)
50
+ The following command has failed:
51
+
52
+ $ #{command}
53
+ [#{wait_thread.value}]
54
+
55
+ #{errors_thread.value}
56
+ ERROR
57
+ end
58
+ end
59
+ end
40
60
  end
41
61
  end
42
62
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Flutter
3
- VERSION = '0.3.2'
3
+ VERSION = '0.3.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-flutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Sheremet