fastlane-plugin-flutter_version 0.1.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +78 -12
- data/lib/fastlane/plugin/flutter_version.rb +5 -2
- data/lib/fastlane/plugin/flutter_version/actions/flutter_version_action.rb +40 -24
- data/lib/fastlane/plugin/flutter_version/helper/flutter_version_helper.rb +7 -4
- data/lib/fastlane/plugin/flutter_version/version.rb +3 -1
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 512186627d9a812af0d7e8429a7fece5da8eebb51980011a58aeb96489f49701
|
4
|
+
data.tar.gz: 544eb7cff0758a7e6691ceabe5f2fb83bb116916ef1867cd6b4106aac3e000bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a4a6a0469a305b0f865f56cfa58a00eaf096142910310f84d03bc03124d40f92206ce3f5f774386aa872326243e73e5cb7bbaab3e58947b8331f672273e7637
|
7
|
+
data.tar.gz: 4efc7f6d4e36f16b652c4966f882fae70021510e09ed7e724ad93a7f2a297898a82517cc8dca8923d574e846c3c221997fc68374ebdc38349857c4019df3f526
|
data/README.md
CHANGED
@@ -1,14 +1,28 @@
|
|
1
1
|
# flutter_version plugin
|
2
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
3
|
+
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
|
4
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
2
5
|
|
3
6
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-flutter_version)
|
4
7
|
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/tianhaoz95/fastlane-plugin-flutter_version)
|
8
|
+
[![codecov](https://codecov.io/gh/tianhaoz95/fastlane-plugin-flutter_version/branch/master/graph/badge.svg)](https://codecov.io/gh/tianhaoz95/fastlane-plugin-flutter_version)
|
5
9
|
|
6
10
|
flutter_version is a Fastlane plugin to retrieve version code from Flutter projects which can be used to release changlogs and other metadata to marketplaces.
|
7
11
|
|
8
|
-
##
|
12
|
+
## Installation
|
9
13
|
|
10
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`:
|
11
15
|
|
16
|
+
### From GitHub registry (Recommended)
|
17
|
+
|
18
|
+
Check out the instructions [here](https://github.com/tianhaoz95/fastlane-plugin-flutter_version/packages/143774).
|
19
|
+
|
20
|
+
### From gem registry
|
21
|
+
|
22
|
+
Check out the instructions [here](https://rubygems.org/gems/fastlane-plugin-flutter_version).
|
23
|
+
|
24
|
+
### Directly from Github
|
25
|
+
|
12
26
|
```Gemfile
|
13
27
|
gem "fastlane-plugin-flutter_version", git: "https://github.com/tianhaoz95/fastlane-plugin-flutter-version"
|
14
28
|
```
|
@@ -19,34 +33,86 @@ A plugin to retrieve versioning information for Flutter projects.
|
|
19
33
|
|
20
34
|
## Example
|
21
35
|
|
22
|
-
|
36
|
+
The following example releases a Android app to Google Play Store without needing to manually specify the app version:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
desc "submit to internal track in Google Play Store"
|
40
|
+
lane :internal do
|
41
|
+
gradle(task: 'bundle', build_type: 'Release')
|
42
|
+
upload_to_play_store(
|
43
|
+
track: 'internal',
|
44
|
+
version_code: flutter_version()["version_code"],
|
45
|
+
aab: '../build/app/outputs/bundle/release/app-release.aab',
|
46
|
+
skip_upload_screenshots: true,
|
47
|
+
skip_upload_images: true
|
48
|
+
)
|
49
|
+
end
|
50
|
+
```
|
23
51
|
|
24
|
-
|
52
|
+
The line `flutter_version()` fetches the version information from the `pubspec.yaml` file from the Flutter project and parses the version information from the file. This is convenient for continuous integration because it saves the effort for developers to keep track of version information in multiple places.
|
25
53
|
|
26
|
-
|
54
|
+
For more details, check out the [example project configuration](https://github.com/tianhaoz95/photochat/blob/master/photochatapp/android/fastlane/Fastfile).
|
55
|
+
|
56
|
+
## For developers
|
57
|
+
|
58
|
+
### Install dependencies
|
59
|
+
|
60
|
+
```bash
|
61
|
+
bundle install
|
62
|
+
```
|
27
63
|
|
64
|
+
If the command above complains about permission issue, use:
|
65
|
+
|
66
|
+
```bash
|
67
|
+
sudo bundle install --path ./vendor/bundle
|
28
68
|
```
|
29
|
-
|
69
|
+
|
70
|
+
### Run tests for this plugin
|
71
|
+
|
72
|
+
To run both the tests, and code style validation, run
|
73
|
+
|
74
|
+
```bash
|
75
|
+
bunlde exec rake
|
30
76
|
```
|
31
77
|
|
32
78
|
To automatically fix many of the styling issues, use
|
33
79
|
|
34
|
-
```
|
35
|
-
rubocop -a
|
80
|
+
```bash
|
81
|
+
bundle exec rake rubocop:auto_correct -a
|
36
82
|
```
|
37
83
|
|
38
|
-
## Issues and
|
84
|
+
## Issues and feedback
|
39
85
|
|
40
|
-
For any other issues and feedback about this plugin, please submit it to this repository.
|
86
|
+
For any other issues and feedback about this plugin, please submit it to [this repository](https://github.com/tianhaoz95/fastlane-plugin-flutter_version).
|
41
87
|
|
42
88
|
## Troubleshooting
|
43
89
|
|
44
90
|
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
45
91
|
|
46
|
-
## Using
|
92
|
+
## Using Fastlane plugins
|
47
93
|
|
48
94
|
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
49
95
|
|
50
|
-
## About
|
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
|
+
## Contributors ✨
|
101
|
+
|
102
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
103
|
+
|
104
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
105
|
+
<!-- prettier-ignore-start -->
|
106
|
+
<!-- markdownlint-disable -->
|
107
|
+
<table>
|
108
|
+
<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>
|
111
|
+
</tr>
|
112
|
+
</table>
|
113
|
+
|
114
|
+
<!-- markdownlint-enable -->
|
115
|
+
<!-- prettier-ignore-end -->
|
116
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
51
117
|
|
52
|
-
|
118
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
@@ -1,10 +1,13 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fastlane/plugin/flutter_version/version'
|
2
4
|
|
3
5
|
module Fastlane
|
6
|
+
# The plugin wrapper
|
4
7
|
module FlutterVersion
|
5
8
|
# Return all .rb files inside the "actions" and "helper" directory
|
6
9
|
def self.all_classes
|
7
|
-
Dir[File.expand_path(
|
10
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
11
|
end
|
9
12
|
end
|
10
13
|
end
|
@@ -1,63 +1,79 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fastlane/action'
|
4
|
+
require 'yaml'
|
5
|
+
require_relative '../helper/flutter_version_helper'
|
4
6
|
|
5
7
|
module Fastlane
|
6
8
|
module Actions
|
9
|
+
# The top-level plugin interface
|
7
10
|
class FlutterVersionAction < Action
|
8
11
|
def self.run(params)
|
9
12
|
pubspec_location = params[:pubspec_location]
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
raise
|
13
|
+
begin
|
14
|
+
pubspec = YAML.load_file(pubspec_location)
|
15
|
+
# rubocop:disable Style/RescueStandardError
|
16
|
+
rescue
|
17
|
+
raise 'Read pubspec.yaml failed'
|
18
|
+
end
|
19
|
+
# rubocop:enable Style/RescueStandardError
|
20
|
+
version = pubspec['version']
|
21
|
+
UI.message('The full version is: '.dup.concat(version))
|
22
|
+
unless version.include?('+')
|
23
|
+
raise 'Verson code indicator (+) not found in pubspec.yml'
|
15
24
|
end
|
16
|
-
|
25
|
+
|
26
|
+
version_sections = version.split('+')
|
17
27
|
version_name = version_sections[0]
|
18
28
|
version_code = version_sections[1]
|
19
|
-
UI.message(
|
20
|
-
UI.message(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
29
|
+
UI.message('The version name: '.dup.concat(version_name))
|
30
|
+
UI.message('The version code: '.dup.concat(version_code))
|
31
|
+
{
|
32
|
+
'version_code' => version_code,
|
33
|
+
'version_name' => version_name
|
34
|
+
}
|
25
35
|
end
|
26
36
|
|
27
37
|
def self.description
|
28
|
-
|
38
|
+
'A plugin to retrieve versioning information for Flutter projects.'
|
29
39
|
end
|
30
40
|
|
31
41
|
def self.authors
|
32
|
-
[
|
42
|
+
['tianhaoz95']
|
33
43
|
end
|
34
44
|
|
35
45
|
def self.return_value
|
36
46
|
[
|
37
|
-
[
|
47
|
+
['VERSION_CODE', 'The version code'],
|
48
|
+
['VERSION_NAME', 'The verison name']
|
38
49
|
]
|
39
50
|
end
|
40
51
|
|
41
52
|
def self.details
|
42
|
-
"The plugin reads and parses pubspec.yml of a Flutter
|
53
|
+
"The plugin reads and parses pubspec.yml of a Flutter
|
54
|
+
project and composes the versioning information into
|
55
|
+
structured data to be consumed by various releasing
|
56
|
+
automations."
|
43
57
|
end
|
44
58
|
|
45
59
|
def self.available_options
|
46
60
|
[
|
47
61
|
FastlaneCore::ConfigItem.new(
|
48
62
|
key: :pubspec_location,
|
49
|
-
env_name:
|
50
|
-
description:
|
63
|
+
env_name: 'PUBSPEC_LOCATION',
|
64
|
+
description: 'The location of pubspec.yml',
|
51
65
|
optional: true,
|
52
66
|
type: String,
|
53
|
-
default_value:
|
54
|
-
)
|
67
|
+
default_value: '../pubspec.yaml'
|
68
|
+
)
|
55
69
|
]
|
56
70
|
end
|
57
71
|
|
58
|
-
|
72
|
+
# rubocop:disable Naming/PredicateName
|
73
|
+
def self.is_supported?(_platform)
|
59
74
|
true
|
60
75
|
end
|
76
|
+
# rubocop:enable Naming/PredicateName
|
61
77
|
end
|
62
78
|
end
|
63
79
|
end
|
@@ -1,15 +1,18 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'fastlane_core/ui/ui'
|
4
|
+
|
5
|
+
# Fastlane namespace
|
3
6
|
module Fastlane
|
4
|
-
UI = FastlaneCore::UI unless Fastlane.const_defined?(
|
7
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?('UI')
|
5
8
|
|
6
9
|
module Helper
|
10
|
+
# Generated helper function for the plugin
|
7
11
|
class FlutterVersionHelper
|
8
12
|
# class methods that you define here become available in your action
|
9
13
|
# as `Helper::FlutterVersionHelper.your_method`
|
10
|
-
#
|
11
14
|
def self.show_message
|
12
|
-
UI.message(
|
15
|
+
UI.message('Hello from the flutter_version plugin helper!')
|
13
16
|
end
|
14
17
|
end
|
15
18
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-flutter_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
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-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,21 +25,21 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: fastlane
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.142.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.142.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pry
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,21 +81,21 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rspec_junit_formatter
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
98
|
+
name: rubocop
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rubocop-require_tools
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,19 +123,19 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '0'
|
139
139
|
description:
|
140
140
|
email: tianhaoz@umich.edu
|
141
141
|
executables: []
|
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
160
|
requirements:
|
161
161
|
- - ">="
|
162
162
|
- !ruby/object:Gem::Version
|
163
|
-
version: '
|
163
|
+
version: '2.6'
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
166
|
- - ">="
|