fastlane-plugin-goodify_info_plist 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: d17c810f6645f769956e3d5d9b278f8109a0fe8f
4
- data.tar.gz: 8275fbd5310a6bf9f4414f737f425aceff90e119
3
+ metadata.gz: b78ca7c6bf0ee8d4b1846a9471efbf3865223e3b
4
+ data.tar.gz: 5a42b918b29c9cc0343ac11cd707c27e553a24f9
5
5
  SHA512:
6
- metadata.gz: d33ba18713aebe10941c24b5fe42a683d94a0122a3a8603f9cf135260acfabad99e5a822816042a42618fd4a2dc9a52f972d71441d610443d94429195621e69c
7
- data.tar.gz: 3b09d64e3b04337c944c6f4fd1f695c32f0ebd44b6c1f7ca0849fe9df7c09f32995fac18f9447c417907f670b47105d4903e7b50f706410b5af65ee00d964559
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::parse_xml(params[:plist])
7
+ plist = Plist.parse_xml(params[:plist])
10
8
 
11
9
  gd_entitlement_version = "1.0.0.0"
12
- if ( params.values.has_key?(:good_entitlement_version) == true)
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").downcase == "enterprise"
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
- if ( entry["CFBundleURLSchemes"].include? "com.good.gd.discovery")
36
- entry["CFBundleURLName"] = app_id
37
- entry["CFBundleURLSchemes"] = url_schemes
38
- replaced = true;
39
- break;
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
- if ( replaced == false)
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
- FastlaneCore::ConfigItem.new(key: :plist,
69
- env_name: "FL_GOODIFY_INFO_PLIST_FILEPATH",
70
- description: "The file path to the plist that will be compiled to the app's Info.plist for the GoodifyInfoPlistAction",
71
- verify_block: proc do |value|
72
- UI.user_error!("Invalid plist file path for GoodifyInfoPlistAction given, pass using `plist: 'path/to/plist'`") if (value.nil? || value.empty?)
73
- UI.user_error!("Non-existant plist file for GoodifyInfoPlistAction given") if (!File.exists?(value))
74
- end),
75
-
76
- FastlaneCore::ConfigItem.new(key: :good_entitlement_version,
77
- env_name: "FL_GOODIFY_INFO_PLIST_ENTITLEMENT_VERSION",
78
- description: "The Good app version number for the GoodifyInfoPlistAction",
79
- verify_block: proc do |value|
80
- pattern = Regexp.new('^(:?[1-9]\d{0,2})(:?\.(:?0|[1-9]\d{0,2})){0,3}$')
81
- did_match = !pattern.match(value).nil?
82
- 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))
83
- end,
84
- optional: true,
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
- env_name: "FL_GOODIFY_INFO_PLIST_ENTITLEMENT_ID",
89
- description: "The Good ID for the GoodifyInfoPlistAction",
90
- verify_block: proc do |value|
91
- UI.user_error!("No Good ID for GoodifyInfoPlistAction given, pass using `good_entitlement_id: 'com.example.good'`") if (value and value.empty?)
92
- UI.user_error!("Good ID must be 35 characters or fewer in order to work with Windows Phones") if value.length > 35
93
- # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
94
- end), # the default value if the user didn't provide one
95
-
96
- FastlaneCore::ConfigItem.new(key: :distribution,
97
- env_name: "FL_GOODIFY_INFO_PLIST_DISTRIBUTION_TARGET",
98
- description: "The distribution target, \"appstore\" or \"enterprise\", for the GoodifyInfoPlistAction",
99
- verify_block: proc do |value|
100
- UI.user_error!("Invalid distribution target given for GoodifyInfoPlistAction given, pass using `good_entitlement_id: 'appstore' or 'enterprise'`") if (value and value.empty? or !["appstore", "enterprise"].include?(value))
101
- end,
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GoodifyInfoPlist
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-goodify_info_plist
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
  - Lyndsey Ferguson