fastlane-plugin-versioning 0.5.0 → 0.5.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
  SHA256:
3
- metadata.gz: 03aeb9f6626333091028495754b989bfa694844515ba302e4d0b35b19a87fd0a
4
- data.tar.gz: d3bede186bf5e768f804b7ef557c02015b56d17e532bd1a89d042e9439287eb0
3
+ metadata.gz: 79b440ee888faef8d8af1ca926280a5f9b49bb357cc3d69e53dc8a1a56b7b2c8
4
+ data.tar.gz: c3a217e48d29083d152d32fbf2d59e155e0b6c8634ff47171135c5a808595bc6
5
5
  SHA512:
6
- metadata.gz: caa6ec62dbab21b2e4c304b287798ba0b75040ba7ea443429484b34bb3420d395cd38349139f6f7139931abc33304a6c5d9a4aa1730c8c280aad8ee4503f9c60
7
- data.tar.gz: 1d885526fe58a4930b1d37f9ade376cce2dac25445a00a3b645389cb17d20825521d10da2e1df49692e93999746755bcb77e62d7d7f3275c4c152a40c4ba89db
6
+ metadata.gz: e4a0ac02d302b480dd88dec90e780239455ede0f5d6c8b40bb32d774951ac8b74de3a8c633c8be57b89ba27d014c523b8081e629ab4449b72eec76aadc4e05b8
7
+ data.tar.gz: ef0aa4fb316b53cb28bdb6285c8acba0649ad2ccf295430ba665152bb6a3e25a832594f2e3b3cf4d4dcabf9c2ed19f761f046ad24b15da1e1130e84416392b1b
data/README.md CHANGED
@@ -21,12 +21,18 @@ To make your scheme shared go to "Manage schemes" in Xcode and tick "Shared" che
21
21
 
22
22
 
23
23
  ### what is this `plist_build_setting_support` stuff about?!
24
- If you have a xcodeproject and have updated to Xcode 11, you'll notice that if you change your build and version numbers through the UI, the actual numbers are now stored inside build settings inside build confiugration. The Info.plist file -- where they used to be stored -- now contains build setting variables (looks like `$(CURRENT_PROJECT_VERSION)` or `$(MARKETING_VERSION)`, for build number and version number respectively).
24
+ If you have a xcodeproject and have updated to Xcode 11, you'll notice that if you change your build and version numbers through the UI, the actual numbers are now stored inside build settings inside build configuration. The Info.plist file -- where they used to be stored -- now contains build setting variables (looks like `$(CURRENT_PROJECT_VERSION)` or `$(MARKETING_VERSION)`, for build number and version number respectively).
25
25
  If you are at this migration 'turning point', you have two options. you can either:
26
- 1. simply add `plist_build_setting_support: true` to your plist action parameters
27
- 2. change the command to be the xcodeproj variants - i.e. `increment_version_number_in_xcodeproj` or `increment_build_number_in_xcodeproj`
28
26
 
29
- these also apply to the `getters` of build and version numbers.
27
+ - Continue using the legacy method of inserting build and versions directly into plists by simply add `plist_build_setting_support: true` to your plist action parameters
28
+
29
+ OR
30
+
31
+ - Change the command to be the xcodeproj variants - i.e. `increment_version_number_in_xcodeproj` or `increment_build_number_in_xcodeproj` these also apply to the `getters` of build and version numbers.
32
+
33
+ ##### Warning for those migrating
34
+ Verify your plist files are using the build variables (new) `$(CURRENT_PROJECT_VERSION)` or `$(MARKETING_VERSION)`. You can force this migration by simply modifying Version/Build fields for each one of your targets in UI. If you forget to make this change, or something else is writing and replacing it, xcodeproj actions will successfully update, but your build will have no reference to those values essentially becoming NOOP
35
+
30
36
  We will leave the plist actions in, as for those consumers who are limited to their upgrade path.
31
37
 
32
38
  ## Actions
@@ -3,6 +3,7 @@ module Fastlane
3
3
  class GetAppStoreVersionNumberAction < Action
4
4
 
5
5
  require 'json'
6
+ require 'securerandom'
6
7
 
7
8
  def self.run(params)
8
9
  if params[:bundle_id]
@@ -16,10 +17,12 @@ module Fastlane
16
17
  bundle_id = GetInfoPlistValueAction.run(path: plist, key: 'CFBundleIdentifier') # TODO: add same kind of flag to support build setting variables
17
18
  end
18
19
 
20
+ random = Helper.test? ? "123" : SecureRandom.uuid
21
+
19
22
  if params[:country]
20
- uri = URI("http://itunes.apple.com/lookup?bundleId=#{bundle_id}&country=#{params[:country]}")
23
+ uri = URI("http://itunes.apple.com/lookup?bundleId=#{bundle_id}&country=#{params[:country]}&rand=#{random}")
21
24
  else
22
- uri = URI("http://itunes.apple.com/lookup?bundleId=#{bundle_id}")
25
+ uri = URI("http://itunes.apple.com/lookup?bundleId=#{bundle_id}&rand=#{random}")
23
26
  end
24
27
  Net::HTTP.get(uri)
25
28
 
@@ -79,7 +82,7 @@ module Fastlane
79
82
  end
80
83
 
81
84
  def self.authors
82
- ["SiarheiFedartsou"]
85
+ ["SiarheiFedartsou", "jdouglas-nz", "raymondjacobson"]
83
86
  end
84
87
 
85
88
  def self.is_supported?(platform)
@@ -34,7 +34,7 @@ module Fastlane
34
34
 
35
35
  private_class_method
36
36
  def self.select_build_configuration_predicate(name, configuration)
37
- is_build_valid_configuration = configuration.isa == "XCBuildConfiguration" && !configuration.build_settings["PRODUCT_BUNDLE_IDENTIFIER"].nil?
37
+ is_build_valid_configuration = configuration.isa == "XCBuildConfiguration" && !configuration.resolve_build_setting('PRODUCT_BUNDLE_IDENTIFIER').nil?
38
38
  is_build_valid_configuration &&= configuration.name == name unless name.nil?
39
39
  return is_build_valid_configuration
40
40
  end
@@ -41,7 +41,7 @@ module Fastlane
41
41
 
42
42
  private_class_method
43
43
  def self.select_build_configuration_predicate(name, configuration)
44
- is_build_valid_configuration = configuration.isa == "XCBuildConfiguration" && !configuration.build_settings["PRODUCT_BUNDLE_IDENTIFIER"].nil?
44
+ is_build_valid_configuration = configuration.isa == "XCBuildConfiguration" && !configuration.resolve_build_setting('PRODUCT_BUNDLE_IDENTIFIER').nil?
45
45
  is_build_valid_configuration &&= configuration.name == name unless name.nil?
46
46
  return is_build_valid_configuration
47
47
  end
@@ -59,10 +59,16 @@ module Fastlane
59
59
  target = project.targets[0] if target.nil?
60
60
  end
61
61
 
62
- target.build_configurations.each do |config|
62
+ if params[:build_configuration_name]
63
+ config = target.build_configurations.detect { |c| c.name == params[:build_configuration_name]}
63
64
  UI.message "updating #{config.name} to build #{next_build_number}"
64
65
  config.build_settings["CURRENT_PROJECT_VERSION"] = next_build_number
65
- end unless target.nil?
66
+ else
67
+ target.build_configurations.each do |config|
68
+ UI.message "updating #{config.name} to build #{next_build_number}"
69
+ config.build_settings["CURRENT_PROJECT_VERSION"] = next_build_number
70
+ end unless target.nil?
71
+ end
66
72
 
67
73
  project.save
68
74
  end
@@ -61,7 +61,7 @@ module Fastlane
61
61
 
62
62
  private_class_method
63
63
  def self.select_build_configuration_predicate(name, configuration)
64
- is_build_valid_configuration = configuration.isa == "XCBuildConfiguration" && !configuration.build_settings["PRODUCT_BUNDLE_IDENTIFIER"].nil?
64
+ is_build_valid_configuration = configuration.isa == "XCBuildConfiguration" && !configuration.resolve_build_setting('PRODUCT_BUNDLE_IDENTIFIER').nil?
65
65
  is_build_valid_configuration &&= configuration.name == name unless name.nil?
66
66
  return is_build_valid_configuration
67
67
  end
@@ -79,10 +79,17 @@ module Fastlane
79
79
  target = project.targets[0] if target.nil?
80
80
  end
81
81
 
82
- target.build_configurations.each do |config|
82
+ if params[:build_configuration_name]
83
+ config = target.build_configurations.detect { |c| c.name == params[:build_configuration_name]}
83
84
  UI.message "updating #{config.name} to version #{next_version_number}"
84
85
  config.build_settings["MARKETING_VERSION"] = next_version_number
85
- end unless target.nil?
86
+ else
87
+ target.build_configurations.each do |config|
88
+ UI.message "updating #{config.name} to version #{next_version_number}"
89
+ config.build_settings["MARKETING_VERSION"] = next_version_number
90
+ end unless target.nil?
91
+ end
92
+
86
93
 
87
94
  project.save
88
95
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Versioning
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siarhei Fiedartsou
8
8
  - John Douglas
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-19 00:00:00.000000000 Z
12
+ date: 2023-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -67,7 +67,7 @@ dependencies:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: 1.93.1
70
- description:
70
+ description:
71
71
  email:
72
72
  - siarhei.fedartsou@gmail.com
73
73
  - john.douglas.nz@gmail.com
@@ -95,7 +95,7 @@ homepage: https://github.com/SiarheiFedartsou/fastlane-plugin-versioning
95
95
  licenses:
96
96
  - MIT
97
97
  metadata: {}
98
- post_install_message:
98
+ post_install_message:
99
99
  rdoc_options: []
100
100
  require_paths:
101
101
  - lib
@@ -110,8 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.0.6
114
- signing_key:
113
+ rubygems_version: 3.3.26
114
+ signing_key:
115
115
  specification_version: 4
116
116
  summary: Allows to set/get app version and build number directly to/from Info.plist
117
117
  test_files: []