fastlane-plugin-versioning 0.2.2 → 0.2.3

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
2
  SHA1:
3
- metadata.gz: cbbbad28332e626278229a7a214e3f0ec8dc4c20
4
- data.tar.gz: f3239d376ef003487a78a846fb3098a9237f57dd
3
+ metadata.gz: b5b3fbd5090409c883457e32827f01a8d3027262
4
+ data.tar.gz: cb6cd8fc419e00072986c09d3dae6a2875dd7710
5
5
  SHA512:
6
- metadata.gz: 49d88c3b36fae16417e7e583e5e3e3df5e8e59abef60b726cd9b69fe686a48bf875e1f609213f01d6620b80b50e72a10d0ea59924567b213a0804075617eb091
7
- data.tar.gz: 8759ba9ba99246b3f5a3d6ed9211e294cdfe1ed1878060f60957beb98f07609e10ebd013cf3af3453acd075d0251d5c9846688dd86b496c0d136f836150abfb1
6
+ metadata.gz: 1d89db840e38e53f8e402aa425200336631bd963b231757804ba41680eca53d6fbf78def74b6fe0bd2ebbfe8c86a130842dd2d93947b937ba1734c78a3ba5f14
7
+ data.tar.gz: 267fb796a68ac6239227fa959d1ef7abbdcb96b5e5ab2a452883b6d80d08a7b682b3c76587df557b1c978afeea62721aec81f84e935d425c20a59e8b653619fa
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # fastlane-plugin-versioning `fastlane` Plugin
1
+ # Versioning `fastlane` Plugin
2
2
 
3
3
  [![CI Status](http://img.shields.io/travis/SiarheiFedartsou/fastlane-plugin-versioning.svg?style=flat)](https://travis-ci.org/SiarheiFedartsou/fastlane-plugin-versioning)
4
4
  [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-versioning)
@@ -25,25 +25,30 @@ Increment/set version number in Info.plist of specific target. Doesn't use agvto
25
25
  ```ruby
26
26
  increment_version_number_in_plist # Automatically increment patch version number.
27
27
  increment_version_number_in_plist(
28
- bump_type: "patch" # Automatically increment patch version number
28
+ bump_type: 'patch' # Automatically increment patch version number
29
29
  )
30
30
  increment_version_number_in_plist(
31
- bump_type: "minor" # Automatically increment minor version number
31
+ bump_type: 'minor' # Automatically increment minor version number
32
32
  )
33
33
  increment_version_number_in_plist(
34
- bump_type: "major" # Automatically increment major version number
34
+ bump_type: 'major' # Automatically increment major version number
35
35
  )
36
36
  increment_version_number_in_plist(
37
37
  version_number: '2.1.1' # Set a specific version number
38
38
  )
39
39
  increment_version_number_in_plist(
40
- version_source: 'appstore' # Automatically increment patch version number. Use App Store version number as a source.
40
+ # Automatically increment patch version number. Use App Store version number as a source.
41
+ version_source: 'appstore'
41
42
  )
42
43
 
43
44
  increment_version_number_in_plist(
44
- version_number: '2.1.1', # specify specific version number (optional, omitting it increments patch version number)
45
- xcodeproj: './path/to/MyApp.xcodeproj' # (optional, you must specify the path to your main Xcode project if it is not in the project root directory or you have a multiple xcodeproj's in the root directory)
46
- target: 'TestTarget' # (optional)
45
+ # specify specific version number (optional, omitting it increments patch version number)
46
+ version_number: '2.1.1',
47
+ # (optional, you must specify the path to your main Xcode project if it is not in the project root directory
48
+ # or if you have multiple xcodeproj's in the root directory)
49
+ xcodeproj: './path/to/MyApp.xcodeproj'
50
+ # (optional)
51
+ target: 'TestTarget'
47
52
  )
48
53
  ```
49
54
 
@@ -52,18 +57,22 @@ increment_version_number_in_plist(
52
57
  Get version number from Info.plist of specific target. Doesn't use agvtool (unlike default get_version_number).
53
58
 
54
59
  ```ruby
55
- version = get_version_number_from_plist(xcodeproj: "Project.xcodeproj", # optional
60
+ version = get_version_number_from_plist(xcodeproj: 'Project.xcodeproj', # optional
56
61
  target: 'TestTarget', # optional
57
- build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations
62
+ # optional, must be specified if you have different Info.plist build settings
63
+ # for different build configurations
64
+ build_configuration_name: 'Release')
58
65
  ```
59
66
 
60
67
  ### get_app_store_version_number
61
68
 
62
69
 
63
70
  ```ruby
64
- version = get_app_store_version_number(xcodeproj: "Project.xcodeproj", # optional
71
+ version = get_app_store_version_number(xcodeproj: 'Project.xcodeproj', # optional
65
72
  target: 'TestTarget', # optional
66
- build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations
73
+ # optional, must be specified if you have different Info.plist build settings
74
+ # for different build configurations
75
+ build_configuration_name: 'Release')
67
76
  )
68
77
  version = get_app_store_version_number(bundle_id: 'com.apple.Numbers')
69
78
 
@@ -79,17 +88,35 @@ version = get_version_number_from_git_branch(pattern: 'release-#')
79
88
 
80
89
  ```
81
90
 
91
+ ### increment_build_number_in_plist
92
+
93
+ ```ruby
94
+ increment_build_number_in_plist # Automatically increments build number.
95
+ increment_build_number_in_plist(
96
+ build_number: 42 # set build number to 42
97
+ )
98
+ ```
99
+
100
+ ### get_build_number_from_plist
101
+
102
+ Get build number from Info.plist of specific target. Doesn't use agvtool (unlike default get_build_number).
103
+
104
+ ```ruby
105
+ version = get_version_number_from_plist(xcodeproj: "Project.xcodeproj", # optional
106
+ target: 'TestTarget', # optional
107
+ build_configuration_name: 'Release') # optional, must be specified if you have different Info.plist build settings for different build configurations
108
+ ```
109
+
82
110
 
83
111
  ### get_info_plist_path
84
112
 
85
113
  Get a path to target's Info.plist
86
114
  ```ruby
87
115
  get_info_plist_path(xcodeproj: 'Test.xcodeproj', # optional
88
- target: 'TestTarget', # optional
89
- build_configuration_name: 'Release' # optional, must be specified if you have different Info.plist build settings for different build configurations
90
-
91
-
92
- )
116
+ target: 'TestTarget', # optional
117
+ # optional, must be specified if you have different Info.plist build settings
118
+ # for different build configurations
119
+ build_configuration_name: 'Release')
93
120
  ```
94
121
 
95
122
 
@@ -0,0 +1,68 @@
1
+ module Fastlane
2
+ module Actions
3
+ class GetBuildNumberFromPlistAction < Action
4
+ def self.run(params)
5
+ if Helper.test?
6
+ plist = "/tmp/fastlane/tests/fastlane/Info.plist"
7
+ else
8
+ plist = GetInfoPlistPathAction.run(xcodeproj: params[:xcodeproj],
9
+ target: params[:target],
10
+ build_configuration_name: params[:build_configuration_name])
11
+ end
12
+
13
+ version_number = GetInfoPlistValueAction.run(path: plist, key: 'CFBundleVersion')
14
+ # Store the number in the shared hash
15
+ Actions.lane_context[SharedValues::BUILD_NUMBER] = version_number
16
+ end
17
+
18
+ #####################################################
19
+ # @!group Documentation
20
+ #####################################################
21
+
22
+ def self.description
23
+ "Get the build number of your project"
24
+ end
25
+
26
+ def self.details
27
+ [
28
+ "This action will return the current build number set on your project's Info.plist."
29
+ ].join(' ')
30
+ end
31
+
32
+ def self.available_options
33
+ [
34
+ FastlaneCore::ConfigItem.new(key: :xcodeproj,
35
+ env_name: "FL_BUILD_NUMBER_PROJECT",
36
+ description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
37
+ optional: true,
38
+ verify_block: proc do |value|
39
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
40
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
41
+ end),
42
+ FastlaneCore::ConfigItem.new(key: :target,
43
+ env_name: "FL_BUILD_NUMBER_TARGET",
44
+ optional: true,
45
+ description: "Specify a specific target if you have multiple per project, optional"),
46
+ FastlaneCore::ConfigItem.new(key: :build_configuration_name,
47
+ optional: true,
48
+ description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
49
+
50
+ ]
51
+ end
52
+
53
+ def self.output
54
+ [
55
+ ['BUILD_NUMBER', 'The build number']
56
+ ]
57
+ end
58
+
59
+ def self.authors
60
+ ["SiarheiFedartsou"]
61
+ end
62
+
63
+ def self.is_supported?(platform)
64
+ [:ios, :mac].include? platform
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,73 @@
1
+ module Fastlane
2
+ module Actions
3
+ class IncrementBuildNumberInPlistAction < Action
4
+ def self.run(params)
5
+ if params[:build_number]
6
+ next_build_number = params[:build_number]
7
+ else
8
+ next_build_number = (GetBuildNumberFromPlistAction.run(params).to_i + 1).to_s
9
+ end
10
+
11
+ if Helper.test?
12
+ plist = "/tmp/fastlane/tests/fastlane/Info.plist"
13
+ else
14
+ plist = GetInfoPlistPathAction.run(xcodeproj: params[:xcodeproj],
15
+ target: params[:target],
16
+ build_configuration_name: params[:build_configuration_name])
17
+ end
18
+
19
+ SetInfoPlistValueAction.run(path: plist, key: 'CFBundleVersion', value: next_build_number)
20
+
21
+ Actions.lane_context[SharedValues::BUILD_NUMBER] = next_build_number
22
+ end
23
+
24
+ def self.description
25
+ "Increment the build number of your project"
26
+ end
27
+
28
+ def self.details
29
+ [
30
+ "This action will increment the build number directly in Info.plist. "
31
+ ].join("\n")
32
+ end
33
+
34
+ def self.available_options
35
+ [
36
+ FastlaneCore::ConfigItem.new(key: :build_number,
37
+ env_name: "FL_BUILD_NUMBER_BUILD_NUMBER",
38
+ description: "Change to a specific version",
39
+ optional: true),
40
+ FastlaneCore::ConfigItem.new(key: :xcodeproj,
41
+ env_name: "FL_VERSION_NUMBER_PROJECT",
42
+ description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
43
+ optional: true,
44
+ verify_block: proc do |value|
45
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
46
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
47
+ end),
48
+ FastlaneCore::ConfigItem.new(key: :target,
49
+ env_name: "FL_VERSION_NUMBER_TARGET",
50
+ optional: true,
51
+ description: "Specify a specific target if you have multiple per project, optional"),
52
+ FastlaneCore::ConfigItem.new(key: :build_configuration_name,
53
+ optional: true,
54
+ description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
55
+ ]
56
+ end
57
+
58
+ def self.output
59
+ [
60
+ ['BUILD_NUMBER', 'The new version number']
61
+ ]
62
+ end
63
+
64
+ def self.author
65
+ "SiarheiFedartsou"
66
+ end
67
+
68
+ def self.is_supported?(platform)
69
+ [:ios, :mac].include? platform
70
+ end
71
+ end
72
+ end
73
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Versioning
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
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.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siarhei Fiedartsou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-12 00:00:00.000000000 Z
11
+ date: 2016-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -76,9 +76,11 @@ files:
76
76
  - README.md
77
77
  - lib/fastlane/plugin/versioning.rb
78
78
  - lib/fastlane/plugin/versioning/actions/get_app_store_version_number.rb
79
+ - lib/fastlane/plugin/versioning/actions/get_build_number_from_plist.rb
79
80
  - lib/fastlane/plugin/versioning/actions/get_info_plist_path.rb
80
81
  - lib/fastlane/plugin/versioning/actions/get_version_number_from_git_branch.rb
81
82
  - lib/fastlane/plugin/versioning/actions/get_version_number_from_plist.rb
83
+ - lib/fastlane/plugin/versioning/actions/increment_build_number_in_plist.rb
82
84
  - lib/fastlane/plugin/versioning/actions/increment_version_number_in_plist.rb
83
85
  - lib/fastlane/plugin/versioning/version.rb
84
86
  homepage: https://github.com/SiarheiFedartsou/fastlane-plugin-versioning