fastlane-plugin-android_versioning_kts 0.2.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: 852c0240e6569bfacdd645ad069a6edb7e8480d366522a61b56e7bb21b29e983
4
- data.tar.gz: 3b24074101209e4e1b524b361085d6ad6ff2fc037542b07976697f445c115066
3
+ metadata.gz: 2956b1ea371117d6a9b3593a205a8ef467cf8004febc361075ca8b8aacda9449
4
+ data.tar.gz: 1545f0a91b4a23491aab64f44a55d3a951534ff57f3911caa75ac496cf8c71b6
5
5
  SHA512:
6
- metadata.gz: 298f29aaf6eaeb7fb2e3a00f6b1e6e06c852ef81bcda7a20b0de2d2554074151870f315a241b34a63127ae70f91d71fe3640b07c1fb4bc880338e65e9fd9a6ad
7
- data.tar.gz: e4c68d187f79caa0a1b7d75f8c453a441b8c9c62385863be7e6e587670f4734fe4b894238d7e46f6e45bdd76ca475b5ac0bbcd690be8060a0d3d1efadd6e2d41
6
+ metadata.gz: 5c67ccbad3f2267f7c53a4f09a231af9122c1e5e6f78d992e6b086039acf6acc6ef3ffc25e7047b17cef9702e12e32921fa75bc3e2c19fecf042c5e6cbcc98c2
7
+ data.tar.gz: d5d4d079801e5bcea33c13f93bf1b10ae0bf979e64f15a33a722344392ea7f079a006e713a397dbfb3ea3d1e3653d39254a71b2df52116a6cf75f89762da7036
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019 zmunm <atheist2197@naver.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 zmunm <atheist2197@naver.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,52 +1,52 @@
1
- # android_versioning_kts plugin
2
-
3
- [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-android_versioning_kts)
4
-
5
- ## Getting Started
6
-
7
- This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-android_versioning_kts`, add it to your project by running:
8
-
9
- ```bash
10
- fastlane add_plugin android_versioning_kts
11
- ```
12
-
13
- ## About android_versioning_kts
14
-
15
- android versioning for gradle kotlin DSL
16
-
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.
18
-
19
- ## Example
20
-
21
- 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`.
22
-
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
24
-
25
- ## Run tests for this plugin
26
-
27
- To run both the tests, and code style validation, run
28
-
29
- ```
30
- rake
31
- ```
32
-
33
- To automatically fix many of the styling issues, use
34
- ```
35
- rubocop -a
36
- ```
37
-
38
- ## Issues and Feedback
39
-
40
- For any other issues and feedback about this plugin, please submit it to this repository.
41
-
42
- ## Troubleshooting
43
-
44
- If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
45
-
46
- ## Using _fastlane_ Plugins
47
-
48
- For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
49
-
50
- ## About _fastlane_
51
-
52
- _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).
1
+ # android_versioning_kts plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-android_versioning_kts)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-android_versioning_kts`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin android_versioning_kts
11
+ ```
12
+
13
+ ## About android_versioning_kts
14
+
15
+ android versioning for gradle kotlin DSL
16
+
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.
18
+
19
+ ## Example
20
+
21
+ 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`.
22
+
23
+ **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
24
+
25
+ ## Run tests for this plugin
26
+
27
+ To run both the tests, and code style validation, run
28
+
29
+ ```
30
+ rake
31
+ ```
32
+
33
+ To automatically fix many of the styling issues, use
34
+ ```
35
+ rubocop -a
36
+ ```
37
+
38
+ ## Issues and Feedback
39
+
40
+ For any other issues and feedback about this plugin, please submit it to this repository.
41
+
42
+ ## Troubleshooting
43
+
44
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
45
+
46
+ ## Using _fastlane_ Plugins
47
+
48
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
49
+
50
+ ## About _fastlane_
51
+
52
+ _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).
@@ -1,118 +1,118 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fileutils'
4
-
5
- module Fastlane
6
- module Actions
7
- class GetValueFromBuildAction < Action
8
- def self.run(params)
9
- app_project_dir ||= params[:app_project_dir]
10
-
11
- type ||= params[:type]
12
-
13
- case type
14
- when 'param'
15
- regex = /
16
- \s*
17
- (?<key>#{params[:key]}\s*=\s*)
18
- (?<left>['"]?)
19
- (?<value>[a-zA-Z0-9._]*)
20
- (?<right>['"]?)
21
- (?<comment>.*)
22
- /x
23
- when 'function'
24
- regex = /
25
- \s*
26
- (?<key>#{params[:key]}\s*\(\s*)
27
- (?<left>['"]?)
28
- (?<value>[a-zA-Z0-9._]*)
29
- (?<right>['"]?)
30
- (?<comment>.*\).*)
31
- /x
32
- else
33
- throw "#{type} is not valid type"
34
- end
35
-
36
- flavor = params[:flavor]
37
- flavor_specified = !(flavor.nil? or flavor.empty?)
38
- regex_flavor = Regexp.new(/[ \t]create\("#{flavor}"\)[ \t]/)
39
- value = ''
40
- found = false
41
- flavor_found = false
42
- product_flavors_section = false
43
-
44
- Dir.glob("#{app_project_dir}/build.gradle.kts") do |path|
45
- UI.verbose("path: #{path}")
46
- UI.verbose("absolute_path: #{File.expand_path(path)}")
47
-
48
- File.open(path, 'r') do |file|
49
- file.each_line do |line|
50
- if flavor_specified && !product_flavors_section
51
- next unless line.include? 'productFlavors'
52
-
53
- product_flavors_section = true
54
- end
55
-
56
- if flavor_specified && !flavor_found
57
- next unless line.match(regex_flavor)
58
-
59
- flavor_found = true
60
- end
61
-
62
- next unless line.match(regex) && !found
63
-
64
- key, left, value, right, comment = line.match(regex).captures
65
- break
66
- end
67
- file.close
68
- end
69
- end
70
- value
71
- end
72
-
73
- #####################################################
74
- # @!group Documentation
75
- #####################################################
76
- def self.available_options
77
- [
78
- FastlaneCore::ConfigItem.new(
79
- key: :app_project_dir,
80
- env_name: 'ANDROID_VERSIONING_APP_PROJECT_DIR',
81
- description: 'The path to the application source folder
82
- in the Android project (default: android/app)',
83
- optional: true,
84
- type: String,
85
- default_value: 'android/app'
86
- ),
87
- FastlaneCore::ConfigItem.new(
88
- key: :flavor,
89
- env_name: 'ANDROID_VERSIONING_FLAVOR',
90
- description: 'The product flavor name (optional)',
91
- optional: true,
92
- type: String
93
- ),
94
- FastlaneCore::ConfigItem.new(
95
- key: :key,
96
- description: 'The property key',
97
- type: String
98
- ),
99
- FastlaneCore::ConfigItem.new(
100
- key: :type,
101
- description: 'The property Type ["function", "param"])',
102
- type: String,
103
- default_value: 'param'
104
- )
105
-
106
- ]
107
- end
108
-
109
- def self.authors
110
- ['zmunm']
111
- end
112
-
113
- def self.is_supported?(platform)
114
- platform == :android
115
- end
116
- end
117
- end
118
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class GetValueFromBuildAction < Action
8
+ def self.run(params)
9
+ app_project_dir ||= params[:app_project_dir]
10
+
11
+ type ||= params[:type]
12
+
13
+ case type
14
+ when 'param'
15
+ regex = /
16
+ \s*
17
+ (?<key>#{params[:key]}\s*=\s*)
18
+ (?<left>['"]?)
19
+ (?<value>[a-zA-Z0-9._]*)
20
+ (?<right>['"]?)
21
+ (?<comment>.*)
22
+ /x
23
+ when 'function'
24
+ regex = /
25
+ \s*
26
+ (?<key>#{params[:key]}\s*\(\s*)
27
+ (?<left>['"]?)
28
+ (?<value>[a-zA-Z0-9._]*)
29
+ (?<right>['"]?)
30
+ (?<comment>.*\).*)
31
+ /x
32
+ else
33
+ throw "#{type} is not valid type"
34
+ end
35
+
36
+ flavor = params[:flavor]
37
+ flavor_specified = !(flavor.nil? || flavor.empty?)
38
+ regex_flavor = Regexp.new(/[ \t]create\("#{flavor}"\)[ \t]/)
39
+ value = ''
40
+ found = false
41
+ flavor_found = false
42
+ product_flavors_section = false
43
+
44
+ Dir.glob("#{app_project_dir}/build.gradle.kts") do |path|
45
+ UI.verbose("path: #{path}")
46
+ UI.verbose("absolute_path: #{File.expand_path(path)}")
47
+
48
+ File.open(path, 'r') do |file|
49
+ file.each_line do |line|
50
+ if flavor_specified && !product_flavors_section
51
+ next unless line.include? 'productFlavors'
52
+
53
+ product_flavors_section = true
54
+ end
55
+
56
+ if flavor_specified && !flavor_found
57
+ next unless line.match(regex_flavor)
58
+
59
+ flavor_found = true
60
+ end
61
+
62
+ next unless line.match(regex) && !found
63
+
64
+ key, left, value, right, comment = line.match(regex).captures
65
+ break
66
+ end
67
+ file.close
68
+ end
69
+ end
70
+ value
71
+ end
72
+
73
+ #####################################################
74
+ # @!group Documentation
75
+ #####################################################
76
+ def self.available_options
77
+ [
78
+ FastlaneCore::ConfigItem.new(
79
+ key: :app_project_dir,
80
+ env_name: 'ANDROID_VERSIONING_APP_PROJECT_DIR',
81
+ description: 'The path to the application source folder
82
+ in the Android project (default: android/app)',
83
+ optional: true,
84
+ type: String,
85
+ default_value: 'android/app'
86
+ ),
87
+ FastlaneCore::ConfigItem.new(
88
+ key: :flavor,
89
+ env_name: 'ANDROID_VERSIONING_FLAVOR',
90
+ description: 'The product flavor name (optional)',
91
+ optional: true,
92
+ type: String
93
+ ),
94
+ FastlaneCore::ConfigItem.new(
95
+ key: :key,
96
+ description: 'The property key',
97
+ type: String
98
+ ),
99
+ FastlaneCore::ConfigItem.new(
100
+ key: :type,
101
+ description: 'The property Type ["function", "param"])',
102
+ type: String,
103
+ default_value: 'param'
104
+ )
105
+
106
+ ]
107
+ end
108
+
109
+ def self.authors
110
+ ['zmunm']
111
+ end
112
+
113
+ def self.is_supported?(platform)
114
+ platform == :android
115
+ end
116
+ end
117
+ end
118
+ end
@@ -1,67 +1,67 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fileutils'
4
-
5
- module Fastlane
6
- module Actions
7
- class GetVersionCodeAction < Action
8
- def self.run(params)
9
- GetValueFromBuildAction.run(
10
- app_project_dir: params[:app_project_dir],
11
- flavor: params[:flavor],
12
- key: 'versionCode',
13
- type: 'param'
14
- )
15
- end
16
-
17
- #####################################################
18
- # @!group Documentation
19
- #####################################################
20
- def self.available_options
21
- [
22
- FastlaneCore::ConfigItem.new(
23
- key: :app_project_dir,
24
- env_name: 'ANDROID_VERSIONING_APP_PROJECT_DIR',
25
- description: 'The path to the application source folder
26
- in the Android project (default: android/app)',
27
- optional: true,
28
- type: String,
29
- default_value: 'android/app'
30
- ),
31
- FastlaneCore::ConfigItem.new(
32
- key: :flavor,
33
- env_name: 'ANDROID_VERSIONING_FLAVOR',
34
- description: 'The product flavor name (optional)',
35
- optional: true,
36
- type: String
37
- )
38
- ]
39
- end
40
-
41
- def self.description
42
- 'Get the version code of your project'
43
- end
44
-
45
- def self.details
46
- [
47
- "This action will return the current version code set
48
- on your project's build.gradle.kts."
49
- ].join(' ')
50
- end
51
-
52
- def self.output
53
- [
54
- ['VERSION_CODE', 'The version code']
55
- ]
56
- end
57
-
58
- def self.authors
59
- ['zmunm']
60
- end
61
-
62
- def self.is_supported?(platform)
63
- platform == :android
64
- end
65
- end
66
- end
67
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class GetVersionCodeAction < Action
8
+ def self.run(params)
9
+ GetValueFromBuildAction.run(
10
+ app_project_dir: params[:app_project_dir],
11
+ flavor: params[:flavor],
12
+ key: 'versionCode',
13
+ type: 'param'
14
+ )
15
+ end
16
+
17
+ #####################################################
18
+ # @!group Documentation
19
+ #####################################################
20
+ def self.available_options
21
+ [
22
+ FastlaneCore::ConfigItem.new(
23
+ key: :app_project_dir,
24
+ env_name: 'ANDROID_VERSIONING_APP_PROJECT_DIR',
25
+ description: 'The path to the application source folder
26
+ in the Android project (default: android/app)',
27
+ optional: true,
28
+ type: String,
29
+ default_value: 'android/app'
30
+ ),
31
+ FastlaneCore::ConfigItem.new(
32
+ key: :flavor,
33
+ env_name: 'ANDROID_VERSIONING_FLAVOR',
34
+ description: 'The product flavor name (optional)',
35
+ optional: true,
36
+ type: String
37
+ )
38
+ ]
39
+ end
40
+
41
+ def self.description
42
+ 'Get the version code of your project'
43
+ end
44
+
45
+ def self.details
46
+ [
47
+ "This action will return the current version code set
48
+ on your project's build.gradle.kts."
49
+ ].join(' ')
50
+ end
51
+
52
+ def self.output
53
+ [
54
+ ['VERSION_CODE', 'The version code']
55
+ ]
56
+ end
57
+
58
+ def self.authors
59
+ ['zmunm']
60
+ end
61
+
62
+ def self.is_supported?(platform)
63
+ platform == :android
64
+ end
65
+ end
66
+ end
67
+ end
@@ -1,66 +1,66 @@
1
- # frozen_string_literal: true
2
-
3
- require 'fileutils'
4
-
5
- module Fastlane
6
- module Actions
7
- class GetVersionNameAction < Action
8
- def self.run(params)
9
- GetValueFromBuildAction.run(
10
- app_project_dir: params[:app_project_dir],
11
- flavor: params[:flavor],
12
- key: 'versionName',
13
- type: 'param'
14
- )
15
- end
16
-
17
- #####################################################
18
- # @!group Documentation
19
- #####################################################
20
- def self.available_options
21
- [
22
- FastlaneCore::ConfigItem.new(
23
- key: :app_project_dir,
24
- env_name: 'ANDROID_VERSIONING_APP_PROJECT_DIR',
25
- description: 'The path to the application source folder in the Android project (default: android/app)',
26
- optional: true,
27
- type: String,
28
- default_value: 'android/app'
29
- ),
30
- FastlaneCore::ConfigItem.new(
31
- key: :flavor,
32
- env_name: 'ANDROID_VERSIONING_FLAVOR',
33
- description: 'The product flavor name (optional)',
34
- optional: true,
35
- type: String
36
- )
37
- ]
38
- end
39
-
40
- def self.description
41
- 'Get the version name of your project'
42
- end
43
-
44
- def self.details
45
- [
46
- "This action will return the current version name set
47
- on your project's build.gradle.kts."
48
- ].join(' ')
49
- end
50
-
51
- def self.output
52
- [
53
- ['VERSION_NAME', 'The version name']
54
- ]
55
- end
56
-
57
- def self.authors
58
- ['zmunm']
59
- end
60
-
61
- def self.is_supported?(platform)
62
- platform == :android
63
- end
64
- end
65
- end
66
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class GetVersionNameAction < Action
8
+ def self.run(params)
9
+ GetValueFromBuildAction.run(
10
+ app_project_dir: params[:app_project_dir],
11
+ flavor: params[:flavor],
12
+ key: 'versionName',
13
+ type: 'param'
14
+ )
15
+ end
16
+
17
+ #####################################################
18
+ # @!group Documentation
19
+ #####################################################
20
+ def self.available_options
21
+ [
22
+ FastlaneCore::ConfigItem.new(
23
+ key: :app_project_dir,
24
+ env_name: 'ANDROID_VERSIONING_APP_PROJECT_DIR',
25
+ description: 'The path to the application source folder in the Android project (default: android/app)',
26
+ optional: true,
27
+ type: String,
28
+ default_value: 'android/app'
29
+ ),
30
+ FastlaneCore::ConfigItem.new(
31
+ key: :flavor,
32
+ env_name: 'ANDROID_VERSIONING_FLAVOR',
33
+ description: 'The product flavor name (optional)',
34
+ optional: true,
35
+ type: String
36
+ )
37
+ ]
38
+ end
39
+
40
+ def self.description
41
+ 'Get the version name of your project'
42
+ end
43
+
44
+ def self.details
45
+ [
46
+ "This action will return the current version name set
47
+ on your project's build.gradle.kts."
48
+ ].join(' ')
49
+ end
50
+
51
+ def self.output
52
+ [
53
+ ['VERSION_NAME', 'The version name']
54
+ ]
55
+ end
56
+
57
+ def self.authors
58
+ ['zmunm']
59
+ end
60
+
61
+ def self.is_supported?(platform)
62
+ platform == :android
63
+ end
64
+ end
65
+ end
66
+ end