fastlane-plugin-goodify_info_plist 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b78ca7c6bf0ee8d4b1846a9471efbf3865223e3b
|
4
|
+
data.tar.gz: 5a42b918b29c9cc0343ac11cd707c27e553a24f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad5b12aa436131a206a1adf7b0c171b7ed21824b069ceac85b4f8d1ef6f33606106e021c3518fb3c2c8d2f0d4bb346a4bac8387f2cbb42bd592e71f500438c3b
|
7
|
+
data.tar.gz: 924829435980170cd30ac86cc87ad2656dd5401b3c06b8579b20d99c63d4af76ee9fcfa75cebc080bedc1356a3773f6b0d0bcc18644fb4ae3ff53acb71177cc2
|
@@ -1,16 +1,14 @@
|
|
1
1
|
require 'plist'
|
2
|
-
|
3
2
|
module Fastlane
|
4
3
|
module Actions
|
5
|
-
|
6
4
|
class GoodifyInfoPlistAction < Action
|
7
5
|
def self.run(params)
|
8
6
|
# default entitlement version. we rarely, if ever, need to change this
|
9
|
-
plist = Plist
|
7
|
+
plist = Plist.parse_xml(params[:plist])
|
10
8
|
|
11
9
|
gd_entitlement_version = "1.0.0.0"
|
12
|
-
if
|
13
|
-
gd_entitlement_version = params[:good_entitlement_version]
|
10
|
+
if params.values.key?(:good_entitlement_version)
|
11
|
+
gd_entitlement_version = params[:good_entitlement_version]
|
14
12
|
end
|
15
13
|
|
16
14
|
plist["GDApplicationID"] = params[:good_entitlement_id]
|
@@ -25,22 +23,21 @@ module Fastlane
|
|
25
23
|
"#{app_id}.sc2.1.0.0.0",
|
26
24
|
"com.good.gd.discovery"
|
27
25
|
]
|
28
|
-
if params.values.fetch(:distribution, "appstore").
|
26
|
+
if params.values.fetch(:distribution, "appstore").casecmp("enterprise") == 0
|
29
27
|
url_schemes.push("com.good.gd.discovery.enterprise")
|
30
28
|
end
|
31
29
|
|
32
30
|
# attempt to replace an existing set of GD url schemes
|
33
31
|
replaced = false
|
34
32
|
plist["CFBundleURLTypes"].each do |entry|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
33
|
+
next unless entry["CFBundleURLSchemes"].include?("com.good.gd.discovery")
|
34
|
+
entry["CFBundleURLName"] = app_id
|
35
|
+
entry["CFBundleURLSchemes"] = url_schemes
|
36
|
+
replaced = true
|
37
|
+
break
|
41
38
|
end
|
42
39
|
|
43
|
-
|
40
|
+
unless replaced
|
44
41
|
plist["CFBundleURLTypes"] << {
|
45
42
|
"CFBundleURLName" => app_id,
|
46
43
|
"CFBundleURLSchemes" => url_schemes
|
@@ -57,59 +54,46 @@ module Fastlane
|
|
57
54
|
"This plugin will update the plist so that the built application can be deployed and managed within BlackBerry's Good Dynamics Control Center for Enterprise Mobility Management."
|
58
55
|
end
|
59
56
|
|
60
|
-
def self.details
|
61
|
-
""
|
62
|
-
end
|
63
|
-
|
64
57
|
def self.available_options
|
65
58
|
# options the action supports.
|
66
59
|
[
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
default_value: "1.0.0.0"),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :plist,
|
61
|
+
env_name: "FL_GOODIFY_INFO_PLIST_FILEPATH",
|
62
|
+
description: "The file path to the plist that will be compiled to the app's Info.plist for the GoodifyInfoPlistAction",
|
63
|
+
verify_block: proc do |value|
|
64
|
+
UI.user_error!("Invalid plist file path for GoodifyInfoPlistAction given, pass using `plist: 'path/to/plist'`") if value.nil? || value.empty?
|
65
|
+
UI.user_error!("Non-existant plist file for GoodifyInfoPlistAction given") unless File.exist?(value)
|
66
|
+
end),
|
67
|
+
|
68
|
+
FastlaneCore::ConfigItem.new(key: :good_entitlement_version,
|
69
|
+
env_name: "FL_GOODIFY_INFO_PLIST_ENTITLEMENT_VERSION",
|
70
|
+
description: "The Good app version number for the GoodifyInfoPlistAction",
|
71
|
+
verify_block: proc do |value|
|
72
|
+
pattern = Regexp.new('^(:?[1-9]\d{0,2})(:?\.(:?0|[1-9]\d{0,2})){0,3}$')
|
73
|
+
did_match = !pattern.match(value).nil?
|
74
|
+
UI.user_error!("Invalid Good app version for GoodifyInfoPlistAction given, pass using `good_entitlement_version: '1.2.3.4'`") if value and (value.empty? || !did_match)
|
75
|
+
end,
|
76
|
+
optional: true,
|
77
|
+
default_value: "1.0.0.0"),
|
86
78
|
|
87
79
|
FastlaneCore::ConfigItem.new(key: :good_entitlement_id,
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
default_value: "enterprise") # the default value if the user didn't provide one
|
80
|
+
env_name: "FL_GOODIFY_INFO_PLIST_ENTITLEMENT_ID",
|
81
|
+
description: "The Good ID for the GoodifyInfoPlistAction",
|
82
|
+
verify_block: proc do |value|
|
83
|
+
UI.user_error!("No Good ID for GoodifyInfoPlistAction given, pass using `good_entitlement_id: 'com.example.good'`") if value and value.empty?
|
84
|
+
UI.user_error!("Good ID must be 35 characters or fewer in order to work with Windows Phones") if value.length > 35
|
85
|
+
end), # the default value if the user didn't provide one
|
86
|
+
|
87
|
+
FastlaneCore::ConfigItem.new(key: :distribution,
|
88
|
+
env_name: "FL_GOODIFY_INFO_PLIST_DISTRIBUTION_TARGET",
|
89
|
+
description: "The distribution target, \"appstore\" or \"enterprise\", for the GoodifyInfoPlistAction",
|
90
|
+
verify_block: proc do |value|
|
91
|
+
UI.user_error!("Invalid distribution target given for GoodifyInfoPlistAction given, pass using `good_entitlement_id: 'appstore' or 'enterprise'`") if value and value.empty? || !["appstore", "enterprise"].include?(value)
|
92
|
+
end,
|
93
|
+
default_value: "enterprise") # the default value if the user didn't provide one
|
103
94
|
]
|
104
95
|
end
|
105
96
|
|
106
|
-
def self.output
|
107
|
-
[]
|
108
|
-
end
|
109
|
-
|
110
|
-
def self.return_value
|
111
|
-
end
|
112
|
-
|
113
97
|
def self.authors
|
114
98
|
["Lyndsey Ferguson lyndsey-ferguson/ldferguson, Kevin Winters kjwinters969"]
|
115
99
|
end
|