fastlane-plugin-versioning 0.2.1 → 0.2.2

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: 3fa4b9519e30c839ea63e93afdcff6c6331702cd
4
- data.tar.gz: 5a9b5dd01541c8ac6bbcab2d70eed0cb4d55761b
3
+ metadata.gz: cbbbad28332e626278229a7a214e3f0ec8dc4c20
4
+ data.tar.gz: f3239d376ef003487a78a846fb3098a9237f57dd
5
5
  SHA512:
6
- metadata.gz: 680dcc55ce815871ff18a41dbe17b0d689742df9890c5dc45c6f233c6de3279d28faf3d2aba8d4d6ffe6f7a78783f1ce12875a128e5e1d681249f71eaba87368
7
- data.tar.gz: a93ad8347af94d395d8fadb8cd45098e6789bb1ab4085f6d3b93c2186e61ec29c37f8e4ae59d1d965b6e3dfeb8ed88c8a730dc679e80bf6899b8050e79c5fa6f
6
+ metadata.gz: 49d88c3b36fae16417e7e583e5e3e3df5e8e59abef60b726cd9b69fe686a48bf875e1f609213f01d6620b80b50e72a10d0ea59924567b213a0804075617eb091
7
+ data.tar.gz: 8759ba9ba99246b3f5a3d6ed9211e294cdfe1ed1878060f60957beb98f07609e10ebd013cf3af3453acd075d0251d5c9846688dd86b496c0d136f836150abfb1
data/README.md CHANGED
@@ -20,7 +20,7 @@ Extends fastlane versioning actions. Allows to set/get versions without using ag
20
20
 
21
21
  ### increment_version_number_in_plist
22
22
 
23
- Increment/set version number in Info.plist of specific target. Doesn't use agvtool (unlike increment_version_number).
23
+ Increment/set version number in Info.plist of specific target. Doesn't use agvtool (unlike default increment_version_number).
24
24
 
25
25
  ```ruby
26
26
  increment_version_number_in_plist # Automatically increment patch version number.
@@ -36,6 +36,9 @@ increment_version_number_in_plist(
36
36
  increment_version_number_in_plist(
37
37
  version_number: '2.1.1' # Set a specific version number
38
38
  )
39
+ increment_version_number_in_plist(
40
+ version_source: 'appstore' # Automatically increment patch version number. Use App Store version number as a source.
41
+ )
39
42
 
40
43
  increment_version_number_in_plist(
41
44
  version_number: '2.1.1', # specify specific version number (optional, omitting it increments patch version number)
@@ -46,7 +49,7 @@ increment_version_number_in_plist(
46
49
 
47
50
  ### get_version_number_from_plist
48
51
 
49
- Get version number from Info.plist of specific target. Doesn't use agvtool (unlike get_version_number).
52
+ Get version number from Info.plist of specific target. Doesn't use agvtool (unlike default get_version_number).
50
53
 
51
54
  ```ruby
52
55
  version = get_version_number_from_plist(xcodeproj: "Project.xcodeproj", # optional
@@ -70,7 +73,7 @@ version = get_app_store_version_number(bundle_id: 'com.apple.Numbers')
70
73
 
71
74
  ```ruby
72
75
  # Extracts version number from git branch name.
73
- # `pattern` is pattern by which version number will be find, `#` is place where action must find version number.
76
+ # `pattern` is pattern by which version number will be found, `#` is place where action must find version number.
74
77
  # Default value is 'release-#'(for instance for branch name 'releases/release-1.5.0' will extract '1.5.0')
75
78
  version = get_version_number_from_git_branch(pattern: 'release-#')
76
79
 
@@ -20,7 +20,7 @@ module Fastlane
20
20
  Net::HTTP.get(uri)
21
21
 
22
22
  response = Net::HTTP.get_response(uri)
23
- UI.crash!("Unexpected status code from iTunes Search API") unless response.is_a?(Net::HTTPSuccess)
23
+ UI.crash!("Unexpected status code from iTunes Search API") unless response.kind_of?(Net::HTTPSuccess)
24
24
  response_body = JSON.parse(response.body)
25
25
 
26
26
  UI.user_error!("Cannot find app with #{bundle_id} bundle ID in the App Store") if response_body["resultCount"] == 0
@@ -45,24 +45,24 @@ module Fastlane
45
45
  conflicting_options: [:xcodeproj, :target, :build_configuration_name],
46
46
  is_string: true),
47
47
 
48
- FastlaneCore::ConfigItem.new(key: :xcodeproj,
49
- env_name: "FL_VERSION_NUMBER_PROJECT",
50
- description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
51
- optional: true,
52
- conflicting_options: [:bundle_id],
53
- verify_block: proc do |value|
54
- UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
55
- UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
56
- end),
57
- FastlaneCore::ConfigItem.new(key: :target,
58
- env_name: "FL_VERSION_NUMBER_TARGET",
59
- optional: true,
60
- conflicting_options: [:bundle_id],
61
- description: "Specify a specific target if you have multiple per project, optional"),
62
- FastlaneCore::ConfigItem.new(key: :build_configuration_name,
63
- optional: true,
64
- conflicting_options: [:bundle_id],
65
- description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
48
+ FastlaneCore::ConfigItem.new(key: :xcodeproj,
49
+ env_name: "FL_VERSION_NUMBER_PROJECT",
50
+ description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
51
+ optional: true,
52
+ conflicting_options: [:bundle_id],
53
+ verify_block: proc do |value|
54
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
55
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
56
+ end),
57
+ FastlaneCore::ConfigItem.new(key: :target,
58
+ env_name: "FL_VERSION_NUMBER_TARGET",
59
+ optional: true,
60
+ conflicting_options: [:bundle_id],
61
+ description: "Specify a specific target if you have multiple per project, optional"),
62
+ FastlaneCore::ConfigItem.new(key: :build_configuration_name,
63
+ optional: true,
64
+ conflicting_options: [:bundle_id],
65
+ description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
66
66
  ]
67
67
  end
68
68
 
@@ -9,7 +9,7 @@ module Fastlane
9
9
  target: params[:target],
10
10
  build_configuration_name: params[:build_configuration_name])
11
11
  end
12
-
12
+
13
13
  version_number = GetInfoPlistValueAction.run(path: plist, key: 'CFBundleShortVersionString')
14
14
  # Store the number in the shared hash
15
15
  Actions.lane_context[SharedValues::VERSION_NUMBER] = version_number
@@ -5,8 +5,12 @@ module Fastlane
5
5
  if params[:version_number]
6
6
  next_version_number = params[:version_number]
7
7
  else
8
- current_version = GetVersionNumberFromPlistAction.run(xcodeproj: params[:xcodeproj],
9
- target: params[:target], build_configuration_name: params[:build_configuration_name])
8
+ case params[:version_source]
9
+ when "plist"
10
+ current_version = GetVersionNumberFromPlistAction.run(params)
11
+ when "appstore"
12
+ current_version = GetAppStoreVersionNumberAction.run(params)
13
+ end
10
14
 
11
15
  version_array = current_version.split(".").map(&:to_i)
12
16
  case params[:bump_type]
@@ -61,21 +65,37 @@ module Fastlane
61
65
  env_name: "FL_VERSION_NUMBER_VERSION_NUMBER",
62
66
  description: "Change to a specific version. This will replace the bump type value",
63
67
  optional: true),
68
+ FastlaneCore::ConfigItem.new(key: :bundle_id,
69
+ env_name: "FL_APPSTORE_VERSION_NUMBER_BUNDLE_ID",
70
+ description: "Bundle ID of the application",
71
+ optional: true,
72
+ conflicting_options: [:xcodeproj, :target, :build_configuration_name],
73
+ is_string: true),
64
74
  FastlaneCore::ConfigItem.new(key: :xcodeproj,
65
75
  env_name: "FL_VERSION_NUMBER_PROJECT",
66
76
  description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
77
+ optional: true,
78
+ conflicting_options: [:bundle_id],
67
79
  verify_block: proc do |value|
68
80
  UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
69
- UI.user_error!("Could not find Xcode project") unless File.exist?(value)
70
- end,
71
- optional: true),
81
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
82
+ end),
72
83
  FastlaneCore::ConfigItem.new(key: :target,
73
- env_name: "FL_VERSION_NUMBER_TARGET",
74
- optional: true,
75
- description: "Specify a specific target if you have multiple per project, optional"),
84
+ env_name: "FL_VERSION_NUMBER_TARGET",
85
+ optional: true,
86
+ conflicting_options: [:bundle_id],
87
+ description: "Specify a specific target if you have multiple per project, optional"),
76
88
  FastlaneCore::ConfigItem.new(key: :build_configuration_name,
77
- optional: true,
78
- description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration")
89
+ optional: true,
90
+ conflicting_options: [:bundle_id],
91
+ description: "Specify a specific build configuration if you have different Info.plist build settings for each configuration"),
92
+ FastlaneCore::ConfigItem.new(key: :version_source,
93
+ optional: true,
94
+ default_value: 'plist',
95
+ verify_block: proc do |value|
96
+ UI.user_error!("Available values are 'plist' and 'appstore'") unless ['plist', 'appstore'].include? value
97
+ end,
98
+ description: "Source version to increment. Available options: plist, appstore")
79
99
  ]
80
100
  end
81
101
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Versioning
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
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.1
4
+ version: 0.2.2
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-06 00:00:00.000000000 Z
11
+ date: 2016-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry