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 +4 -4
- data/lib/fastlane/plugin/flutter/actions/flutter_bootstrap_action.rb +4 -6
- data/lib/fastlane/plugin/flutter/actions/flutter_build_action.rb +2 -3
- data/lib/fastlane/plugin/flutter/actions/flutter_generate_action.rb +1 -1
- data/lib/fastlane/plugin/flutter/helper/flutter_generate_build_runner_helper.rb +1 -2
- data/lib/fastlane/plugin/flutter/helper/flutter_helper.rb +32 -12
- data/lib/fastlane/plugin/flutter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e6a88f1db8b61e5437c89b66268d9665f85b5b2
|
4
|
+
data.tar.gz: ef730cd4ff058b3d6b347312f55f35926cac6bb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
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'
|
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)
|
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
|
@@ -5,21 +5,11 @@ module Fastlane
|
|
5
5
|
module Helper
|
6
6
|
class FlutterHelper
|
7
7
|
def self.flutter(*argv, &block)
|
8
|
-
|
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
|
-
|
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
|