fastlane-plugin-versioning 0.5.0 → 0.5.1

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: 3b859783ec3eb0b788723835e3e9cea700b5924d1993a398f1381c319f4393d9
4
+ data.tar.gz: 3820aef2545a4054830e859c02497d4a8110a8931020758c123775113d15d96b
5
5
  SHA512:
6
- metadata.gz: caa6ec62dbab21b2e4c304b287798ba0b75040ba7ea443429484b34bb3420d395cd38349139f6f7139931abc33304a6c5d9a4aa1730c8c280aad8ee4503f9c60
7
- data.tar.gz: 1d885526fe58a4930b1d37f9ade376cce2dac25445a00a3b645389cb17d20825521d10da2e1df49692e93999746755bcb77e62d7d7f3275c4c152a40c4ba89db
6
+ metadata.gz: a33054f02eb1fad905b17d001aaddfd82c4fecae4b8f203be72ae5d65129019ecea32445e6d53e1ae375828651019de0ae1833abbb7c6bb49f86743df036d692
7
+ data.tar.gz: 07a216fd6beca44bf81e57b8ee5ecef852094ca3589882d1ff983683022b0efa118ccb6be84814a0a4083d21a35363aa6a28b75904a8887ae359ece31b20b38c
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
@@ -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.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siarhei Fiedartsou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-19 00:00:00.000000000 Z
12
+ date: 2022-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry