fastlane-plugin-versioning_ios 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 +58 -0
- data/lib/fastlane/plugin/versioning_ios.rb +16 -0
- data/lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb +78 -0
- data/lib/fastlane/plugin/versioning_ios/actions/ios_get_version.rb +78 -0
- data/lib/fastlane/plugin/versioning_ios/actions/ios_set_build_number.rb +99 -0
- data/lib/fastlane/plugin/versioning_ios/actions/ios_set_version.rb +97 -0
- data/lib/fastlane/plugin/versioning_ios/helper/versioning_ios_helper.rb +68 -0
- data/lib/fastlane/plugin/versioning_ios/version.rb +5 -0
- metadata +164 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 43b0fd56934ffd80a4de7e24e8abbff53f242757
|
4
|
+
data.tar.gz: 0ff86f254bf9dca1e7e7d728c44d90d1671c2677
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7c19c77505c26ce1ce765da9f64432454fdb260365f4c46de5692d62241ae4cdc8d9e92b204f142dba1e74be7461ca871b1a3ecbe471f92560ba9d81925e21ca
|
7
|
+
data.tar.gz: 5b46e8366f2f021b90253bd7338b37addd88f568b376356675984d2e0b90ea0ca5ecb80cf0b8bf9459582fae2474e7c3eb2382dec1af723497aaf068df4ced6d
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Igor Lamos <igor@be.plus>
|
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,58 @@
|
|
1
|
+
# versioning_ios plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-versioning_ios)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-versioning_ios`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin versioning_ios
|
11
|
+
```
|
12
|
+
|
13
|
+
## About versioning_ios
|
14
|
+
|
15
|
+
iOS Versioning Plugin for Fastlane
|
16
|
+
|
17
|
+
### Available actions
|
18
|
+
- `ios_get_build_number` to get the Build Number
|
19
|
+
- `ios_get_version` to get the Version
|
20
|
+
- `ios_set_build_number` to set the new Build Number
|
21
|
+
- `ios_set_version` to set the new Version
|
22
|
+
|
23
|
+
## Example
|
24
|
+
|
25
|
+
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
|
+
|
27
|
+
### Example project
|
28
|
+
|
29
|
+
You can find a fully functional setup of this plugin in the [UdemyFastlane](https://github.com/igorlamos/udemy-fastlane) repo, where you also can find more info about versioning of iOS apps.
|
30
|
+
|
31
|
+
## Run tests for this plugin
|
32
|
+
|
33
|
+
To run both the tests, and code style validation, run
|
34
|
+
|
35
|
+
```
|
36
|
+
rake
|
37
|
+
```
|
38
|
+
|
39
|
+
To automatically fix many of the styling issues, use
|
40
|
+
```
|
41
|
+
rubocop -a
|
42
|
+
```
|
43
|
+
|
44
|
+
## Issues and Feedback
|
45
|
+
|
46
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
47
|
+
|
48
|
+
## Troubleshooting
|
49
|
+
|
50
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
51
|
+
|
52
|
+
## Using _fastlane_ Plugins
|
53
|
+
|
54
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
55
|
+
|
56
|
+
## About _fastlane_
|
57
|
+
|
58
|
+
_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/versioning_ios/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module VersioningIos
|
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::VersioningIos.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
IOS_BUILD_NUMBER = :IOS_BUILD_NUMBER
|
5
|
+
end
|
6
|
+
|
7
|
+
class IosGetBuildNumberAction < Action
|
8
|
+
# More information about how to set up your project and how it works:
|
9
|
+
# https://developer.apple.com/library/ios/qa/qa1827/_index.html
|
10
|
+
# Attention: This is NOT the Version - but the Build Number
|
11
|
+
|
12
|
+
def self.run(params)
|
13
|
+
xcodeproj = params[:xcodeproj]
|
14
|
+
|
15
|
+
command_get = Helper::VersioningIosHelper.get_build_number_command(xcodeproj)
|
16
|
+
Helper::VersioningIosHelper.is_agv_enabled(xcodeproj)
|
17
|
+
|
18
|
+
build_number = Helper.test? ? `#{command_get}` : (Actions.sh command_get)
|
19
|
+
build_number = Helper::VersioningIosHelper.parse_build_number(build_number)
|
20
|
+
|
21
|
+
UI.success("👍 Current Build Number is: #{build_number}")
|
22
|
+
|
23
|
+
# Store the Build Number in the shared hash
|
24
|
+
Actions.lane_context[SharedValues::IOS_BUILD_NUMBER] = build_number
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.description
|
28
|
+
"Get the Build Number of your iOS project"
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.details
|
32
|
+
[
|
33
|
+
"This action will return current Build Number of your iOS project.",
|
34
|
+
"You have to set up your Xcode project to use AGV. For more info:",
|
35
|
+
"https://developer.apple.com/library/ios/qa/qa1827/_index.html"
|
36
|
+
].join(' ')
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.available_options
|
40
|
+
[
|
41
|
+
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
42
|
+
env_name: "FL_IOS_GET_BUILD_NUMBER_XCODEPROJ",
|
43
|
+
description: "(optional) Specify the path to your main Xcode project if it isn't in the project root directory",
|
44
|
+
optional: true,
|
45
|
+
verify_block: proc do |value|
|
46
|
+
UI.user_error!("Please specify the path to the project, not workspace") if value.end_with? ".xcworkspace"
|
47
|
+
UI.user_error!("Could not find Xcode project") unless File.exist?(value)
|
48
|
+
end)
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.output
|
53
|
+
[
|
54
|
+
['IOS_BUILD_NUMBER', 'The Build Number of your iOS project']
|
55
|
+
]
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.return_value
|
59
|
+
"The Build Number of your iOS project"
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.authors
|
63
|
+
["Igor Lamoš"]
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.is_supported?(platform)
|
67
|
+
[:ios].include? platform
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.example_code
|
71
|
+
[
|
72
|
+
'build_number = ios_get_build_number # Xcode project is in the project root directory',
|
73
|
+
'build_number = ios_get_build_number(xcodeproj: "/path/to/Project.xcodeproj")'
|
74
|
+
]
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
IOS_VERSION = :IOS_VERSION
|
5
|
+
end
|
6
|
+
|
7
|
+
class IosGetVersionAction < Action
|
8
|
+
# More information about how to set up your project and how it works:
|
9
|
+
# https://developer.apple.com/library/ios/qa/qa1827/_index.html
|
10
|
+
# Attention: This is NOT the Version - but the Build Number
|
11
|
+
|
12
|
+
def self.run(params)
|
13
|
+
xcodeproj = params[:xcodeproj]
|
14
|
+
|
15
|
+
command_get = Helper::VersioningIosHelper.get_version_command(xcodeproj)
|
16
|
+
Helper::VersioningIosHelper.is_agv_enabled(xcodeproj)
|
17
|
+
|
18
|
+
version = Helper.test? ? `#{command_get}` : (Actions.sh command_get)
|
19
|
+
version = Helper::VersioningIosHelper.parse_version(version)
|
20
|
+
|
21
|
+
UI.success("👍 Current Version is: #{version}")
|
22
|
+
|
23
|
+
# Store the Version in the shared hash
|
24
|
+
Actions.lane_context[SharedValues::IOS_VERSION] = version
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.description
|
28
|
+
"Get the Version of your iOS project"
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.details
|
32
|
+
[
|
33
|
+
"This action will return current Version of your iOS project.",
|
34
|
+
"You have to set up your Xcode project to use AGV. For more info:",
|
35
|
+
"https://developer.apple.com/library/ios/qa/qa1827/_index.html"
|
36
|
+
].join(' ')
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.available_options
|
40
|
+
[
|
41
|
+
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
42
|
+
env_name: "FL_IOS_GET_VERSION_XCODEPROJ",
|
43
|
+
description: "(optional) Specify the path to your main Xcode project if it isn't in the project root directory",
|
44
|
+
optional: true,
|
45
|
+
verify_block: proc do |value|
|
46
|
+
UI.user_error!("Please specify the path to the project, not workspace") if value.end_with? ".xcworkspace"
|
47
|
+
UI.user_error!("Could not find Xcode project") unless File.exist?(value)
|
48
|
+
end)
|
49
|
+
]
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.output
|
53
|
+
[
|
54
|
+
['IOS_VERSION', 'The Version of your iOS project']
|
55
|
+
]
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.return_value
|
59
|
+
"The Version of your iOS project"
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.authors
|
63
|
+
["Igor Lamoš"]
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.is_supported?(platform)
|
67
|
+
[:ios].include? platform
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.example_code
|
71
|
+
[
|
72
|
+
'build_number = ios_get_version # Xcode project is in the project root directory',
|
73
|
+
'build_number = ios_get_version(xcodeproj: "/path/to/Project.xcodeproj")'
|
74
|
+
]
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
IOS_NEW_BUILD_NUMBER = :IOS_NEW_BUILD_NUMBER
|
5
|
+
end
|
6
|
+
|
7
|
+
class IosSetBuildNumberAction < Action
|
8
|
+
# More information about how to set up your project and how it works:
|
9
|
+
# https://developer.apple.com/library/ios/qa/qa1827/_index.html
|
10
|
+
# Attention: This is NOT the Version - but the Build Number
|
11
|
+
|
12
|
+
def self.run(params)
|
13
|
+
xcodeproj = params[:xcodeproj]
|
14
|
+
build_number = params[:build_number]
|
15
|
+
|
16
|
+
command_get = Helper::VersioningIosHelper.get_build_number_command(xcodeproj)
|
17
|
+
command_set = Helper::VersioningIosHelper.set_build_number_command(xcodeproj, build_number)
|
18
|
+
Helper::VersioningIosHelper.is_agv_enabled(xcodeproj)
|
19
|
+
|
20
|
+
if Helper.test?
|
21
|
+
`#{command_set}`
|
22
|
+
new_build_number = `#{command_get}`
|
23
|
+
else
|
24
|
+
(Actions.sh command_set)
|
25
|
+
new_build_number = (Actions.sh command_get)
|
26
|
+
end
|
27
|
+
|
28
|
+
new_build_number = Helper::VersioningIosHelper.parse_build_number(new_build_number)
|
29
|
+
|
30
|
+
UI.success("👍 Build Number has been set to: #{new_build_number}")
|
31
|
+
|
32
|
+
# Store the Build Number in the shared hash
|
33
|
+
Actions.lane_context[SharedValues::IOS_NEW_BUILD_NUMBER] = new_build_number
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.description
|
37
|
+
"Set the Build Number of your iOS project"
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.details
|
41
|
+
[
|
42
|
+
"This action will set the new Build Number on your iOS project.",
|
43
|
+
"You have to set up your Xcode project to use AGV. For more info:",
|
44
|
+
"https://developer.apple.com/library/ios/qa/qa1827/_index.html"
|
45
|
+
].join(' ')
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.available_options
|
49
|
+
[
|
50
|
+
FastlaneCore::ConfigItem.new(key: :build_number,
|
51
|
+
env_name: "FL_IOS_SET_BUILD_NUMBER_BUILD_NUMBER",
|
52
|
+
description: "Change to a specific Build Number",
|
53
|
+
optional: true,
|
54
|
+
is_string: false),
|
55
|
+
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
56
|
+
env_name: "FL_IOS_SET_BUILD_NUMBER_XCODEPROJ",
|
57
|
+
description: "(optional) Specify the path to your main Xcode project if it isn't in the project root directory",
|
58
|
+
optional: true,
|
59
|
+
verify_block: proc do |value|
|
60
|
+
UI.user_error!("Please specify the path to the project, not workspace") if value.end_with? ".xcworkspace"
|
61
|
+
UI.user_error!("Could not find Xcode project") unless File.exist?(value)
|
62
|
+
end)
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.output
|
67
|
+
[
|
68
|
+
['IOS_NEW_BUILD_NUMBER', 'The new Build Number of your iOS project']
|
69
|
+
]
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.return_value
|
73
|
+
"The new Build Number of your iOS project"
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.authors
|
77
|
+
["Igor Lamoš"]
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.is_supported?(platform)
|
81
|
+
[:ios].include? platform
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.example_code
|
85
|
+
[
|
86
|
+
'ios_set_build_number # Automatically increment by one',
|
87
|
+
'ios_set_build_number(
|
88
|
+
build_number: "17" # Set a specific number
|
89
|
+
)',
|
90
|
+
'ios_set_build_number(
|
91
|
+
build_number: "17",
|
92
|
+
xcodeproj: "/path/to/Project.xcodeproj" # Xcode project is not in the project root directory
|
93
|
+
)',
|
94
|
+
'build_number = ios_set_build_number # Save returned Build Number to a variable'
|
95
|
+
]
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
IOS_NEW_VERSION = :IOS_NEW_VERSION
|
5
|
+
end
|
6
|
+
|
7
|
+
class IosSetVersionAction < Action
|
8
|
+
# More information about how to set up your project and how it works:
|
9
|
+
# https://developer.apple.com/library/ios/qa/qa1827/_index.html
|
10
|
+
# Attention: This is NOT the Version - but the Build Number
|
11
|
+
|
12
|
+
def self.run(params)
|
13
|
+
xcodeproj = params[:xcodeproj]
|
14
|
+
version = params[:version]
|
15
|
+
|
16
|
+
command_get = Helper::VersioningIosHelper.get_version_command(xcodeproj)
|
17
|
+
command_set = Helper::VersioningIosHelper.set_version_command(xcodeproj, version)
|
18
|
+
Helper::VersioningIosHelper.is_agv_enabled(xcodeproj)
|
19
|
+
|
20
|
+
if Helper.test?
|
21
|
+
`#{command_set}`
|
22
|
+
new_version = `#{command_get}`
|
23
|
+
else
|
24
|
+
(Actions.sh command_set)
|
25
|
+
new_version = (Actions.sh command_get)
|
26
|
+
end
|
27
|
+
|
28
|
+
new_version = Helper::VersioningIosHelper.parse_version(new_version)
|
29
|
+
|
30
|
+
UI.success("👍 Version has been set to: #{new_version}")
|
31
|
+
|
32
|
+
# Store the Version in the shared hash
|
33
|
+
Actions.lane_context[SharedValues::IOS_NEW_VERSION] = new_version
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.description
|
37
|
+
"Set the Version of your iOS project"
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.details
|
41
|
+
[
|
42
|
+
"This action will set the new Version on your iOS project.",
|
43
|
+
"You have to set up your Xcode project to use AGV. For more info:",
|
44
|
+
"https://developer.apple.com/library/ios/qa/qa1827/_index.html"
|
45
|
+
].join(' ')
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.available_options
|
49
|
+
[
|
50
|
+
FastlaneCore::ConfigItem.new(key: :version,
|
51
|
+
env_name: "FL_IOS_SET_VERSION_VERSION",
|
52
|
+
description: "Change to a specific Version",
|
53
|
+
optional: true,
|
54
|
+
is_string: true),
|
55
|
+
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
56
|
+
env_name: "FL_IOS_SET_VERSION_XCODEPROJ",
|
57
|
+
description: "(optional) Specify the path to your main Xcode project if it isn't in the project root directory",
|
58
|
+
optional: true,
|
59
|
+
verify_block: proc do |value|
|
60
|
+
UI.user_error!("Please specify the path to the project, not workspace") if value.end_with? ".xcworkspace"
|
61
|
+
UI.user_error!("Could not find Xcode project") unless File.exist?(value)
|
62
|
+
end)
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.output
|
67
|
+
[
|
68
|
+
['IOS_NEW_VERSION', 'The new Version of your iOS project']
|
69
|
+
]
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.return_value
|
73
|
+
"The new Version of your iOS project"
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.authors
|
77
|
+
["Igor Lamoš"]
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.is_supported?(platform)
|
81
|
+
[:ios].include? platform
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.example_code
|
85
|
+
[
|
86
|
+
'ios_set_version(
|
87
|
+
version: "1.23.4" # Set a specific version
|
88
|
+
)',
|
89
|
+
'ios_set_version(
|
90
|
+
version: "1.23.4", # Set a specific version
|
91
|
+
xcodeproj: "/path/to/Project.xcodeproj" # Xcode project is not in the project root directory
|
92
|
+
)'
|
93
|
+
]
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class VersioningIosHelper
|
4
|
+
require "shellwords"
|
5
|
+
|
6
|
+
XCODEPROJ_TEST = "/tmp/fastlane/tests/versioning/Project.xcodeproj"
|
7
|
+
|
8
|
+
def self.get_xcodeproj(xcodeproj)
|
9
|
+
return Helper.test? ? XCODEPROJ_TEST : xcodeproj
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.get_xcodeproj_path(xcodeproj)
|
13
|
+
project_file = self.get_xcodeproj(xcodeproj)
|
14
|
+
path = project_file ? File.join(project_file, "..") : "."
|
15
|
+
return File.expand_path(path).shellescape
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.get_version_command(xcodeproj)
|
19
|
+
path = self.get_xcodeproj_path(xcodeproj)
|
20
|
+
return [
|
21
|
+
"cd", path, "&&", "agvtool", "what-marketing-version", "-terse1"
|
22
|
+
].join(" ")
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.set_version_command(xcodeproj, version)
|
26
|
+
path = self.get_xcodeproj_path(xcodeproj)
|
27
|
+
version = self.parse_version(version)
|
28
|
+
return [
|
29
|
+
"cd", path, "&&", "agvtool", "new-marketing-version", version
|
30
|
+
].join(" ")
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.get_build_number_command(xcodeproj)
|
34
|
+
path = self.get_xcodeproj_path(xcodeproj)
|
35
|
+
return [
|
36
|
+
"cd", path, "&&", "agvtool", "what-version", "-terse"
|
37
|
+
].join(" ")
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.set_build_number_command(xcodeproj, build_number)
|
41
|
+
path = self.get_xcodeproj_path(xcodeproj)
|
42
|
+
agvtool_command = build_number ? "new-version -all #{self.parse_build_number(build_number)}" : "next-version -all"
|
43
|
+
return [
|
44
|
+
"cd", path, "&&", "agvtool", agvtool_command
|
45
|
+
].join(" ")
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.parse_version(version)
|
49
|
+
# @todo SemVer check
|
50
|
+
return version.to_s.strip
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.parse_build_number(build_number)
|
54
|
+
return build_number.to_s.strip
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.is_agv_enabled(xcodeproj)
|
58
|
+
# We do not want to run agvtool under tests to avoid
|
59
|
+
# output about not having a project configured for AGV
|
60
|
+
command_get = "#{self.get_version_command(xcodeproj)} > /dev/null 2>&1"
|
61
|
+
unless Helper.test?
|
62
|
+
agv_enabled = system(command_get)
|
63
|
+
raise "Apple Generic Versioning (AGV) is not enabled." unless agv_enabled
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-versioning_ios
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Igor Lamoš
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-11-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
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: bundler
|
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: rspec
|
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_junit_formatter
|
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.49.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.49.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: fastlane
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.66.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.66.0
|
125
|
+
description:
|
126
|
+
email: igor@be.plus
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- LICENSE
|
132
|
+
- README.md
|
133
|
+
- lib/fastlane/plugin/versioning_ios.rb
|
134
|
+
- lib/fastlane/plugin/versioning_ios/actions/ios_get_build_number.rb
|
135
|
+
- lib/fastlane/plugin/versioning_ios/actions/ios_get_version.rb
|
136
|
+
- lib/fastlane/plugin/versioning_ios/actions/ios_set_build_number.rb
|
137
|
+
- lib/fastlane/plugin/versioning_ios/actions/ios_set_version.rb
|
138
|
+
- lib/fastlane/plugin/versioning_ios/helper/versioning_ios_helper.rb
|
139
|
+
- lib/fastlane/plugin/versioning_ios/version.rb
|
140
|
+
homepage: https://github.com/beplus/fastlane-plugin-versioning_ios
|
141
|
+
licenses:
|
142
|
+
- MIT
|
143
|
+
metadata: {}
|
144
|
+
post_install_message:
|
145
|
+
rdoc_options: []
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
requirements: []
|
159
|
+
rubyforge_project:
|
160
|
+
rubygems_version: 2.6.13
|
161
|
+
signing_key:
|
162
|
+
specification_version: 4
|
163
|
+
summary: iOS Versioning Plugin for Fastlane
|
164
|
+
test_files: []
|