fastlane-plugin-flutter_version 1.0.0 → 1.0.1
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: 72062642dce0b537558b2a480a19a1c31c4cfd3c119a0278e12e2d25eae3c7d6
|
4
|
+
data.tar.gz: d5574a0cfe29e50524f3dc94c88aa3692bda2ea6988fe40d17f7306e52901666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6947376adb60e834f72e92bd171c30de595eb5628844183b6a15968c0b4e1594477fc97ff8e2480a73a2e0f3b527326018ca2382c03cb72d947d1cece319294
|
7
|
+
data.tar.gz: f78067f666324d7022f3dc3adb7c844395571f9020b5ded531a4c50002616edcd6bafa824f61c043344b8b732a9ad9fac6fb872eaa48d45cf0685803fa7efe46
|
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-4-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,9 +13,23 @@ 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
|
+
|
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).
|
19
33
|
|
20
34
|
### From gem registry
|
21
35
|
|
@@ -27,11 +41,9 @@ Check out the instructions [here](https://rubygems.org/gems/fastlane-plugin-flut
|
|
27
41
|
gem "fastlane-plugin-flutter_version", git: "https://github.com/tianhaoz95/fastlane-plugin-flutter-version"
|
28
42
|
```
|
29
43
|
|
30
|
-
##
|
44
|
+
## Usage
|
31
45
|
|
32
|
-
|
33
|
-
|
34
|
-
## Example
|
46
|
+
### Android example
|
35
47
|
|
36
48
|
The following example releases a Android app to Google Play Store without needing to manually specify the app version:
|
37
49
|
|
@@ -53,33 +65,34 @@ The line `flutter_version()` fetches the version information from the `pubspec.y
|
|
53
65
|
|
54
66
|
For more details, check out the [example project configuration](https://github.com/tianhaoz95/photochat/blob/master/photochatapp/android/fastlane/Fastfile).
|
55
67
|
|
56
|
-
|
57
|
-
|
58
|
-
### Install dependencies
|
59
|
-
|
60
|
-
```bash
|
61
|
-
bundle install
|
62
|
-
```
|
68
|
+
### iOS example
|
63
69
|
|
64
|
-
|
70
|
+
The following example releases an iOS app to TestFlight without needing to manually specify the app version or build number:
|
65
71
|
|
66
|
-
```
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
72
|
+
```ruby
|
73
|
+
desc "submit to TestFlight"
|
74
|
+
lane :internal do
|
75
|
+
# https://docs.fastlane.tools/actions/increment_version_number/
|
76
|
+
increment_version_number(
|
77
|
+
xcodeproj: "Runner.xcodeproj",
|
78
|
+
version_number: flutter_version()["version_name"] # Set a specific version number
|
79
|
+
)
|
80
|
+
# https://docs.fastlane.tools/actions/increment_build_number/
|
81
|
+
increment_build_number(
|
82
|
+
xcodeproj: "Runner.xcodeproj",
|
83
|
+
build_number: flutter_version()["version_code"] # Set a specific build number
|
84
|
+
)
|
85
|
+
build_app(workspace: "Runner.xcworkspace", export_method: "app-store")
|
86
|
+
upload_to_testflight
|
87
|
+
end
|
76
88
|
```
|
77
89
|
|
78
|
-
|
90
|
+
### Available options
|
79
91
|
|
80
|
-
|
81
|
-
|
82
|
-
|
92
|
+
| Name | Description | Optional | Type | Default |
|
93
|
+
|:---:|:---:|:---:|:---:|:---:|
|
94
|
+
| `pubspec_location` | The location of the `pubspec.yaml` file. | :white_check_mark: | `String` | `../pubspec.yaml` |
|
95
|
+
| `should_omit_version_code` | If the version code should be omitted for projects that do not use a version code. | :white_check_mark: | `Boolean` | `false` |
|
83
96
|
|
84
97
|
## Issues and feedback
|
85
98
|
|
@@ -108,6 +121,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
108
121
|
<tr>
|
109
122
|
<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
123
|
<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>
|
124
|
+
<td align="center"><a href="https://github.com/davidbrenner"><img src="https://avatars3.githubusercontent.com/u/236870?v=4" 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>
|
125
|
+
<td align="center"><a href="http://lahaus.com"><img src="https://avatars2.githubusercontent.com/u/76348?v=4" width="100px;" alt=""/><br /><sub><b>Daniel Gomez</b></sub></a><br /><a href="#ideas-danielgomezrico" title="Ideas, Planning, & Feedback">🤔</a></td>
|
111
126
|
</tr>
|
112
127
|
</table>
|
113
128
|
|
@@ -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.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tianhaoz95
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|