fastlane-plugin-versioning 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/lib/fastlane/plugin/versioning/actions/get_app_store_version_number.rb +7 -3
- data/lib/fastlane/plugin/versioning/actions/get_build_number_from_plist.rb +7 -3
- data/lib/fastlane/plugin/versioning/actions/get_info_plist_path.rb +52 -6
- data/lib/fastlane/plugin/versioning/actions/get_version_number_from_git_branch.rb +1 -1
- data/lib/fastlane/plugin/versioning/actions/get_version_number_from_plist.rb +7 -3
- data/lib/fastlane/plugin/versioning/actions/increment_build_number_in_plist.rb +7 -3
- data/lib/fastlane/plugin/versioning/actions/increment_version_number_in_plist.rb +11 -8
- data/lib/fastlane/plugin/versioning/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 749bf9d3c7aab89d0b8c8a0f273daabd859891c3
|
4
|
+
data.tar.gz: 62f2d4ceeb98b3de90f3fd607b8d159471960a07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29505ea2cccf47cdb47616d915bd2cca64a762e7173a5b898b87969c9dc651921aceaa0bc299d4ac5758ecb2025d7a96dd07ccede859427d1d0e0b22a77b9a51
|
7
|
+
data.tar.gz: 6c8c51b9672abffa69d158024581c17d5026d69ee6738e43d5a61195f7527420ba48915362e616ed8fc865485ea61a29d74b7c7bbafe73ba1855e9ba7a1e7e72
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Versioning `fastlane` Plugin
|
2
2
|
|
3
|
-
|
3
|
+
![CI Status](https://travis-ci.org/SiarheiFedartsou/fastlane-plugin-versioning.svg?branch=master)
|
4
4
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-versioning)
|
5
5
|
|
6
6
|
|
@@ -15,6 +15,8 @@ fastlane add_plugin versioning
|
|
15
15
|
## About versioning
|
16
16
|
|
17
17
|
Extends fastlane versioning actions. Allows to set/get versions without using agvtool and do some other small tricks.
|
18
|
+
Note that all schemes that you pass to actions like `increment_version_number_in_plist` or `get_info_plist_path` in `scheme` parameter must be shared.
|
19
|
+
To make your scheme shared go to "Manage schemes" in Xcode and tich "Shared" checkbox near your scheme.
|
18
20
|
|
19
21
|
## Actions
|
20
22
|
|
@@ -48,7 +50,7 @@ increment_version_number_in_plist(
|
|
48
50
|
# or if you have multiple xcodeproj's in the root directory)
|
49
51
|
xcodeproj: './path/to/MyApp.xcodeproj'
|
50
52
|
# (optional)
|
51
|
-
target: 'TestTarget'
|
53
|
+
target: 'TestTarget' # or `scheme`
|
52
54
|
)
|
53
55
|
```
|
54
56
|
|
@@ -58,7 +60,7 @@ Get version number from Info.plist of specific target. Doesn't use agvtool (unli
|
|
58
60
|
|
59
61
|
```ruby
|
60
62
|
version = get_version_number_from_plist(xcodeproj: 'Project.xcodeproj', # optional
|
61
|
-
target: 'TestTarget', # optional
|
63
|
+
target: 'TestTarget', # optional, or `scheme`
|
62
64
|
# optional, must be specified if you have different Info.plist build settings
|
63
65
|
# for different build configurations
|
64
66
|
build_configuration_name: 'Release')
|
@@ -69,7 +71,7 @@ version = get_version_number_from_plist(xcodeproj: 'Project.xcodeproj', # option
|
|
69
71
|
|
70
72
|
```ruby
|
71
73
|
version = get_app_store_version_number(xcodeproj: 'Project.xcodeproj', # optional
|
72
|
-
target: 'TestTarget', # optional
|
74
|
+
target: 'TestTarget', # optional, or `scheme`
|
73
75
|
# optional, must be specified if you have different Info.plist build settings
|
74
76
|
# for different build configurations
|
75
77
|
build_configuration_name: 'Release')
|
@@ -105,7 +107,7 @@ Get build number from Info.plist of specific target. Doesn't use agvtool (unlike
|
|
105
107
|
|
106
108
|
```ruby
|
107
109
|
version = get_build_number_from_plist(xcodeproj: "Project.xcodeproj", # optional
|
108
|
-
target: 'TestTarget', # optional
|
110
|
+
target: 'TestTarget', # optional, or `scheme`
|
109
111
|
build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations
|
110
112
|
```
|
111
113
|
|
@@ -115,7 +117,7 @@ version = get_build_number_from_plist(xcodeproj: "Project.xcodeproj", # optional
|
|
115
117
|
Get a path to target's Info.plist
|
116
118
|
```ruby
|
117
119
|
get_info_plist_path(xcodeproj: 'Test.xcodeproj', # optional
|
118
|
-
target: 'TestTarget', # optional
|
120
|
+
target: 'TestTarget', # optional, or `scheme`
|
119
121
|
# optional, must be specified if you have different Info.plist build settings
|
120
122
|
# for different build configurations
|
121
123
|
build_configuration_name: 'Release')
|
@@ -42,9 +42,8 @@ module Fastlane
|
|
42
42
|
env_name: "FL_APPSTORE_VERSION_NUMBER_BUNDLE_ID",
|
43
43
|
description: "Bundle ID of the application",
|
44
44
|
optional: true,
|
45
|
-
conflicting_options: [:xcodeproj, :target, :build_configuration_name],
|
45
|
+
conflicting_options: [:xcodeproj, :target, :scheme, :build_configuration_name],
|
46
46
|
is_string: true),
|
47
|
-
|
48
47
|
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
49
48
|
env_name: "FL_VERSION_NUMBER_PROJECT",
|
50
49
|
description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
|
@@ -57,8 +56,13 @@ module Fastlane
|
|
57
56
|
FastlaneCore::ConfigItem.new(key: :target,
|
58
57
|
env_name: "FL_VERSION_NUMBER_TARGET",
|
59
58
|
optional: true,
|
60
|
-
conflicting_options: [:bundle_id],
|
59
|
+
conflicting_options: [:bundle_id, :scheme],
|
61
60
|
description: "Specify a specific target if you have multiple per project, optional"),
|
61
|
+
FastlaneCore::ConfigItem.new(key: :scheme,
|
62
|
+
env_name: "FL_VERSION_NUMBER_SCHEME",
|
63
|
+
optional: true,
|
64
|
+
conflicting_options: [:bundle_id, :target],
|
65
|
+
description: "Specify a specific scheme if you have multiple per project, optional"),
|
62
66
|
FastlaneCore::ConfigItem.new(key: :build_configuration_name,
|
63
67
|
optional: true,
|
64
68
|
conflicting_options: [:bundle_id],
|
@@ -5,9 +5,7 @@ module Fastlane
|
|
5
5
|
if Helper.test?
|
6
6
|
plist = "/tmp/fastlane/tests/fastlane/Info.plist"
|
7
7
|
else
|
8
|
-
plist = GetInfoPlistPathAction.run(
|
9
|
-
target: params[:target],
|
10
|
-
build_configuration_name: params[:build_configuration_name])
|
8
|
+
plist = GetInfoPlistPathAction.run(params)
|
11
9
|
end
|
12
10
|
|
13
11
|
version_number = GetInfoPlistValueAction.run(path: plist, key: 'CFBundleVersion')
|
@@ -42,7 +40,13 @@ module Fastlane
|
|
42
40
|
FastlaneCore::ConfigItem.new(key: :target,
|
43
41
|
env_name: "FL_BUILD_NUMBER_TARGET",
|
44
42
|
optional: true,
|
43
|
+
conflicting_options: [:scheme],
|
45
44
|
description: "Specify a specific target if you have multiple per project, optional"),
|
45
|
+
FastlaneCore::ConfigItem.new(key: :scheme,
|
46
|
+
env_name: "FL_BUILD_NUMBER_SCHEME",
|
47
|
+
optional: true,
|
48
|
+
conflicting_options: [:target],
|
49
|
+
description: "Specify a specific scheme if you have multiple per project, optional"),
|
46
50
|
FastlaneCore::ConfigItem.new(key: :build_configuration_name,
|
47
51
|
optional: true,
|
48
52
|
description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
|
@@ -13,18 +13,58 @@ module Fastlane
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
config = {project: params[:xcodeproj], scheme: params[:target], configuration: params[:build_configuration_name]}
|
17
|
-
project = FastlaneCore::Project.new(config)
|
18
|
-
project.select_scheme
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
if params[:target] then
|
18
|
+
path = find_path_using_target(params)
|
19
|
+
else
|
20
|
+
path = find_path_using_scheme(params)
|
21
|
+
end
|
22
|
+
path
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.find_path_using_target(params)
|
26
|
+
project = Xcodeproj::Project.open(params[:xcodeproj])
|
27
|
+
if params[:target]
|
28
|
+
target = project.targets.detect { |t| t.name == params[:target]}
|
29
|
+
else
|
30
|
+
# firstly we are trying to find modern application target
|
31
|
+
target = project.targets.detect do |t|
|
32
|
+
t.kind_of?(Xcodeproj::Project::Object::PBXNativeTarget) &&
|
33
|
+
t.product_type == 'com.apple.product-type.application'
|
34
|
+
end
|
35
|
+
target = project.targets[0] if target.nil?
|
36
|
+
end
|
37
|
+
|
38
|
+
if params[:build_configuration_name]
|
39
|
+
build_settings = target.build_settings(params[:build_configuration_name])
|
40
|
+
plist = build_settings['INFOPLIST_FILE']
|
41
|
+
else
|
42
|
+
begin
|
43
|
+
plist = target.common_resolved_build_setting('INFOPLIST_FILE')
|
44
|
+
rescue
|
45
|
+
UI.user_error! 'Cannot resolve Info.plist build setting. Maybe you should specify :build_configuration_name?'
|
46
|
+
end
|
23
47
|
end
|
24
48
|
|
49
|
+
path = plist.gsub('$(SRCROOT)', project.path.parent.to_path)
|
50
|
+
unless (Pathname.new path).absolute?
|
51
|
+
path = File.join(project.path.parent.to_path, path)
|
52
|
+
end
|
25
53
|
path
|
26
54
|
end
|
27
55
|
|
56
|
+
def self.find_path_using_scheme(params)
|
57
|
+
config = {project: params[:xcodeproj], scheme: params[:scheme], configuration: params[:build_configuration_name]}
|
58
|
+
project = FastlaneCore::Project.new(config)
|
59
|
+
project.select_scheme
|
60
|
+
|
61
|
+
path = project.build_settings(key: 'INFOPLIST_FILE')
|
62
|
+
unless (Pathname.new path).absolute?
|
63
|
+
path = File.join(Pathname.new(project.path).parent.to_path, path)
|
64
|
+
end
|
65
|
+
path
|
66
|
+
end
|
67
|
+
|
28
68
|
#####################################################
|
29
69
|
# @!group Documentation
|
30
70
|
#####################################################
|
@@ -52,7 +92,13 @@ module Fastlane
|
|
52
92
|
FastlaneCore::ConfigItem.new(key: :target,
|
53
93
|
env_name: "FL_INFO_PLIST_TARGET",
|
54
94
|
optional: true,
|
95
|
+
conflicting_options: [:scheme],
|
55
96
|
description: "Specify a specific target if you have multiple per project, optional"),
|
97
|
+
FastlaneCore::ConfigItem.new(key: :scheme,
|
98
|
+
env_name: "FL_INFO_PLIST_SCHEME",
|
99
|
+
optional: true,
|
100
|
+
conflicting_options: [:target],
|
101
|
+
description: "Specify a specific scheme if you have multiple per project, optional"),
|
56
102
|
FastlaneCore::ConfigItem.new(key: :build_configuration_name,
|
57
103
|
optional: true,
|
58
104
|
description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
|
@@ -5,9 +5,7 @@ module Fastlane
|
|
5
5
|
if Helper.test?
|
6
6
|
plist = "/tmp/fastlane/tests/fastlane/Info.plist"
|
7
7
|
else
|
8
|
-
plist = GetInfoPlistPathAction.run(
|
9
|
-
target: params[:target],
|
10
|
-
build_configuration_name: params[:build_configuration_name])
|
8
|
+
plist = GetInfoPlistPathAction.run(params)
|
11
9
|
end
|
12
10
|
|
13
11
|
version_number = GetInfoPlistValueAction.run(path: plist, key: 'CFBundleShortVersionString')
|
@@ -42,7 +40,13 @@ module Fastlane
|
|
42
40
|
FastlaneCore::ConfigItem.new(key: :target,
|
43
41
|
env_name: "FL_VERSION_NUMBER_TARGET",
|
44
42
|
optional: true,
|
43
|
+
conflicting_options: [:scheme],
|
45
44
|
description: "Specify a specific target if you have multiple per project, optional"),
|
45
|
+
FastlaneCore::ConfigItem.new(key: :scheme,
|
46
|
+
env_name: "FL_VERSION_NUMBER_SCHEME",
|
47
|
+
optional: true,
|
48
|
+
conflicting_options: [:target],
|
49
|
+
description: "Specify a specific scheme if you have multiple per project, optional"),
|
46
50
|
FastlaneCore::ConfigItem.new(key: :build_configuration_name,
|
47
51
|
optional: true,
|
48
52
|
description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
|
@@ -11,9 +11,7 @@ module Fastlane
|
|
11
11
|
if Helper.test?
|
12
12
|
plist = "/tmp/fastlane/tests/fastlane/Info.plist"
|
13
13
|
else
|
14
|
-
plist = GetInfoPlistPathAction.run(
|
15
|
-
target: params[:target],
|
16
|
-
build_configuration_name: params[:build_configuration_name])
|
14
|
+
plist = GetInfoPlistPathAction.run(params)
|
17
15
|
end
|
18
16
|
|
19
17
|
SetInfoPlistValueAction.run(path: plist, key: 'CFBundleVersion', value: next_build_number)
|
@@ -48,7 +46,13 @@ module Fastlane
|
|
48
46
|
FastlaneCore::ConfigItem.new(key: :target,
|
49
47
|
env_name: "FL_VERSION_NUMBER_TARGET",
|
50
48
|
optional: true,
|
49
|
+
conflicting_options: [:scheme],
|
51
50
|
description: "Specify a specific target if you have multiple per project, optional"),
|
51
|
+
FastlaneCore::ConfigItem.new(key: :scheme,
|
52
|
+
env_name: "FL_VERSION_NUMBER_SCHEME",
|
53
|
+
optional: true,
|
54
|
+
conflicting_options: [:target],
|
55
|
+
description: "Specify a specific scheme if you have multiple per project, optional"),
|
52
56
|
FastlaneCore::ConfigItem.new(key: :build_configuration_name,
|
53
57
|
optional: true,
|
54
58
|
description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
|
@@ -15,14 +15,14 @@ module Fastlane
|
|
15
15
|
version_array = current_version.split(".").map(&:to_i)
|
16
16
|
case params[:bump_type]
|
17
17
|
when "patch"
|
18
|
-
version_array[2] = version_array[2] + 1
|
18
|
+
version_array[2] = (version_array[2] ? version_array[2] : 0) + 1
|
19
19
|
next_version_number = version_array.join(".")
|
20
20
|
when "minor"
|
21
|
-
version_array[1] = version_array[1] + 1
|
21
|
+
version_array[1] = (version_array[1] ? version_array[1] : 0) + 1
|
22
22
|
version_array[2] = version_array[2] = 0
|
23
23
|
next_version_number = version_array.join(".")
|
24
24
|
when "major"
|
25
|
-
version_array[0] = version_array[0] + 1
|
25
|
+
version_array[0] = (version_array[0] ? version_array[0] : 0) + 1
|
26
26
|
version_array[1] = version_array[1] = 0
|
27
27
|
version_array[1] = version_array[2] = 0
|
28
28
|
next_version_number = version_array.join(".")
|
@@ -32,9 +32,7 @@ module Fastlane
|
|
32
32
|
if Helper.test?
|
33
33
|
plist = "/tmp/fastlane/tests/fastlane/Info.plist"
|
34
34
|
else
|
35
|
-
plist = GetInfoPlistPathAction.run(
|
36
|
-
target: params[:target],
|
37
|
-
build_configuration_name: params[:build_configuration_name])
|
35
|
+
plist = GetInfoPlistPathAction.run(params)
|
38
36
|
end
|
39
37
|
|
40
38
|
SetInfoPlistValueAction.run(path: plist, key: 'CFBundleShortVersionString', value: next_version_number)
|
@@ -69,7 +67,7 @@ module Fastlane
|
|
69
67
|
env_name: "FL_APPSTORE_VERSION_NUMBER_BUNDLE_ID",
|
70
68
|
description: "Bundle ID of the application",
|
71
69
|
optional: true,
|
72
|
-
conflicting_options: [:xcodeproj, :target, :build_configuration_name],
|
70
|
+
conflicting_options: [:xcodeproj, :target, :build_configuration_name, :scheme],
|
73
71
|
is_string: true),
|
74
72
|
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
75
73
|
env_name: "FL_VERSION_NUMBER_PROJECT",
|
@@ -83,8 +81,13 @@ module Fastlane
|
|
83
81
|
FastlaneCore::ConfigItem.new(key: :target,
|
84
82
|
env_name: "FL_VERSION_NUMBER_TARGET",
|
85
83
|
optional: true,
|
86
|
-
conflicting_options: [:bundle_id],
|
84
|
+
conflicting_options: [:bundle_id, :scheme],
|
87
85
|
description: "Specify a specific target if you have multiple per project, optional"),
|
86
|
+
FastlaneCore::ConfigItem.new(key: :scheme,
|
87
|
+
env_name: "FL_VERSION_NUMBER_SCHEME",
|
88
|
+
optional: true,
|
89
|
+
conflicting_options: [:bundle_id, :target],
|
90
|
+
description: "Specify a specific scheme if you have multiple per project, optional"),
|
88
91
|
FastlaneCore::ConfigItem.new(key: :build_configuration_name,
|
89
92
|
optional: true,
|
90
93
|
conflicting_options: [:bundle_id],
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-versioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siarhei Fiedartsou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|