fastlane-plugin-flutter 0.2.1 → 0.2.2

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: 38433eace9000141ec38668c034888ee57c812fc
4
- data.tar.gz: c337e663d2da2a86ccc2f5d44195646a90d365f8
3
+ metadata.gz: a45f890d9d763817a9047a2dc921f44235a5f155
4
+ data.tar.gz: 75ab409fd122a2bd900b579c3c9274f6d38d69f4
5
5
  SHA512:
6
- metadata.gz: 2a247f503bf828d0cfa611d3f9244feb4ac2f70883c812f7ed265484fdf54c91c12eafbee2afacad62e35df5856813d89953cd4e4f2cbca4defa43f8d1887913
7
- data.tar.gz: 98e524265230f19cfeaeec96baf5db5f3c01e856afdcb13d87d980acf61e464b1c042d82f8bb26152269a014f4d56cbabafcdfdcb5f79efe764b1b6e53360266
6
+ metadata.gz: e05e2bb661a046c95a2b01da3cbddaa3803a9a60b5c57af1745fd208f6bab14ed4d301339d260ea6cc7578bebb46bf73641adaad0d43f93b96d412b9d595e088
7
+ data.tar.gz: 881a172252e7f1fd261836c09df91895cb9ba886cbbedd82bf009303378df0dd01ebe55f78489c3660979446276a59f153aead352cb50aad4d0a352c4ac3ddd7
@@ -22,41 +22,64 @@ module Fastlane
22
22
  android: 'apk',
23
23
  }
24
24
 
25
- FLUTTER_TO_OUTPUT = {
26
- 'ios' => SharedValues::FLUTTER_OUTPUT_APP,
27
- 'apk' => SharedValues::FLUTTER_OUTPUT_APK,
25
+ PLATFORM_TO_OUTPUT = {
26
+ ios: SharedValues::FLUTTER_OUTPUT_APP,
27
+ android: SharedValues::FLUTTER_OUTPUT_APK,
28
28
  }
29
29
 
30
30
  def self.run(params)
31
+ # You can print a table of plugin configuration params like that:
32
+ #
33
+ # FastlaneCore::PrintTable.print_values(
34
+ # config: params,
35
+ # title: "Summary for Flutter plugin #{Fastlane::Flutter::VERSION}",
36
+ # )
37
+
31
38
  case params[:action]
32
39
  when 'build'
33
- flutter_platforms = %w(apk ios)
34
- # Override if we are on a specific platform (non-root lane).
35
- if fastlane_platform = lane_context[SharedValues::PLATFORM_NAME]
36
- flutter_platforms = [PLATFORM_TO_FLUTTER[fastlane_platform]]
40
+ # A map of fastlane platform name into "flutter build" args list.
41
+ build_args = {}
42
+
43
+ (lane_context[SharedValues::PLATFORM_NAME] ||
44
+ # If platform is unspecified, build for all platforms.
45
+ PLATFORM_TO_FLUTTER.keys).each do |fastlane_platform|
46
+ build_args[fastlane_platform] = [
47
+ PLATFORM_TO_FLUTTER[fastlane_platform],
48
+ ]
49
+ end
50
+
51
+ if params[:debug]
52
+ build_args.each_value do |a|
53
+ a.push('--debug')
54
+ end
37
55
  end
38
56
 
39
- additional_args = []
40
- additional_args.push('--debug') if params[:debug]
57
+ unless params[:codesign]
58
+ build_args[:ios].push('--no-codesign') if build_args.key?(:ios)
59
+ end
41
60
 
42
61
  if lane_context[SharedValues::FLUTTER_OUTPUT_BUILD_NUMBER_OVERRIDE] =
43
62
  build_number = Helper::FlutterHelper.build_number(
44
63
  params[:build_number_override]
45
64
  )
46
- additional_args.push('--build-number', build_number.to_s)
65
+ build_args.each_value do |a|
66
+ a.push('--build-number', build_number.to_s)
67
+ end
47
68
  end
48
69
 
49
70
  if lane_context[SharedValues::FLUTTER_OUTPUT_BUILD_NAME_OVERRIDE] =
50
71
  build_name = Helper::FlutterHelper.build_name(
51
72
  params[:build_name_override]
52
73
  )
53
- additional_args.push('--build-name', build_name)
74
+ build_args.each_value do |a|
75
+ a.push('--build-name', build_name)
76
+ end
54
77
  end
55
78
 
56
- built_files = {}
57
-
58
- flutter_platforms.each do |platform|
59
- sh('flutter', 'build', platform, *additional_args) do |status, res|
79
+ # Note: this statement is expected to return a value (map of platform
80
+ # into file name).
81
+ build_args.map do |platform, args|
82
+ sh('flutter', 'build', *args) do |status, res|
60
83
  if status.success?
61
84
  # Dirty hacks ahead!
62
85
  if FLUTTER_TO_OUTPUT.key?(platform)
@@ -64,19 +87,16 @@ module Fastlane
64
87
  # Built /Users/foo/src/flutter/build/output/myapp.app.
65
88
  # Built build/output/myapp.apk (32.4MB).
66
89
  if res =~ /^Built (.*?)(:? \([^)]*\))?\.$/
67
- built_file = File.absolute_path($1)
68
- built_files[PLATFORM_TO_FLUTTER.key(platform)] = built_file
69
- lane_context[FLUTTER_TO_OUTPUT[platform]] = built_file
90
+ lane_context[PLATFORM_TO_OUTPUT[platform]] =
91
+ File.absolute_path($1)
70
92
  end
71
93
  end
72
94
  else
73
95
  # fastlane does not fail automatically if we provide a block.
74
- UI.build_error!("flutter build #{platform} has failed.")
96
+ UI.build_failure!("flutter build #{platform} has failed.")
75
97
  end
76
98
  end
77
99
  end
78
-
79
- built_files
80
100
  when 'test'
81
101
  sh *%w(flutter test)
82
102
  when 'analyze'
@@ -200,6 +220,15 @@ module Fastlane
200
220
  is_string: false,
201
221
  default_value: false,
202
222
  ),
223
+ FastlaneCore::ConfigItem.new(
224
+ key: :codesign,
225
+ env_name: 'FL_FLUTTER_CODESIGN',
226
+ description: 'Set to false to skip iOS app signing. This may be ' \
227
+ 'useful e.g. on CI or when signed by Fastlane "sigh"',
228
+ optional: true,
229
+ is_string: false,
230
+ default_value: true,
231
+ ),
203
232
  FastlaneCore::ConfigItem.new(
204
233
  key: :build_number_override,
205
234
  env_name: 'FL_FLUTTER_BUILD_NUMBER_OVERRIDE',
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Flutter
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-flutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Sheremet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-09 00:00:00.000000000 Z
11
+ date: 2018-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry