fastlane-plugin-update_build_settings_key 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: 64ea60fd429d146181ae652975dc58baf786bda7
4
- data.tar.gz: 002174c61d68925c2b7e2b730837af913f08e8fe
3
+ metadata.gz: 7652e166750f387da359eede2e607168bc79ff2e
4
+ data.tar.gz: 510a494953d98b0788163bc4950268e5c0309801
5
5
  SHA512:
6
- metadata.gz: 1deb284d6c47eb25f754494f7a45d9c0f2bf5d43e127a81a810b75a6168ec7954310a15d6526439481c3ee84d41bf215697d5e43b7eb3dc44bcc9da73e82fbb3
7
- data.tar.gz: d0dbd506231bfcfd2e794006aaab80dc036ebb1b5dffc263cde03156ffdb071b51cb4ccaf11010cb8e6f2627083bb33eb742c984cfe6b70656c7cad9c1ae80d1
6
+ metadata.gz: 1008c089d950b37b96e9e42bc7dba94c8e3bfeb31afa8ab9f3df31cfe7c2f20e22c0727e49b31869e29b73a4da35906aca993703a52ce6ea37841e58f0c566d8
7
+ data.tar.gz: c66618f04c82df4163aa3968f60a877760b4a168c30809d53a71aa5806292477fe6dabda5965afbe67e732d22d0eb0645c8fe930526db7ad3bbb8b568487cf89
@@ -6,16 +6,18 @@ module Fastlane
6
6
  require 'xcodeproj'
7
7
 
8
8
  info_plist_key = 'INFOPLIST_FILE'
9
- identifier_key = params[:build_settings_key]
9
+ build_settings_key = params[:build_settings_key]
10
10
  project_path = params[:xcodeproj]
11
11
  configuration = params[:configuration]
12
12
  map = params[:map]
13
13
  project = Xcodeproj::Project.open(project_path)
14
- pbxprojects = project.objects.select { |obj| obj.isa == 'PBXProject' }
15
- # Set ProvisioningStyle to Manual
16
- pbxprojects.each { |obj| obj.attributes.each { |attribute, value| value.each { |key, item| item['ProvisioningStyle'] = 'Manual' } if value.kind_of? Hash } }
14
+ # Set ProvisioningStyle to Manual if
15
+ if 'PROVISIONING_PROFILE_SPECIFIER' == build_settings_key
16
+ pbxprojects = project.objects.select { |obj| obj.isa == 'PBXProject' }
17
+ pbxprojects.each { |obj| obj.attributes.each { |attribute, value| value.each { |key, item| item['ProvisioningStyle'] = 'Manual' } if value.kind_of? Hash } }
18
+ end
17
19
  configs = project.objects.select { |obj| obj.isa == 'XCBuildConfiguration' && obj.to_s == configuration && obj.build_settings[info_plist_key] }
18
- UI.user_error!("Info plist uses $(#{identifier_key}), but xcodeproj does not") unless configs.count > 0
20
+ UI.user_error!("Info plist uses $(#{build_settings_key}), but xcodeproj does not") unless configs.count > 0
19
21
  configs = configs.select do |obj|
20
22
  info_plist_value = obj.build_settings[info_plist_key]
21
23
  !map[info_plist_value].nil?
@@ -24,14 +26,14 @@ module Fastlane
24
26
  # For each of the build configurations, set specific profile
25
27
  configs.each do |c|
26
28
  info_plist_value = c.build_settings[info_plist_key]
27
- c.build_settings[identifier_key] = map[info_plist_value]
29
+ c.build_settings[build_settings_key] = map[info_plist_value]
28
30
  end
29
31
  project.save
30
32
  UI.success("Successfully updated project ")
31
33
  end
32
34
 
33
35
  def self.description
34
- "Updated code signing settings from 'Automatic' to a specific profile"
36
+ "Updated build settings key to a new value"
35
37
  end
36
38
 
37
39
  def self.authors
@@ -44,7 +46,7 @@ module Fastlane
44
46
 
45
47
  def self.details
46
48
  # Optional:
47
- "Updated code signing settings from 'Automatic' to a specific profile"
49
+ "Updated build settings key to a new value including specific profile,\nwill Updated code signing settings from 'Automatic' to a specific profile when key is PROVISIONING_PROFILE_SPECIFIER"
48
50
  end
49
51
 
50
52
  def self.available_options
@@ -56,12 +58,28 @@ module Fastlane
56
58
  UI.user_error!("Path is invalid") unless File.exist?(value)
57
59
  end),
58
60
  FastlaneCore::ConfigItem.new(key: :configuration,
59
- description: "name of your configuration"),
61
+ description: "name of your configuration ,such as 'Release'"),
60
62
  FastlaneCore::ConfigItem.new(key: :build_settings_key,
61
- description: "key of your build setting"),
63
+ description: "key of the build setting you want update"),
62
64
  FastlaneCore::ConfigItem.new(key: :map,
63
65
  type: Hash,
64
- description: "new value of your build setting in hash")
66
+ description: "KEY is path to Info.plist , VALUE is updated value of build setting key")
67
+ ]
68
+ end
69
+
70
+ def self.example_code
71
+ [
72
+ 'update_build_settings_key(
73
+ xcodeproj: "Demo/Demo.xcodeproj",
74
+ configuration: "Release",
75
+ build_settings_key: "PROVISIONING_PROFILE_SPECIFIER",
76
+ map: {
77
+ "Demo Watch Extension/Info.plist" => "Demo WatchKit Extension 2",
78
+ "Demo Watch/Info.plist" => "Demo WatchKit App",
79
+ "Demo Today/Info.plist" => "Demo Today",
80
+ "Demo/Info.plist" => "Demo"
81
+ }
82
+ )'
65
83
  ]
66
84
  end
67
85
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UpdateBuildSettingsKey
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-update_build_settings_key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ungacy