fastlane-plugin-flutter 0.1.3 → 0.1.4

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: dc4981ae81bbf65aeee62f0784b6b0b8b0e9c507
4
- data.tar.gz: 1afc07f90afa98c5b8eaf30952d1d3d8bcd718cb
3
+ metadata.gz: 20cf61e81de467591028c848f079e81b7742d954
4
+ data.tar.gz: a2032215587354ca07add97cdb6712c70b53a0ac
5
5
  SHA512:
6
- metadata.gz: 90faf90ca55cd2eed2e271d4d926fe4213762aeff57aedebe588c9ad30dfc6c84dd4e4e434e4ec9239388ef5b7894648164567b607aa246c5eef482ea325bfc6
7
- data.tar.gz: ba742799194b940f3f842b919664b5e266c1f658918939d545d1e0aafb1affbf91c6d4a023effb9e8dc38be71e2dcf8f8ddb30f15c3924054f0cf3e7b03d84d0
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/my.app.
43
- # Built /Users/foo/src/flutter/build/output/my.apk (32.4MB).
44
+ # Built /Users/foo/src/flutter/build/output/myapp.app.
45
+ # Built build/output/myapp.apk (32.4MB).
44
46
  if res =~ /^Built (.*?)(:? \([^)]*\))?\.$/
45
- lane_context[FLUTTER_TO_OUTPUT[platform]] =
46
- File.absolute_path($1)
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
- --output-dir=#{output_dir} #{params[:l10n_strings_file]})
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
- l10n_messages_file, l10n_messages_was)
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
- --output-dir=#{output_dir}
83
- --no-use-deferred-loading
84
- #{params[:l10n_strings_file]}) + arb_files
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
- # If your method provides a return value, you can describe here what it does
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.exists?(value)
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.exists?(value)
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.open(file_name) do |f|
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'] =
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Flutter
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
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.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Sheremet