flutter_version_toolkit 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3df986b51651f5a63e32eb9e5419e8bf39d9a960dac8676266ec6f6db35dd10
|
4
|
+
data.tar.gz: 51b85d778c1be2ba926731b9dca29e460c7bd16ca59ceebff1a469fc9dbbc9e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 149d1f45b0fffdde3da86e5951fb619d4b509dd8c0bf3763e03cc9fb8dca20ce053b4b7a166e83e316bf1f47e9eb92be8207728aefbc1ab0592a27e3c63152fd
|
7
|
+
data.tar.gz: 8e1716b0fd0246c75d03e4d8ea104b21b65d8e3fae37e26978cc220a5da2a48746fb39c3ae015cace5e2c20bae93e0930333e0bbb82feed0d7a66fb4efc3d837
|
data/README.md
CHANGED
@@ -10,11 +10,74 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
|
|
10
10
|
fastlane add_plugin flutter_version_toolkit
|
11
11
|
```
|
12
12
|
|
13
|
+
## Description
|
14
|
+
|
15
|
+
This Fastlane plugin extracts version information from your Flutter project's pubspec.yaml file. It uses an action (defined in flutter_version_toolkit_action.rb) to read the version name and build number, enabling you to integrate version control seamlessly into your deployment process.
|
16
|
+
|
13
17
|
## About flutter_version_toolkit
|
14
18
|
|
15
|
-
A
|
19
|
+
A Fastlane plugin that helps extract version information from your Flutter project's pubspec.yaml file. It provides actions to read the version name and build number, making it easier to integrate version control into your deployment process.
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
In your Fastfile, invoke the plugin as follows:
|
24
|
+
|
25
|
+
The plugin offers the following actions:
|
26
|
+
|
27
|
+
### get_flutter_version_name
|
28
|
+
|
29
|
+
Retrieves the version name from your pubspec.yaml file.
|
16
30
|
|
17
|
-
|
31
|
+
```ruby
|
32
|
+
version_name = get_flutter_version_name(
|
33
|
+
pubspec_path: "./pubspec.yaml" # Optional, defaults to project root
|
34
|
+
)
|
35
|
+
puts "Version name: #{version_name}"
|
36
|
+
```
|
37
|
+
|
38
|
+
### get_flutter_version_code
|
39
|
+
|
40
|
+
Retrieves the version code (build number) from your pubspec.yaml file.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
version_code = get_flutter_version_code(
|
44
|
+
pubspec_path: "./pubspec.yaml" # Optional, defaults to project root
|
45
|
+
)
|
46
|
+
puts "Version code: #{version_code}"
|
47
|
+
```
|
48
|
+
|
49
|
+
## Example Fastfile
|
50
|
+
|
51
|
+
An example Fastfile to use the plugin in an Android deployment lane:
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
default_platform(:android)
|
55
|
+
|
56
|
+
platform :android do
|
57
|
+
desc "Deploy Android app to Play Store"
|
58
|
+
lane :deploy do
|
59
|
+
# Retrieve version information from Flutter's pubspec.yaml
|
60
|
+
version_name = get_flutter_version_name
|
61
|
+
version_code = get_flutter_version_code
|
62
|
+
|
63
|
+
# Use these versions in your build configuration
|
64
|
+
gradle(
|
65
|
+
task: 'assemble',
|
66
|
+
build_type: 'Release',
|
67
|
+
properties: {
|
68
|
+
"versionName" => version_name,
|
69
|
+
"versionCode" => version_code
|
70
|
+
}
|
71
|
+
)
|
72
|
+
|
73
|
+
upload_to_play_store(
|
74
|
+
track: 'internal',
|
75
|
+
version_name: version_name,
|
76
|
+
version_code: version_code
|
77
|
+
)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
```
|
18
81
|
|
19
82
|
## Example
|
20
83
|
|
@@ -5,7 +5,10 @@ module Fastlane
|
|
5
5
|
module Actions
|
6
6
|
class FlutterVersionToolkitAction < Action
|
7
7
|
def self.run(params)
|
8
|
-
|
8
|
+
version_info = Fastlane::FlutterVersionToolkit.read_version_from_pubspec
|
9
|
+
UI.user_error!("Could not retrieve version info from pubspec.yaml") if version_info.nil?
|
10
|
+
UI.message("Version Info: #{version_info.version_name} (build #{version_info.build_number})")
|
11
|
+
return version_info
|
9
12
|
end
|
10
13
|
|
11
14
|
def self.description
|
@@ -17,7 +20,7 @@ module Fastlane
|
|
17
20
|
end
|
18
21
|
|
19
22
|
def self.return_value
|
20
|
-
|
23
|
+
"Returns a VersionInfo object with version name and build number, "
|
21
24
|
end
|
22
25
|
|
23
26
|
def self.details
|