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: 512186627d9a812af0d7e8429a7fece5da8eebb51980011a58aeb96489f49701
4
- data.tar.gz: 544eb7cff0758a7e6691ceabe5f2fb83bb116916ef1867cd6b4106aac3e000bb
3
+ metadata.gz: 72062642dce0b537558b2a480a19a1c31c4cfd3c119a0278e12e2d25eae3c7d6
4
+ data.tar.gz: d5574a0cfe29e50524f3dc94c88aa3692bda2ea6988fe40d17f7306e52901666
5
5
  SHA512:
6
- metadata.gz: 3a4a6a0469a305b0f865f56cfa58a00eaf096142910310f84d03bc03124d40f92206ce3f5f774386aa872326243e73e5cb7bbaab3e58947b8331f672273e7637
7
- data.tar.gz: 4efc7f6d4e36f16b652c4966f882fae70021510e09ed7e724ad93a7f2a297898a82517cc8dca8923d574e846c3c221997fc68374ebdc38349857c4019df3f526
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-2-orange.svg?style=flat-square)](#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 (Recommended)
16
+ ### From GitHub registry (recommended)
17
17
 
18
- Check out the instructions [here](https://github.com/tianhaoz95/fastlane-plugin-flutter_version/packages/143774).
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
- ## About flutter_version
44
+ ## Usage
31
45
 
32
- A plugin to retrieve versioning information for Flutter projects.
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
- ## For developers
57
-
58
- ### Install dependencies
59
-
60
- ```bash
61
- bundle install
62
- ```
68
+ ### iOS example
63
69
 
64
- If the command above complains about permission issue, use:
70
+ The following example releases an iOS app to TestFlight without needing to manually specify the app version or build number:
65
71
 
66
- ```bash
67
- sudo bundle install --path ./vendor/bundle
68
- ```
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
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
- To automatically fix many of the styling issues, use
90
+ ### Available options
79
91
 
80
- ```bash
81
- bundle exec rake rubocop:auto_correct -a
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
- unless version.include?('+')
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 = version.split('+')
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fastlane
4
4
  module FlutterVersion
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
7
7
  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.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-09-05 00:00:00.000000000 Z
11
+ date: 2020-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler