fastlane-plugin-flutter_version 1.0.0 → 1.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 670b4397890bb310deec392a317823c34f8b1f05a893722406a643543a276fc2
|
4
|
+
data.tar.gz: 463f55a332eca718f322d014de707d17919800afc9781ac526207c220766f102
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c3f5f1d14b14ab3b86efe0f9af12f5422d5fbe3e42d012320d536a91c95ce2e41c63b21532a72cd73a9e45a307c95c4144f48d556936c935128af31fd214bdf
|
7
|
+
data.tar.gz: f65a25ad581ab74b06dd7ebd7f0c0cee3440d677e6d0d9746b64d8c58f9873c811e44ec2248f36d47755bc7e5f2f7b043d831ef87d049a2a523c7059730273e5
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# flutter_version plugin
|
1
|
+
# flutter_version (Fastlane plugin)
|
2
2
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
3
|
-
[![All Contributors](https://img.shields.io/badge/all_contributors-
|
3
|
+
[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
|
4
4
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
5
5
|
|
6
6
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-flutter_version)
|
@@ -13,11 +13,37 @@ flutter_version is a Fastlane plugin to retrieve version code from Flutter proje
|
|
13
13
|
|
14
14
|
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-flutter_version`, add it to your project by adding the following lines in `Gemfile`:
|
15
15
|
|
16
|
-
### From GitHub registry (
|
16
|
+
### From GitHub registry (recommended)
|
17
17
|
|
18
|
-
|
18
|
+
Install from the command line:
|
19
19
|
|
20
|
-
|
20
|
+
```bash
|
21
|
+
gem install fastlane-plugin-flutter_version --version "1.0.0" --source "https://rubygems.pkg.github.com/tianhaoz95"
|
22
|
+
```
|
23
|
+
|
24
|
+
Install via Gemfile:
|
25
|
+
|
26
|
+
```bash
|
27
|
+
source "https://rubygems.pkg.github.com/tianhaoz95" do
|
28
|
+
gem "fastlane-plugin-flutter_version", "1.0.0"
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
Check out the instructions in [GitHub Registry](https://github.com/tianhaoz95/fastlane-plugin-flutter_version/packages/143774).
|
33
|
+
|
34
|
+
### From RubyGems registry
|
35
|
+
|
36
|
+
Install from the command line:
|
37
|
+
|
38
|
+
```bash
|
39
|
+
gem install fastlane-plugin-flutter_version
|
40
|
+
```
|
41
|
+
|
42
|
+
Install via Gemfile:
|
43
|
+
|
44
|
+
```bash
|
45
|
+
gem 'fastlane-plugin-flutter_version', '~> 1.0', '>= 1.0.1'
|
46
|
+
```
|
21
47
|
|
22
48
|
Check out the instructions [here](https://rubygems.org/gems/fastlane-plugin-flutter_version).
|
23
49
|
|
@@ -27,17 +53,16 @@ Check out the instructions [here](https://rubygems.org/gems/fastlane-plugin-flut
|
|
27
53
|
gem "fastlane-plugin-flutter_version", git: "https://github.com/tianhaoz95/fastlane-plugin-flutter-version"
|
28
54
|
```
|
29
55
|
|
30
|
-
##
|
31
|
-
|
32
|
-
A plugin to retrieve versioning information for Flutter projects.
|
56
|
+
## Usage
|
33
57
|
|
34
|
-
|
58
|
+
### Android example
|
35
59
|
|
36
60
|
The following example releases a Android app to Google Play Store without needing to manually specify the app version:
|
37
61
|
|
38
62
|
```ruby
|
39
63
|
desc "submit to internal track in Google Play Store"
|
40
64
|
lane :internal do
|
65
|
+
Dir.chdir "../.." do sh("flutter", "build", "appbundle", "--release") end # Call Flutter Build
|
41
66
|
gradle(task: 'bundle', build_type: 'Release')
|
42
67
|
upload_to_play_store(
|
43
68
|
track: 'internal',
|
@@ -53,50 +78,52 @@ The line `flutter_version()` fetches the version information from the `pubspec.y
|
|
53
78
|
|
54
79
|
For more details, check out the [example project configuration](https://github.com/tianhaoz95/photochat/blob/master/photochatapp/android/fastlane/Fastfile).
|
55
80
|
|
56
|
-
|
57
|
-
|
58
|
-
### Install dependencies
|
59
|
-
|
60
|
-
```bash
|
61
|
-
bundle install
|
62
|
-
```
|
81
|
+
### iOS example
|
63
82
|
|
64
|
-
|
83
|
+
The following example releases an iOS app to TestFlight without needing to manually specify the app version or build number:
|
65
84
|
|
66
|
-
```
|
67
|
-
|
85
|
+
```ruby
|
86
|
+
desc "submit to TestFlight"
|
87
|
+
lane :internal do
|
88
|
+
Dir.chdir "../.." do sh("flutter", "build", "ios", "--release", "--no-codesign") end # Call Flutter Build
|
89
|
+
# https://docs.fastlane.tools/actions/increment_version_number/
|
90
|
+
increment_version_number(
|
91
|
+
xcodeproj: "Runner.xcodeproj",
|
92
|
+
version_number: flutter_version()["version_name"] # Set a specific version number
|
93
|
+
)
|
94
|
+
# https://docs.fastlane.tools/actions/increment_build_number/
|
95
|
+
increment_build_number(
|
96
|
+
xcodeproj: "Runner.xcodeproj",
|
97
|
+
build_number: flutter_version()["version_code"] # Set a specific build number
|
98
|
+
)
|
99
|
+
build_app(workspace: "Runner.xcworkspace", export_method: "app-store")
|
100
|
+
upload_to_testflight
|
101
|
+
end
|
68
102
|
```
|
69
103
|
|
70
|
-
###
|
104
|
+
### Available options
|
71
105
|
|
72
|
-
|
106
|
+
| Name | Description | Optional | Type | Default |
|
107
|
+
|:---:|:---:|:---:|:---:|:---:|
|
108
|
+
| `pubspec_location` | The location of the `pubspec.yaml` file (relative to `Fastfile`). For details, see [here](https://tianhaoz.com/fastlane-plugin-flutter_version/#/options?id=flutter-config-file-location). | :white_check_mark: | `String` | `../pubspec.yaml` |
|
109
|
+
| `should_omit_version_code` | If the version code should be omitted for projects that do not use a version code. For details, see [here](https://tianhaoz.com/fastlane-plugin-flutter_version/#/options?id=version-code-omission). | :white_check_mark: | `Boolean` | `false` |
|
73
110
|
|
74
|
-
|
75
|
-
bunlde exec rake
|
76
|
-
```
|
77
|
-
|
78
|
-
To automatically fix many of the styling issues, use
|
111
|
+
## About Fastlane
|
79
112
|
|
80
|
-
|
81
|
-
bundle exec rake rubocop:auto_correct -a
|
82
|
-
```
|
113
|
+
Fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
83
114
|
|
84
|
-
|
115
|
+
### Issues and feedback
|
85
116
|
|
86
117
|
For any other issues and feedback about this plugin, please submit it to [this repository](https://github.com/tianhaoz95/fastlane-plugin-flutter_version).
|
87
118
|
|
88
|
-
|
119
|
+
### Troubleshooting
|
89
120
|
|
90
121
|
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
91
122
|
|
92
|
-
|
123
|
+
### Using Fastlane plugins
|
93
124
|
|
94
125
|
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
95
126
|
|
96
|
-
## About Fastlane
|
97
|
-
|
98
|
-
Fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
99
|
-
|
100
127
|
## Contributors ✨
|
101
128
|
|
102
129
|
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
@@ -106,13 +133,22 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
106
133
|
<!-- markdownlint-disable -->
|
107
134
|
<table>
|
108
135
|
<tr>
|
109
|
-
<td align="center"><a href="https://www.shunkakinoki.com/"><img src="https://avatars0.githubusercontent.com/u/39187513?v=4" width="100px;" alt=""/><br /><sub><b>Shun Kakinoki</b></sub></a><br /><a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=shunkakinoki" title="Code">💻</a></td>
|
110
|
-
<td align="center"><a href="http://tianhaoz.com"><img src="https://avatars3.githubusercontent.com/u/16887772?v=4" width="100px;" alt=""/><br /><sub><b>Tianhao Zhou</b></sub></a><br /><a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=tianhaoz95" title="Code">💻</a></td>
|
136
|
+
<td align="center"><a href="https://www.shunkakinoki.com/"><img src="https://avatars0.githubusercontent.com/u/39187513?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shun Kakinoki</b></sub></a><br /><a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=shunkakinoki" title="Code">💻</a></td>
|
137
|
+
<td align="center"><a href="http://tianhaoz.com"><img src="https://avatars3.githubusercontent.com/u/16887772?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tianhao Zhou</b></sub></a><br /><a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=tianhaoz95" title="Code">💻</a></td>
|
138
|
+
<td align="center"><a href="https://github.com/davidbrenner"><img src="https://avatars3.githubusercontent.com/u/236870?v=4?s=100" width="100px;" alt=""/><br /><sub><b>davidbrenner</b></sub></a><br /><a href="#ideas-davidbrenner" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=davidbrenner" title="Documentation">📖</a></td>
|
139
|
+
<td align="center"><a href="http://lahaus.com"><img src="https://avatars2.githubusercontent.com/u/76348?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Daniel Gomez</b></sub></a><br /><a href="#ideas-danielgomezrico" title="Ideas, Planning, & Feedback">🤔</a></td>
|
140
|
+
<td align="center"><a href="https://github.com/RtypeStudios"><img src="https://avatars3.githubusercontent.com/u/990114?v=4?s=100" width="100px;" alt=""/><br /><sub><b>RtypeStudios</b></sub></a><br /><a href="#question-RtypeStudios" title="Answering Questions">💬</a> <a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=RtypeStudios" title="Documentation">📖</a> <a href="#tutorial-RtypeStudios" title="Tutorials">✅</a></td>
|
141
|
+
<td align="center"><a href="https://github.com/M123-dev"><img src="https://avatars.githubusercontent.com/u/39344769?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Marvin M</b></sub></a><br /><a href="#ideas-M123-dev" title="Ideas, Planning, & Feedback">🤔</a></td>
|
142
|
+
<td align="center"><a href="https://www.upwork.com/o/profiles/users/~015f2268be670e1246/"><img src="https://avatars.githubusercontent.com/u/8264639?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Muhammad Adil</b></sub></a><br /><a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=ch-muhammad-adil" title="Documentation">📖</a> <a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/issues?q=author%3Ach-muhammad-adil" title="Bug reports">🐛</a></td>
|
143
|
+
</tr>
|
144
|
+
<tr>
|
145
|
+
<td align="center"><a href="https://lesliearkorful.com"><img src="https://avatars.githubusercontent.com/u/4087388?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Leslie Arkorful</b></sub></a><br /><a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/issues?q=author%3Alesliearkorful" title="Bug reports">🐛</a> <a href="https://github.com/tianhaoz95/fastlane-plugin-flutter_version/commits?author=lesliearkorful" title="Documentation">📖</a></td>
|
111
146
|
</tr>
|
112
147
|
</table>
|
113
148
|
|
114
|
-
<!-- markdownlint-
|
149
|
+
<!-- markdownlint-restore -->
|
115
150
|
<!-- prettier-ignore-end -->
|
151
|
+
|
116
152
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
117
153
|
|
118
154
|
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
@@ -10,6 +10,7 @@ module Fastlane
|
|
10
10
|
class FlutterVersionAction < Action
|
11
11
|
def self.run(params)
|
12
12
|
pubspec_location = params[:pubspec_location]
|
13
|
+
should_omit_version_code = params[:should_omit_version_code]
|
13
14
|
begin
|
14
15
|
pubspec = YAML.load_file(pubspec_location)
|
15
16
|
# rubocop:disable Style/RescueStandardError
|
@@ -19,11 +20,19 @@ module Fastlane
|
|
19
20
|
# rubocop:enable Style/RescueStandardError
|
20
21
|
version = pubspec['version']
|
21
22
|
UI.message('The full version is: '.dup.concat(version))
|
22
|
-
|
23
|
+
has_version_code_pattern = version.include?('+')
|
24
|
+
if should_omit_version_code && has_version_code_pattern
|
25
|
+
raise 'Version code omitted but verson code indicator (+) found in pubspec.yml'
|
26
|
+
end
|
27
|
+
if !should_omit_version_code && !has_version_code_pattern
|
23
28
|
raise 'Verson code indicator (+) not found in pubspec.yml'
|
24
29
|
end
|
25
30
|
|
26
|
-
version_sections =
|
31
|
+
version_sections = if should_omit_version_code
|
32
|
+
[version, 'NOT_FOUND']
|
33
|
+
else
|
34
|
+
version.split('+')
|
35
|
+
end
|
27
36
|
version_name = version_sections[0]
|
28
37
|
version_code = version_sections[1]
|
29
38
|
UI.message('The version name: '.dup.concat(version_name))
|
@@ -65,6 +74,14 @@ module Fastlane
|
|
65
74
|
optional: true,
|
66
75
|
type: String,
|
67
76
|
default_value: '../pubspec.yaml'
|
77
|
+
),
|
78
|
+
FastlaneCore::ConfigItem.new(
|
79
|
+
key: :should_omit_version_code,
|
80
|
+
env_name: 'SHOULD_OMIT_VERSION_CODE',
|
81
|
+
description: 'If the version code should be omitted for projects that do not use a version code',
|
82
|
+
optional: true,
|
83
|
+
type: Boolean,
|
84
|
+
default_value: false
|
68
85
|
)
|
69
86
|
]
|
70
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-flutter_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tianhaoz95
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
rubygems_version: 3.0.3
|
170
|
+
rubygems_version: 3.0.3.1
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: A plugin to retrieve versioning information for Flutter projects.
|