fastlane-plugin-gs_versioning 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/lib/fastlane/plugin/gs_versioning.rb +16 -0
- data/lib/fastlane/plugin/gs_versioning/actions/gs_get_versions_filepath.rb +0 -0
- data/lib/fastlane/plugin/gs_versioning/actions/gs_increment_beta_version.rb +109 -0
- data/lib/fastlane/plugin/gs_versioning/actions/gs_increment_rc_version.rb +66 -0
- data/lib/fastlane/plugin/gs_versioning/actions/gs_increment_release_version.rb +67 -0
- data/lib/fastlane/plugin/gs_versioning/actions/gs_save_beta_version.rb +105 -0
- data/lib/fastlane/plugin/gs_versioning/actions/gs_save_rc_version.rb +56 -0
- data/lib/fastlane/plugin/gs_versioning/actions/gs_save_release_version.rb +57 -0
- data/lib/fastlane/plugin/gs_versioning/helper/gs_versioning_helper.rb +12 -0
- data/lib/fastlane/plugin/gs_versioning/version.rb +5 -0
- metadata +153 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a99bce7630864aee19f9861e18f24730b55c1125
|
4
|
+
data.tar.gz: 01ea24993766eab6b9e57f572c609aafbfc572f1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 71daac5d4d9eeccd2e407b986d41fe4c98c5ebbd2cabd544889ac3736c2915232a50353a13e4640c8087d4d33aec604b4a466e2003159119be508770d08e5a0c
|
7
|
+
data.tar.gz: c03b62222f2c84a028595e7cac32ebdcb535649dbbd58f33f47a6efc9594548ca1c3df903576ae6a7a75e30bf9dd1ad51c69490fc229e2874acbaa2de6062408
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 SAVeselovskiy <veselovskiysergey94@gmail.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
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# gs_versioning plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-gs_versioning)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-gs_versioning`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin gs_versioning
|
11
|
+
```
|
12
|
+
|
13
|
+
## About gs_versioning
|
14
|
+
|
15
|
+
Plugin for GradoService versioning system
|
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://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.
|
45
|
+
|
46
|
+
## Using `fastlane` Plugins
|
47
|
+
|
48
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).
|
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).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/gs_versioning/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module GsVersioning
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::GsVersioning.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
File without changes
|
@@ -0,0 +1,109 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class Version
|
4
|
+
attr_accessor :minor, :major, :build
|
5
|
+
|
6
|
+
def initialize(major, minor, build)
|
7
|
+
# assign instance avriables
|
8
|
+
@major, @minor, @build = major,minor,build
|
9
|
+
end
|
10
|
+
def self.parse(parsed)
|
11
|
+
#TODO: впилить проверку на правильный формат
|
12
|
+
{"beta" => self.parse_beta(parsed), "rc" => self.parse_rc(parsed),"release" => self.parse_release(parsed)}
|
13
|
+
end
|
14
|
+
def self.parse_beta(parsed)
|
15
|
+
beta_version = parsed["beta"]["version"]
|
16
|
+
self.parse_string(beta_version)
|
17
|
+
end
|
18
|
+
def self.parse_rc(parsed)
|
19
|
+
rc_version = parsed["rc"]["version"]
|
20
|
+
self.parse_string(rc_version)
|
21
|
+
end
|
22
|
+
def self.parse_release(parsed)
|
23
|
+
release_version = parsed["release"]["version"]
|
24
|
+
self.parse_string(release_version)
|
25
|
+
end
|
26
|
+
def self.parse_string(str)
|
27
|
+
v_elements = str.split(pattern='.')
|
28
|
+
build_value = v_elements[1].split(pattern='(')[1].split(pattern=')')[0]
|
29
|
+
Version.new(v_elements[0].to_i,v_elements[1].to_i,build_value.to_i)
|
30
|
+
end
|
31
|
+
def <= (other)
|
32
|
+
if @major < other.major
|
33
|
+
return true
|
34
|
+
elsif @minor < other.minor
|
35
|
+
return true
|
36
|
+
elsif @build < other.build
|
37
|
+
return true
|
38
|
+
elsif @major == other.major && @minor == other.minor && @build == other.build
|
39
|
+
return true
|
40
|
+
end
|
41
|
+
false
|
42
|
+
end
|
43
|
+
def toString
|
44
|
+
res = @major.to_s + '.' + @minor.to_s + '(' + @build.to_s + ')'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
class FileHelper
|
48
|
+
def self.read(path)
|
49
|
+
file = File.open(path, "r+")
|
50
|
+
res = file.read
|
51
|
+
file.close
|
52
|
+
res
|
53
|
+
end
|
54
|
+
def self.write(path, str)
|
55
|
+
file = File.open(path, "w+")
|
56
|
+
file.write(str)
|
57
|
+
file.close
|
58
|
+
end
|
59
|
+
end
|
60
|
+
class GsIncrementBetaVersionAction < Action
|
61
|
+
def self.run(params)
|
62
|
+
require 'json'
|
63
|
+
require 'fastlane/plugin/versioning/actions/get_version_number_from_plist'
|
64
|
+
jsonstr = FileHelper.read(params[:path]) #TODO: впилить проверку если не указан путь
|
65
|
+
json = JSON.parse(jsonstr)
|
66
|
+
UI.message(json)
|
67
|
+
v = Version.parse(json)
|
68
|
+
v["beta"].build += 1
|
69
|
+
UI.message("New beta version " + v["beta"].to_s)
|
70
|
+
v["beta"]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.description
|
74
|
+
"Plugin for GradoService versioning system"
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.authors
|
78
|
+
["SAVeselovskiy"]
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.return_value
|
82
|
+
# If your method provides a return value, you can describe here what it does
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.details
|
86
|
+
# Optional:
|
87
|
+
"Plugin for GradoService versioning system"
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.available_options
|
91
|
+
[
|
92
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
93
|
+
env_name: "GS_VERSIONS_FILE_PATH",
|
94
|
+
description: "path to versions file",
|
95
|
+
optional: false,
|
96
|
+
type: String)
|
97
|
+
]
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.is_supported?(platform)
|
101
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
102
|
+
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
103
|
+
#
|
104
|
+
# [:ios, :mac, :android].include?(platform)
|
105
|
+
true
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class GsIncrementRcVersionAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
require 'json'
|
6
|
+
require 'fastlane/plugin/versioning/actions/get_version_number_from_plist'
|
7
|
+
jsonstr = FileHelper.read(params[:path]) #TODO: впилить проверку если не указан путь
|
8
|
+
UI.message(jsonstr)
|
9
|
+
json = JSON.parse(jsonstr)
|
10
|
+
v = Version.parse(json)
|
11
|
+
|
12
|
+
build = GetVersionNumberFromPlistAction.run(xcodeproj:ENV["xcodeproj"], target:ENV["target"])
|
13
|
+
major = build.split('.')[0].to_i
|
14
|
+
if major > v["rc"].major
|
15
|
+
v["rc"].major = major
|
16
|
+
v["rc"].minor = 0
|
17
|
+
v["rc"].build = 0
|
18
|
+
elsif major < v["rc"].major
|
19
|
+
raise "Wrong major number specified in Info.plist. Version major number can't be less than current major number on app store (and versions.json file)"
|
20
|
+
elsif v["beta"].major < v["rc"].major || v["beta"].minor < v["rc"].minor
|
21
|
+
v["rc"].build += 1
|
22
|
+
else
|
23
|
+
v["rc"].minor +=1
|
24
|
+
v["rc"].build = 0
|
25
|
+
end
|
26
|
+
res = v["rc"].toString
|
27
|
+
UI.message("New relese_candidate version " + res)
|
28
|
+
v["rc"]
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.description
|
32
|
+
"Plugin for GradoService versioning system"
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.authors
|
36
|
+
["SAVeselovskiy"]
|
37
|
+
end
|
38
|
+
def self.return_value
|
39
|
+
# If your method provides a return value, you can describe here what it does
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.details
|
43
|
+
# Optional:
|
44
|
+
"Plugin for GradoService versioning system"
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.available_options
|
48
|
+
[
|
49
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
50
|
+
env_name: "GS_VERSIONS_FILE_PATH",
|
51
|
+
description: "path to versions file",
|
52
|
+
optional: false,
|
53
|
+
type: String)
|
54
|
+
]
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.is_supported?(platform)
|
58
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
59
|
+
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
60
|
+
#
|
61
|
+
# [:ios, :mac, :android].include?(platform)
|
62
|
+
true
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class GsIncrementReleaseVersionAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
require 'json'
|
6
|
+
require 'fastlane/plugin/versioning/actions/get_version_number_from_plist'
|
7
|
+
jsonstr = FileHelper.read(params[:path]) #TODO: впилить проверку если не указан путь
|
8
|
+
UI.message(jsonstr)
|
9
|
+
json = JSON.parse(jsonstr)
|
10
|
+
v = Version.parse(json)
|
11
|
+
|
12
|
+
build = GetVersionNumberFromPlistAction.run(xcodeproj:ENV["xcodeproj"], target:ENV["target"])
|
13
|
+
major = build.split('.')[0].to_i
|
14
|
+
|
15
|
+
UI.message(v["rc"].toString)
|
16
|
+
UI.message(v["release"].toString)
|
17
|
+
if major < v["release"].major
|
18
|
+
raise "Wrong major number specified in Info.plist. Version major number can't be less than current major number on app store (and versions.json file)"
|
19
|
+
elsif v["rc"] <= v["release"]
|
20
|
+
raise "Release candidate version lower than release version. You have to send release candidate version
|
21
|
+
on TestFlight and test it first. After that you can send version to review."
|
22
|
+
else
|
23
|
+
v["release"] = v["rc"]
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
res = v["release"].toString
|
28
|
+
UI.message("New relese version " + res)
|
29
|
+
v["release"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.description
|
33
|
+
"Plugin for GradoService versioning system"
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.authors
|
37
|
+
["SAVeselovskiy"]
|
38
|
+
end
|
39
|
+
def self.return_value
|
40
|
+
# If your method provides a return value, you can describe here what it does
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.details
|
44
|
+
# Optional:
|
45
|
+
"Plugin for GradoService versioning system"
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.available_options
|
49
|
+
[
|
50
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
51
|
+
env_name: "GS_VERSIONS_FILE_PATH",
|
52
|
+
description: "path to versions file",
|
53
|
+
optional: false,
|
54
|
+
type: String)
|
55
|
+
]
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.is_supported?(platform)
|
59
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
60
|
+
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
61
|
+
#
|
62
|
+
# [:ios, :mac, :android].include?(platform)
|
63
|
+
true
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class Version
|
4
|
+
attr_accessor :minor, :major, :build
|
5
|
+
|
6
|
+
def initialize(major, minor, build)
|
7
|
+
# assign instance avriables
|
8
|
+
@major, @minor, @build = major,minor,build
|
9
|
+
end
|
10
|
+
def self.parse(parsed)
|
11
|
+
#TODO: впилить проверку на правильный формат
|
12
|
+
{"beta" => self.parse_beta(parsed), "rc" => self.parse_rc(parsed),"release" => self.parse_release(parsed)}
|
13
|
+
end
|
14
|
+
def self.parse_beta(parsed)
|
15
|
+
beta_version = parsed["beta"]["version"]
|
16
|
+
self.parse_string(beta_version)
|
17
|
+
end
|
18
|
+
def self.parse_rc(parsed)
|
19
|
+
rc_version = parsed["rc"]["version"]
|
20
|
+
self.parse_string(rc_version)
|
21
|
+
end
|
22
|
+
def self.parse_release(parsed)
|
23
|
+
release_version = parsed["release"]["version"]
|
24
|
+
self.parse_string(release_version)
|
25
|
+
end
|
26
|
+
def self.parse_string(str)
|
27
|
+
v_elements = str.split(pattern='.')
|
28
|
+
build_value = v_elements[1].split(pattern='(')[1].split(pattern=')')[0]
|
29
|
+
Version.new(v_elements[0].to_i,v_elements[1].to_i,build_value.to_i)
|
30
|
+
end
|
31
|
+
|
32
|
+
def toString
|
33
|
+
res = @major.to_s + '.' + @minor.to_s + '(' + @build.to_s + ')'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
class FileHelper
|
37
|
+
def self.read(path)
|
38
|
+
file = File.open(path, "r+")
|
39
|
+
res = file.read
|
40
|
+
file.close
|
41
|
+
res
|
42
|
+
end
|
43
|
+
def self.write(path, str)
|
44
|
+
file = File.open(path, "w+")
|
45
|
+
file.write(str)
|
46
|
+
file.close
|
47
|
+
end
|
48
|
+
end
|
49
|
+
class GsSaveBetaVersionAction < Action
|
50
|
+
def self.run(params)
|
51
|
+
require 'json'
|
52
|
+
jsonstr = FileHelper.read(params[:path]) #TODO: впилить проверку если не указан путь
|
53
|
+
json = JSON.parse(jsonstr)
|
54
|
+
UI.message(json)
|
55
|
+
v = Version.parse(json)
|
56
|
+
res = params[:version].toString
|
57
|
+
UI.message("New beta version " + res)
|
58
|
+
json["beta"]["version"] = res
|
59
|
+
FileHelper.write(params[:path],json.to_json)
|
60
|
+
UI.message("The gs_versioning plugin is working!")
|
61
|
+
"res"
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.description
|
65
|
+
"Plugin for GradoService versioning system"
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.authors
|
69
|
+
["SAVeselovskiy"]
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.return_value
|
73
|
+
# If your method provides a return value, you can describe here what it does
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.details
|
77
|
+
# Optional:
|
78
|
+
"Plugin for GradoService versioning system"
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.available_options
|
82
|
+
[
|
83
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
84
|
+
env_name: "GS_VERSIONS_FILE_PATH",
|
85
|
+
description: "path to versions file",
|
86
|
+
optional: false,
|
87
|
+
type: String),
|
88
|
+
FastlaneCore::ConfigItem.new(key: :version,
|
89
|
+
env_name: "GS_APP_VERSION",
|
90
|
+
description: "App version",
|
91
|
+
optional: false,
|
92
|
+
type: Version)
|
93
|
+
]
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.is_supported?(platform)
|
97
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
98
|
+
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
99
|
+
#
|
100
|
+
# [:ios, :mac, :android].include?(platform)
|
101
|
+
true
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class GsSaveRcVersionAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
require 'json'
|
6
|
+
jsonstr = FileHelper.read(params[:path]) #TODO: впилить проверку если не указан путь
|
7
|
+
UI.message(jsonstr)
|
8
|
+
json = JSON.parse(jsonstr)
|
9
|
+
res = params[:version].toString
|
10
|
+
UI.message("New relese_candidate version " + res)
|
11
|
+
json["rc"]["version"] = res
|
12
|
+
FileHelper.write(params[:path],json.to_json)
|
13
|
+
UI.message("The gs_versioning plugin is working!")
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.description
|
17
|
+
"Plugin for GradoService versioning system"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.authors
|
21
|
+
["SAVeselovskiy"]
|
22
|
+
end
|
23
|
+
def self.return_value
|
24
|
+
# If your method provides a return value, you can describe here what it does
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.details
|
28
|
+
# Optional:
|
29
|
+
"Plugin for GradoService versioning system"
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.available_options
|
33
|
+
[
|
34
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
35
|
+
env_name: "GS_VERSIONS_FILE_PATH",
|
36
|
+
description: "path to versions file",
|
37
|
+
optional: false,
|
38
|
+
type: String),
|
39
|
+
FastlaneCore::ConfigItem.new(key: :version,
|
40
|
+
env_name: "GS_APP_VERSION",
|
41
|
+
description: "App version",
|
42
|
+
optional: false,
|
43
|
+
type: Version)
|
44
|
+
]
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.is_supported?(platform)
|
48
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
49
|
+
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
50
|
+
#
|
51
|
+
# [:ios, :mac, :android].include?(platform)
|
52
|
+
true
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class GsSaveReleaseVersionAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
require 'json'
|
6
|
+
jsonstr = FileHelper.read(params[:path]) #TODO: впилить проверку если не указан путь
|
7
|
+
UI.message(jsonstr)
|
8
|
+
json = JSON.parse(jsonstr)
|
9
|
+
res = params[:version].toString
|
10
|
+
UI.message("New relese version " + res)
|
11
|
+
json["release"]["version"] = res
|
12
|
+
json["beta"]["version"] = res
|
13
|
+
FileHelper.write(params[:path],json.to_json)
|
14
|
+
UI.message("The gs_versioning plugin is working!")
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.description
|
18
|
+
"Plugin for GradoService versioning system"
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.authors
|
22
|
+
["SAVeselovskiy"]
|
23
|
+
end
|
24
|
+
def self.return_value
|
25
|
+
# If your method provides a return value, you can describe here what it does
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.details
|
29
|
+
# Optional:
|
30
|
+
"Plugin for GradoService versioning system"
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.available_options
|
34
|
+
[
|
35
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
36
|
+
env_name: "GS_VERSIONS_FILE_PATH",
|
37
|
+
description: "path to versions file",
|
38
|
+
optional: false,
|
39
|
+
type: String),
|
40
|
+
FastlaneCore::ConfigItem.new(key: :version,
|
41
|
+
env_name: "GS_APP_VERSION",
|
42
|
+
description: "App version",
|
43
|
+
optional: false,
|
44
|
+
type: Version)
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.is_supported?(platform)
|
49
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
50
|
+
# See: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
|
51
|
+
#
|
52
|
+
# [:ios, :mac, :android].include?(platform)
|
53
|
+
true
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class GsVersioningHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::GsVersioningHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the gs_versioning plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-gs_versioning
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- SAVeselovskiy
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fastlane-plugin-versioning
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: fastlane
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.107.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.107.0
|
111
|
+
description:
|
112
|
+
email: veselovskiysergey94@gmail.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- lib/fastlane/plugin/gs_versioning/actions/gs_get_versions_filepath.rb
|
118
|
+
- lib/fastlane/plugin/gs_versioning/actions/gs_increment_beta_version.rb
|
119
|
+
- lib/fastlane/plugin/gs_versioning/actions/gs_increment_rc_version.rb
|
120
|
+
- lib/fastlane/plugin/gs_versioning/actions/gs_increment_release_version.rb
|
121
|
+
- lib/fastlane/plugin/gs_versioning/actions/gs_save_beta_version.rb
|
122
|
+
- lib/fastlane/plugin/gs_versioning/actions/gs_save_rc_version.rb
|
123
|
+
- lib/fastlane/plugin/gs_versioning/actions/gs_save_release_version.rb
|
124
|
+
- lib/fastlane/plugin/gs_versioning/helper/gs_versioning_helper.rb
|
125
|
+
- lib/fastlane/plugin/gs_versioning/version.rb
|
126
|
+
- lib/fastlane/plugin/gs_versioning.rb
|
127
|
+
- README.md
|
128
|
+
- LICENSE
|
129
|
+
homepage: https://github.com/SAVeselovskiy/gs_versioning
|
130
|
+
licenses:
|
131
|
+
- MIT
|
132
|
+
metadata: {}
|
133
|
+
post_install_message:
|
134
|
+
rdoc_options: []
|
135
|
+
require_paths:
|
136
|
+
- lib
|
137
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
+
requirements:
|
139
|
+
- - '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - '>='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
requirements: []
|
148
|
+
rubyforge_project:
|
149
|
+
rubygems_version: 2.0.14.1
|
150
|
+
signing_key:
|
151
|
+
specification_version: 4
|
152
|
+
summary: Plugin for GradoService versioning system
|
153
|
+
test_files: []
|