fastlane-plugin-flutter_version 0.1.3 → 1.0.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
  SHA256:
3
- metadata.gz: 6a66f9721e5629bffa15e63e174ab0ece2c3927742ab659a9f36351a38bb0e82
4
- data.tar.gz: 0f656f9d433c51ff08428a796d117dd5826fcd41d3724ddab205937a68a9e849
3
+ metadata.gz: 512186627d9a812af0d7e8429a7fece5da8eebb51980011a58aeb96489f49701
4
+ data.tar.gz: 544eb7cff0758a7e6691ceabe5f2fb83bb116916ef1867cd6b4106aac3e000bb
5
5
  SHA512:
6
- metadata.gz: 5440cfaeaaa4715e3db2c9371cbc58930ca29d4142e3a23fbb683d5ef3fdf0c5d4e795d6a0382db03c7f977808e243190873bb4af59a2b185cc85a56bb0d2ef0
7
- data.tar.gz: 85b7a7c8ae3b80a2d70beac18e34533ff3900a78203a6f5b50e4c1f715a2d0fbc46d38c26157646c491cbe98a027fd2e114b0fdaec624af1080ed8f2b3b676e7
6
+ metadata.gz: 3a4a6a0469a305b0f865f56cfa58a00eaf096142910310f84d03bc03124d40f92206ce3f5f774386aa872326243e73e5cb7bbaab3e58947b8331f672273e7637
7
+ data.tar.gz: 4efc7f6d4e36f16b652c4966f882fae70021510e09ed7e724ad93a7f2a297898a82517cc8dca8923d574e846c3c221997fc68374ebdc38349857c4019df3f526
data/README.md CHANGED
@@ -1,12 +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
- ## Getting Started
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.
11
+
12
+ ## Installation
7
13
 
8
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`:
9
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
+
10
26
  ```Gemfile
11
27
  gem "fastlane-plugin-flutter_version", git: "https://github.com/tianhaoz95/fastlane-plugin-flutter-version"
12
28
  ```
@@ -17,34 +33,86 @@ A plugin to retrieve versioning information for Flutter projects.
17
33
 
18
34
  ## Example
19
35
 
20
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
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
+ ```
21
51
 
22
- ## Run tests for this plugin
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.
23
53
 
24
- To run both the tests, and code style validation, run
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
25
57
 
58
+ ### Install dependencies
59
+
60
+ ```bash
61
+ bundle install
26
62
  ```
27
- rake
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
 
30
- To automatically fix many of the styling issues, use
70
+ ### Run tests for this plugin
71
+
72
+ To run both the tests, and code style validation, run
31
73
 
74
+ ```bash
75
+ bunlde exec rake
32
76
  ```
33
- rubocop -a
77
+
78
+ To automatically fix many of the styling issues, use
79
+
80
+ ```bash
81
+ bundle exec rake rubocop:auto_correct -a
34
82
  ```
35
83
 
36
- ## Issues and Feedback
84
+ ## Issues and feedback
37
85
 
38
- 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).
39
87
 
40
88
  ## Troubleshooting
41
89
 
42
90
  If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
43
91
 
44
- ## Using _fastlane_ Plugins
92
+ ## Using Fastlane plugins
45
93
 
46
94
  For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
47
95
 
48
- ## About _fastlane_
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 -->
49
117
 
50
- _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).
118
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
@@ -1,6 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
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
@@ -1,61 +1,79 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane/action'
2
4
  require 'yaml'
3
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
- UI.message("The flutter_version plugin is working!")
10
12
  pubspec_location = params[:pubspec_location]
11
- pubspec = YAML.load_file(pubspec_location)
12
- version = pubspec["version"]
13
- UI.message("The full version is: ".concat(version))
14
- if not version.include? "+"
15
- raise "Verson code indicator (+) not foud in pubspec.yml"
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'
16
24
  end
17
- version_sections = version.split("+")
25
+
26
+ version_sections = version.split('+')
18
27
  version_name = version_sections[0]
19
28
  version_code = version_sections[1]
20
- UI.message("The version name: ".concat(version_name))
21
- UI.message("The version code: ".concat(version_code))
22
- return version_code
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
+ }
23
35
  end
24
36
 
25
37
  def self.description
26
- "A plugin to retrieve versioning information for Flutter projects."
38
+ 'A plugin to retrieve versioning information for Flutter projects.'
27
39
  end
28
40
 
29
41
  def self.authors
30
- ["tianhaoz95"]
42
+ ['tianhaoz95']
31
43
  end
32
44
 
33
45
  def self.return_value
34
46
  [
35
- ['VERSION_CODE', 'The version code']
47
+ ['VERSION_CODE', 'The version code'],
48
+ ['VERSION_NAME', 'The verison name']
36
49
  ]
37
50
  end
38
51
 
39
52
  def self.details
40
- "The plugin reads and parses pubspec.yml of a Flutter project and composes the versioning information into structured data to be consumed by various releasing automations."
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."
41
57
  end
42
58
 
43
59
  def self.available_options
44
60
  [
45
61
  FastlaneCore::ConfigItem.new(
46
62
  key: :pubspec_location,
47
- env_name: "PUBSPEC_LOCATION",
48
- description: "The location of pubspec.yml",
63
+ env_name: 'PUBSPEC_LOCATION',
64
+ description: 'The location of pubspec.yml',
49
65
  optional: true,
50
66
  type: String,
51
- default_value:"../pubspec.yaml"
52
- ),
67
+ default_value: '../pubspec.yaml'
68
+ )
53
69
  ]
54
70
  end
55
71
 
56
- def self.is_supported?(platform)
72
+ # rubocop:disable Naming/PredicateName
73
+ def self.is_supported?(_platform)
57
74
  true
58
75
  end
76
+ # rubocop:enable Naming/PredicateName
59
77
  end
60
78
  end
61
79
  end
@@ -1,15 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fastlane_core/ui/ui'
2
4
 
5
+ # Fastlane namespace
3
6
  module Fastlane
4
- UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
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("Hello from the flutter_version plugin helper!")
15
+ UI.message('Hello from the flutter_version plugin helper!')
13
16
  end
14
17
  end
15
18
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Fastlane
2
4
  module FlutterVersion
3
- VERSION = "0.1.3"
5
+ VERSION = '1.0.0'
4
6
  end
5
7
  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.1.3
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-03-04 00:00:00.000000000 Z
11
+ date: 2020-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: pry
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: bundler
28
+ name: fastlane
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
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: '0'
40
+ version: 2.142.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
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: rspec_junit_formatter
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: rake
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: rubocop
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.49.1
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.49.1
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop-require_tools
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: simplecov
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: fastlane
126
+ name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 2.142.0
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: 2.142.0
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: '0'
163
+ version: '2.6'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - ">="