fastlane-plugin-flutter 0.1.3 → 0.1.4
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20cf61e81de467591028c848f079e81b7742d954
|
4
|
+
data.tar.gz: a2032215587354ca07add97cdb6712c70b53a0ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f719278a6d1374890955711bbe552ccaf165904f1c379446733e1c2960f418013696cac2004df81a4f46514b0536f8caab97a7a41e62cedbbe8ee866a9f14e
|
7
|
+
data.tar.gz: cd6795bb06f0f16299fe2c0a51c45bf5ecd7823bfb827228d5da1a8c86d6b97407ac1fbd11204f1be9ca4f525b8ce3740a4c7277aa4d5ff1f8cd6cfd4842fefe
|
@@ -33,22 +33,27 @@ module Fastlane
|
|
33
33
|
additional_args = []
|
34
34
|
additional_args.push('--debug') if params[:debug]
|
35
35
|
|
36
|
+
built_files = {}
|
37
|
+
|
36
38
|
flutter_platforms.each do |platform|
|
37
39
|
sh('flutter', 'build', platform, *additional_args) do |status, res|
|
38
40
|
if status.success?
|
39
41
|
# Dirty hacks ahead!
|
40
42
|
if FLUTTER_TO_OUTPUT.key?(platform)
|
41
43
|
# Examples:
|
42
|
-
# Built /Users/foo/src/flutter/build/output/
|
43
|
-
# Built
|
44
|
+
# Built /Users/foo/src/flutter/build/output/myapp.app.
|
45
|
+
# Built build/output/myapp.apk (32.4MB).
|
44
46
|
if res =~ /^Built (.*?)(:? \([^)]*\))?\.$/
|
45
|
-
|
46
|
-
|
47
|
+
built_file = File.absolute_path($1)
|
48
|
+
built_files[PLATFORM_TO_FLUTTER.key(platform)] = built_file
|
49
|
+
lane_context[FLUTTER_TO_OUTPUT[platform]] = built_file
|
47
50
|
end
|
48
51
|
end
|
49
52
|
end
|
50
53
|
end
|
51
54
|
end
|
55
|
+
|
56
|
+
built_files
|
52
57
|
when 'test'
|
53
58
|
sh *%w(flutter test)
|
54
59
|
when 'analyze'
|
@@ -61,15 +66,17 @@ module Fastlane
|
|
61
66
|
l10n_messages_was = File.read(l10n_messages_file)
|
62
67
|
|
63
68
|
sh *%W(flutter pub pub run intl_translation:extract_to_arb
|
64
|
-
|
69
|
+
--output-dir=#{output_dir} #{params[:l10n_strings_file]})
|
65
70
|
|
66
71
|
# intl will update @@last_modified even if there are no updates;
|
67
72
|
# this leaves Git directory unnecessary dirty. If that's the only
|
68
73
|
# change, just restore the previous contents.
|
69
74
|
if Helper::FlutterHelper.restore_l10n_timestamp(
|
70
|
-
|
75
|
+
l10n_messages_file, l10n_messages_was
|
76
|
+
)
|
71
77
|
UI.message(
|
72
|
-
"@@last_modified has been restored in #{l10n_messages_file}"
|
78
|
+
"@@last_modified has been restored in #{l10n_messages_file}"
|
79
|
+
)
|
73
80
|
end
|
74
81
|
|
75
82
|
# Sort files for consistency, because messages_all.dart will have
|
@@ -79,9 +86,9 @@ module Fastlane
|
|
79
86
|
arb_files.delete(l10n_messages_file)
|
80
87
|
|
81
88
|
sh *%W(flutter pub pub run intl_translation:generate_from_arb
|
82
|
-
|
83
|
-
|
84
|
-
|
89
|
+
--output-dir=#{output_dir}
|
90
|
+
--no-use-deferred-loading
|
91
|
+
#{params[:l10n_strings_file]}) + arb_files
|
85
92
|
end
|
86
93
|
end
|
87
94
|
|
@@ -94,7 +101,9 @@ module Fastlane
|
|
94
101
|
end
|
95
102
|
|
96
103
|
def self.return_value
|
97
|
-
|
104
|
+
'For "build" action, the return value is a mapping of fastlane ' \
|
105
|
+
'platform names into built output files, e.g.: ' +
|
106
|
+
{ android: '/Users/foo/src/flutter/build/outputs/myapp.apk' }.inspect
|
98
107
|
end
|
99
108
|
|
100
109
|
def self.details
|
@@ -129,7 +138,7 @@ module Fastlane
|
|
129
138
|
optional: true,
|
130
139
|
default_value: 'lib',
|
131
140
|
verify_block: proc do |value|
|
132
|
-
UI.user_error!('Directory does not exist') unless Dir.
|
141
|
+
UI.user_error!('Directory does not exist') unless Dir.exist?(value)
|
133
142
|
end,
|
134
143
|
),
|
135
144
|
FastlaneCore::ConfigItem.new(
|
@@ -138,7 +147,7 @@ module Fastlane
|
|
138
147
|
description: 'Path to the .dart file with l10n strings',
|
139
148
|
optional: true,
|
140
149
|
verify_block: proc do |value|
|
141
|
-
UI.user_error!('File does not exist') unless File.
|
150
|
+
UI.user_error!('File does not exist') unless File.exist?(value)
|
142
151
|
end,
|
143
152
|
),
|
144
153
|
]
|
@@ -7,9 +7,7 @@ module Fastlane
|
|
7
7
|
module Helper
|
8
8
|
class FlutterHelper
|
9
9
|
def self.restore_l10n_timestamp(file_name, old_content)
|
10
|
-
new_content_tree = File.
|
11
|
-
JSON.load(f)
|
12
|
-
end
|
10
|
+
new_content_tree = JSON.parse(File.read(file_name))
|
13
11
|
old_content_tree = JSON.parse(old_content)
|
14
12
|
|
15
13
|
new_content_tree['@@last_modified'] =
|