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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7652e166750f387da359eede2e607168bc79ff2e
|
4
|
+
data.tar.gz: 510a494953d98b0788163bc4950268e5c0309801
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1008c089d950b37b96e9e42bc7dba94c8e3bfeb31afa8ab9f3df31cfe7c2f20e22c0727e49b31869e29b73a4da35906aca993703a52ce6ea37841e58f0c566d8
|
7
|
+
data.tar.gz: c66618f04c82df4163aa3968f60a877760b4a168c30809d53a71aa5806292477fe6dabda5965afbe67e732d22d0eb0645c8fe930526db7ad3bbb8b568487cf89
|
data/lib/fastlane/plugin/update_build_settings_key/actions/update_build_settings_key_action.rb
CHANGED
@@ -6,16 +6,18 @@ module Fastlane
|
|
6
6
|
require 'xcodeproj'
|
7
7
|
|
8
8
|
info_plist_key = 'INFOPLIST_FILE'
|
9
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
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 $(#{
|
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[
|
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
|
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
|
63
|
+
description: "key of the build setting you want update"),
|
62
64
|
FastlaneCore::ConfigItem.new(key: :map,
|
63
65
|
type: Hash,
|
64
|
-
description: "
|
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
|
|