fastlane-plugin-flutter 0.1.16 → 0.2.0
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: f0cb39c89f3fbcde4fcf59cfc54c1db29e892422
|
4
|
+
data.tar.gz: 52b6ca96f4a4d9ce291456fd657a8a93864fc16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 402189c1cad467be3634c24bcf08773364a448da9f8c3be6481d9392a00be8b2cdd25a0831182f707801716ff86d35632662a3dda8407ea1dba9d9ddeb2ec01d
|
7
|
+
data.tar.gz: d6dbd28f31bb8e3f730c63727734ab23a412c97383d603155436b8912abe9cf47e907aa551de066eded33c5b0696ad26f928920dfbdb280c294ff3236c513247
|
@@ -9,8 +9,9 @@ module Fastlane
|
|
9
9
|
module SharedValues
|
10
10
|
FLUTTER_OUTPUT_APP = :FLUTTER_OUTPUT_APP
|
11
11
|
FLUTTER_OUTPUT_APK = :FLUTTER_OUTPUT_APK
|
12
|
-
|
13
|
-
|
12
|
+
FLUTTER_OUTPUT_BUILD_NUMBER_OVERRIDE =
|
13
|
+
:FLUTTER_OUTPUT_BUILD_NUMBER_OVERRIDE
|
14
|
+
FLUTTER_OUTPUT_BUILD_NAME_OVERRIDE = :FLUTTER_OUTPUT_BUILD_NAME_OVERRIDE
|
14
15
|
end
|
15
16
|
|
16
17
|
class FlutterAction < Action
|
@@ -38,21 +39,17 @@ module Fastlane
|
|
38
39
|
additional_args = []
|
39
40
|
additional_args.push('--debug') if params[:debug]
|
40
41
|
|
41
|
-
if
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
if lane_context[SharedValues::FLUTTER_OUTPUT_BUILD_NUMBER_OVERRIDE] =
|
43
|
+
build_number = Helper::FlutterHelper.build_number(
|
44
|
+
params[:build_number_override]
|
45
|
+
)
|
45
46
|
additional_args.push('--build-number', build_number.to_s)
|
47
|
+
end
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
--dirty=#{params[:git_version_dirty_mark]}
|
52
|
-
)
|
53
|
-
).strip
|
54
|
-
lane_context[SharedValues::FLUTTER_OUTPUT_GIT_BUILD_NAME] =
|
55
|
-
build_name
|
49
|
+
if lane_context[SharedValues::FLUTTER_OUTPUT_BUILD_NAME_OVERRIDE] =
|
50
|
+
build_name = Helper::FlutterHelper.build_name(
|
51
|
+
params[:build_name_override]
|
52
|
+
)
|
56
53
|
additional_args.push('--build-name', build_name)
|
57
54
|
end
|
58
55
|
|
@@ -204,19 +201,46 @@ module Fastlane
|
|
204
201
|
default_value: false,
|
205
202
|
),
|
206
203
|
FastlaneCore::ConfigItem.new(
|
207
|
-
key: :
|
208
|
-
env_name: '
|
209
|
-
description: '
|
204
|
+
key: :build_number_override,
|
205
|
+
env_name: 'FL_FLUTTER_BUILD_NUMBER_OVERRIDE',
|
206
|
+
description: <<-'DESCRIPTION',
|
207
|
+
Override build number in pubspec.yaml. Can be either a number, or
|
208
|
+
a schema definition, ex.: ci (take from CI) vcs (take from Git),
|
209
|
+
ci+1000 (take from CI and add 1000).
|
210
|
+
WARNING: does not override Android build number specified in
|
211
|
+
pubspec.yaml due to Flutter bug:
|
212
|
+
https://github.com/flutter/flutter/issues/22788.
|
213
|
+
DESCRIPTION
|
210
214
|
optional: true,
|
211
|
-
|
212
|
-
|
215
|
+
verify_block: proc do |value|
|
216
|
+
begin
|
217
|
+
Helper::FlutterHelper.build_number(value)
|
218
|
+
rescue ArgumentError => e
|
219
|
+
UI.user_error!(e.message)
|
220
|
+
end
|
221
|
+
end,
|
213
222
|
),
|
214
223
|
FastlaneCore::ConfigItem.new(
|
215
|
-
key: :
|
216
|
-
env_name: '
|
217
|
-
description: '
|
224
|
+
key: :build_name_override,
|
225
|
+
env_name: 'FL_FLUTTER_BUILD_NAME_OVERRIDE',
|
226
|
+
description: <<-'DESCRIPTION',
|
227
|
+
Override build name in pubspec.yaml. Can be either a string, or a
|
228
|
+
schema definition, ex.: vcs* (take from VCS, add "*" for dirty
|
229
|
+
tree), vcs (take from VCS, no dirty mark).
|
230
|
+
NOTE: for App Store, must be in the format of at most 3 integeres
|
231
|
+
separated by a dot (".").
|
232
|
+
WARNING: does not override Android build number specified in
|
233
|
+
pubspec.yaml due to Flutter bug:
|
234
|
+
https://github.com/flutter/flutter/issues/22788.
|
235
|
+
DESCRIPTION
|
218
236
|
optional: true,
|
219
|
-
|
237
|
+
verify_block: proc do |value|
|
238
|
+
begin
|
239
|
+
Helper::FlutterHelper.build_name(value)
|
240
|
+
rescue ArgumentError => e
|
241
|
+
UI.user_error!(e.message)
|
242
|
+
end
|
243
|
+
end,
|
220
244
|
),
|
221
245
|
# l10n settings
|
222
246
|
FastlaneCore::ConfigItem.new(
|
@@ -57,6 +57,40 @@ module Fastlane
|
|
57
57
|
end
|
58
58
|
differencies
|
59
59
|
end
|
60
|
+
|
61
|
+
def self.build_number(schema)
|
62
|
+
schema and Integer(schema)
|
63
|
+
rescue ArgumentError
|
64
|
+
build_number_source, build_number_base = schema.split('+', 2)
|
65
|
+
|
66
|
+
case build_number_source
|
67
|
+
when 'vcs'
|
68
|
+
build_number = Integer(sh(*%w(git rev-list --count HEAD)).strip)
|
69
|
+
when 'ci'
|
70
|
+
begin
|
71
|
+
build_number = Integer(ENV['TRAVIS_BUILD_NUMBER'] ||
|
72
|
+
ENV['CIRCLE_BUILD_NUM'])
|
73
|
+
rescue ArgumentError
|
74
|
+
raise if ENV.key?('CI')
|
75
|
+
raise ArgumentError, 'CI version requested, but not running on a CI'
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
if build_number_base
|
80
|
+
build_number + Integer(build_number_base)
|
81
|
+
else
|
82
|
+
build_number
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.build_name(schema)
|
87
|
+
if schema && schema.start_with?('vcs')
|
88
|
+
dirty_mark = schema['vcs'.size..-1]
|
89
|
+
sh(*%W(git describe --tags --dirty=#{dirty_mark})).strip
|
90
|
+
else
|
91
|
+
schema
|
92
|
+
end
|
93
|
+
end
|
60
94
|
end
|
61
95
|
end
|
62
96
|
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.
|
4
|
+
version: 0.2.0
|
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-
|
11
|
+
date: 2018-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|