flutter_version_toolkit 0.4.0 → 0.5.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: 39266d57796319599936c017800611fbd64d03d638087841ea0d46f4a726d973
4
- data.tar.gz: 2f17edee7182ce8ae94e4fb971c84d52b2e97651963879611fe28f444d19300c
3
+ metadata.gz: d03456451cf8ecdf70f48599409279e95259e0674fe2bc4de074bfcdb5665c9a
4
+ data.tar.gz: 35d454dea96df3795c40e17a408498606b6473da666ee180668a568771739734
5
5
  SHA512:
6
- metadata.gz: dd8df34081850aa3a56f6d9d0e27f499cb5c5e1107d109a1d4313e874e4e9b4159ca500fd948b05d554fef30027c26b3dad0c032a3ece8ab06d6ffe9d31efc1b
7
- data.tar.gz: bfe8446db2458e9e8d8c762adbd554a66c89098759fae1fd13c5365cfee4debfdfa83535255e3949ec7211f9259d74fce37a540d318de38898b9c5a08c72c85b
6
+ metadata.gz: 7bacfc01f5f326ca3cdf06903b4a759ff4a69fbf6a81fbe81c392999e90664a827847e57c641a322873d9bdd11eb09e4ad66cd4fea6b55a6a68b93841cf68e2d
7
+ data.tar.gz: 95de50149da7985942df63cf0283ecc576fe2873dbe6a2a52e82b2a416099b0badb4e379f1fa6f21c87ca5cd609489eb8ed6d50bad484664fa827ee3c76d4f17
data/README.md CHANGED
@@ -10,74 +10,11 @@ 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
-
17
13
  ## About flutter_version_toolkit
18
14
 
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.
15
+ A tool that help get version name and number from pubspec.yaml file in a flutter project
30
16
 
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
- ```
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.
81
18
 
82
19
  ## Example
83
20
 
@@ -5,10 +5,7 @@ module Fastlane
5
5
  module Actions
6
6
  class FlutterVersionToolkitAction < Action
7
7
  def self.run(params)
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
8
+ UI.message("The flutter_version_toolkit plugin is working!")
12
9
  end
13
10
 
14
11
  def self.description
@@ -20,24 +17,21 @@ module Fastlane
20
17
  end
21
18
 
22
19
  def self.return_value
23
- "Returns a VersionInfo object with version name and build number, "
20
+ # If your method provides a return value, you can describe here what it does
24
21
  end
25
22
 
26
23
  def self.details
27
24
  # Optional:
28
- "Hello world"
25
+ ".."
29
26
  end
30
27
 
31
28
  def self.available_options
32
29
  [
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
- ),
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)
41
35
  ]
42
36
  end
43
37
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FlutterVersionToolkit
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
@@ -6,11 +6,6 @@ module Fastlane
6
6
  def self.all_classes
7
7
  Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
8
  end
9
-
10
- # Add method to read version from pubspec
11
- def self.read_version_from_pubspec
12
- Helper::FlutterVersionHelper.read_version_from_pubspec
13
- end
14
9
  end
15
10
  end
16
11
 
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.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanni Prasad
@@ -16,8 +16,6 @@ extra_rdoc_files: []
16
16
  files:
17
17
  - LICENSE
18
18
  - README.md
19
- - lib/fastlane/plugin/flutter_version/helper/flutter_version_helper.rb
20
- - lib/fastlane/plugin/flutter_version/helper/version_info.rb
21
19
  - lib/fastlane/plugin/flutter_version_toolkit.rb
22
20
  - lib/fastlane/plugin/flutter_version_toolkit/actions/flutter_version_toolkit_action.rb
23
21
  - lib/fastlane/plugin/flutter_version_toolkit/helper/flutter_version_toolkit_helper.rb
@@ -1,35 +0,0 @@
1
- require 'yaml'
2
-
3
- module Fastlane
4
- module Helper
5
- class FlutterVersionHelper
6
- def self.read_version_from_pubspec
7
- pubspec_path = 'pubspec.yaml'
8
-
9
- # Check if pubspec.yaml exists
10
- unless File.exist?(pubspec_path)
11
- UI.user_error!("Could not find pubspec.yaml in current directory")
12
- return nil
13
- end
14
-
15
- begin
16
- # Read and parse pubspec.yaml
17
- pubspec = YAML.load_file(pubspec_path)
18
-
19
- version_name = pubspec['version']&.split('+')&.first
20
- build_number = pubspec['version']&.split('+')&.last
21
-
22
- if version_name.nil? || build_number.nil?
23
- UI.user_error!("Could not find version information in pubspec.yaml")
24
- return nil
25
- end
26
-
27
- Fastlane::FlutterVersion::VersionInfo.new(version_name, build_number)
28
- rescue => e
29
- UI.error("Error reading pubspec.yaml: #{e.message}")
30
- return nil
31
- end
32
- end
33
- end
34
- end
35
- end
@@ -1,12 +0,0 @@
1
- module Fastlane
2
- module FlutterVersion
3
- class VersionInfo
4
- attr_reader :version_name, :build_number
5
-
6
- def initialize(version_name, build_number)
7
- @version_name = version_name
8
- @build_number = build_number
9
- end
10
- end
11
- end
12
- end