flutter_version_toolkit 0.2.0 → 0.4.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: 736f60244eeed999e2d85c932048d88e9b007f6299faefe99ef862c99a05a24d
4
- data.tar.gz: 9945a963f23120bf40693a25c07b854ffdc813812c139d9367f153acab50e840
3
+ metadata.gz: 39266d57796319599936c017800611fbd64d03d638087841ea0d46f4a726d973
4
+ data.tar.gz: 2f17edee7182ce8ae94e4fb971c84d52b2e97651963879611fe28f444d19300c
5
5
  SHA512:
6
- metadata.gz: 56691cddfb5e553b43a4ecb1bd148eee1842505ee33aa152a51c2be51bb002259d6bb740ceb1678cf820973294812e1f7eedaf755da312e72fd9e5b0abc635c2
7
- data.tar.gz: 444e07fd32ea3042bba137a72ad7cff5cd1dd654a302ca5521ba5cf7081b4f9df882dc52061d0ea971846b2ce5620758a2c84d1514893158171701b3f9248e62
6
+ metadata.gz: dd8df34081850aa3a56f6d9d0e27f499cb5c5e1107d109a1d4313e874e4e9b4159ca500fd948b05d554fef30027c26b3dad0c032a3ece8ab06d6ffe9d31efc1b
7
+ data.tar.gz: bfe8446db2458e9e8d8c762adbd554a66c89098759fae1fd13c5365cfee4debfdfa83535255e3949ec7211f9259d74fce37a540d318de38898b9c5a08c72c85b
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 tool that help get version name and number from pubspec.yaml file in a flutter project
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
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
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
- UI.message("The flutter_version_toolkit plugin is working!")
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,21 +20,24 @@ module Fastlane
17
20
  end
18
21
 
19
22
  def self.return_value
20
- # If your method provides a return value, you can describe here what it does
23
+ "Returns a VersionInfo object with version name and build number, "
21
24
  end
22
25
 
23
26
  def self.details
24
27
  # Optional:
25
- ".."
28
+ "Hello world"
26
29
  end
27
30
 
28
31
  def self.available_options
29
32
  [
30
- # FastlaneCore::ConfigItem.new(key: :your_option,
31
- # env_name: "FLUTTER_VERSION_TOOLKIT_YOUR_OPTION",
32
- # description: "A description of your option",
33
- # optional: false,
34
- # type: String)
33
+ FastlaneCore::ConfigItem.new(
34
+ key: :pubspec_location,
35
+ env_name: 'PUBSPEC_LOCATION',
36
+ description: 'The location of pubspec.yml',
37
+ optional: true,
38
+ type: String,
39
+ default_value: '../pubspec.yaml'
40
+ ),
35
41
  ]
36
42
  end
37
43
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FlutterVersionToolkit
3
- VERSION = "0.2.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flutter_version_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanni Prasad