fastlane-plugin-versioning_android 0.1.0 → 0.1.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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f579270ad456e0040fc01cf9551f47b9021bba4dd71b628e8aab1d4d45e08b99
|
4
|
+
data.tar.gz: d06125c50eb443ee7c02a05d199c0e805d6056681114c9614dc745b4494fbbf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 615e6e368ff5da83b8233a83aa5a94f41f8b626b24cb94eaccc584ad2de95158df75405ee194e746624cf429dcac0c77952d1cc75f847dbb5b115194034e3ac0
|
7
|
+
data.tar.gz: 0e6179b2386237fabe5d008bb3a7a467e38430c88cc6857f7a05a1c03469a48dfba76da725adff0c2feb473c1b03c858f24c1f616099880da62fee69f3b12a29
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# versioning_android plugin
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/beplus/fastlane-plugin-versioning_android.svg?branch=master)](https://travis-ci.org/beplus/fastlane-plugin-versioning_android)
|
3
4
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-versioning_android)
|
4
5
|
|
5
6
|
## Getting Started
|
@@ -12,9 +13,12 @@ fastlane add_plugin versioning_android
|
|
12
13
|
|
13
14
|
## About versioning_android
|
14
15
|
|
15
|
-
Android Versioning Plugin for Fastlane
|
16
|
+
Android Versioning Plugin for Fastlane - easily Get / Set `versionCode` and `versionName` on your Android project.
|
17
|
+
|
18
|
+
**Note**: If you need to work with `Build Number` and `Version` on iOS, see [versioning_ios](https://github.com/beplus/fastlane-plugin-versioning_ios)
|
16
19
|
|
17
20
|
### Available actions
|
21
|
+
|
18
22
|
- `android_get_version_code` to get the Version Code
|
19
23
|
- `android_get_version_name` to get the Version Name
|
20
24
|
- `android_set_version_code` to set the new Version Code
|
@@ -24,7 +28,9 @@ Android Versioning Plugin for Fastlane
|
|
24
28
|
|
25
29
|
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`.
|
26
30
|
|
27
|
-
|
31
|
+
### Example project
|
32
|
+
|
33
|
+
**@todo** You can find a fully functional setup of this plugin in the [UdemyFastlane](https://github.com/igorlamos/udemy-fastlane) repo, where you can also find more info about versioning of Android apps.
|
28
34
|
|
29
35
|
## Run tests for this plugin
|
30
36
|
|
@@ -35,13 +41,22 @@ rake
|
|
35
41
|
```
|
36
42
|
|
37
43
|
To automatically fix many of the styling issues, use
|
44
|
+
|
38
45
|
```
|
39
46
|
rubocop -a
|
40
47
|
```
|
41
48
|
|
42
49
|
## Issues and Feedback
|
43
50
|
|
44
|
-
|
51
|
+
### Flutter
|
52
|
+
|
53
|
+
The `android_set_version_name` action on Flutter requires a different usage when setting a specific version.
|
54
|
+
|
55
|
+
To avoid setting a numeral instead of a string in the build.gradle file, the `version_name` argument (string) needs to be wrapped in quotes:
|
56
|
+
|
57
|
+
```rb
|
58
|
+
android_set_version_name(version_name: '"1.23.4"')
|
59
|
+
```
|
45
60
|
|
46
61
|
## Troubleshooting
|
47
62
|
|
@@ -7,7 +7,7 @@ module Fastlane
|
|
7
7
|
class AndroidSetVersionNameAction < Action
|
8
8
|
def self.run(params)
|
9
9
|
gradle_file_path = Helper::VersioningAndroidHelper.get_gradle_file_path(params[:gradle_file])
|
10
|
-
new_version_name = Helper::VersioningAndroidHelper.get_new_version_name(gradle_file_path, params[:version_name])
|
10
|
+
new_version_name = Helper::VersioningAndroidHelper.get_new_version_name(gradle_file_path, params[:version_name], params[:bump_type])
|
11
11
|
# bump_type ||= params[:bump_type]
|
12
12
|
|
13
13
|
saved = Helper::VersioningAndroidHelper.save_key_to_gradle_file(gradle_file_path, "versionName", new_version_name)
|
@@ -13,7 +13,7 @@ module Fastlane
|
|
13
13
|
|
14
14
|
def self.get_gradle_file_path(gradle_file)
|
15
15
|
gradle_file = self.get_gradle_file(gradle_file)
|
16
|
-
return File.expand_path(gradle_file)
|
16
|
+
return File.expand_path(gradle_file)
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.get_new_version_code(gradle_file, new_version_code)
|
@@ -27,20 +27,20 @@ module Fastlane
|
|
27
27
|
|
28
28
|
def self.get_new_version_name(gradle_file, new_version_name, bump_type = nil)
|
29
29
|
if new_version_name.nil?
|
30
|
-
|
31
|
-
|
30
|
+
new_version_name = self.read_key_from_gradle_file(gradle_file, "versionName")
|
31
|
+
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
current_version_parts = new_version_name.split(/[.]/)
|
34
|
+
major = current_version_parts[0].to_i
|
35
|
+
minor = current_version_parts[1].to_i
|
36
|
+
patch = current_version_parts[2].to_i
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
38
|
+
if bump_type == "major"
|
39
|
+
new_version_name = "#{major + 1}.0.0"
|
40
|
+
elsif bump_type == "minor"
|
41
|
+
new_version_name = "#{major}.#{minor + 1}.0"
|
42
|
+
elsif bump_type == "patch"
|
43
|
+
new_version_name = "#{major}.#{minor}.#{patch + 1}"
|
44
44
|
end
|
45
45
|
|
46
46
|
return new_version_name.to_s
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-versioning_android
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Lamos
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 2.66.0
|
125
|
-
description:
|
125
|
+
description:
|
126
126
|
email: igor@be.plus
|
127
127
|
executables: []
|
128
128
|
extensions: []
|
@@ -141,7 +141,7 @@ homepage: https://github.com/beplus/fastlane-plugin-versioning_android
|
|
141
141
|
licenses:
|
142
142
|
- MIT
|
143
143
|
metadata: {}
|
144
|
-
post_install_message:
|
144
|
+
post_install_message:
|
145
145
|
rdoc_options: []
|
146
146
|
require_paths:
|
147
147
|
- lib
|
@@ -156,9 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
|
160
|
-
|
161
|
-
signing_key:
|
159
|
+
rubygems_version: 3.1.6
|
160
|
+
signing_key:
|
162
161
|
specification_version: 4
|
163
162
|
summary: Android Versioning Plugin for Fastlane
|
164
163
|
test_files: []
|