mmine 0.9.8 → 0.9.9
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 +4 -4
- data/bin/mmine +4 -1
- data/lib/mmine/notification_extension_integrator.rb +31 -2
- data/lib/mmine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd2da8bbe98ba3e12f896877783e2d66a3c65189e626ca2f91e1c9701cbb87f
|
4
|
+
data.tar.gz: 62536d99142467ad563846ad3a669f486ad0f89623de6970c1c106794ae5a558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d1ea2afc7248f1e211b7a9f20a84f78fa5dcdc6cd3a78bba172fdad1cfc01514ac13240e3e566002f28125922b54f3a7386384364ccf52e0615a4f3789542d1
|
7
|
+
data.tar.gz: b9d8c6d40e423c64df0340874e4513367ca781b4b563bd64b4fa06a24f91c7c35f95b33980304a363f85196db47d95c0eba8363e100313cf0cac671247bdd379
|
data/bin/mmine
CHANGED
@@ -32,6 +32,9 @@ integrate_parse = OptionParser.new do |opts|
|
|
32
32
|
opts.on("--swift-version", "--swift-version SWIFT_VER", "Provide Swift Language version for notification extension (by default 5)") do |ver|
|
33
33
|
options[:"swift-version"] = ver
|
34
34
|
end
|
35
|
+
opts.on("-s", "--override-signing", "Override parameters for MobileMessagingNotificationExtension signing using build flags") do |override|
|
36
|
+
options[:"override-signing"] = override
|
37
|
+
end
|
35
38
|
opts.on("-h", "--help", "Prints this help") do
|
36
39
|
puts opts
|
37
40
|
exit
|
@@ -47,7 +50,7 @@ when "integrate"
|
|
47
50
|
unless missing.empty?
|
48
51
|
raise OptionParser::MissingArgument.new(missing.join(', '))
|
49
52
|
end
|
50
|
-
integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:xcframework] || false, options[:"swift-version"] || "5")
|
53
|
+
integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:xcframework] || false, options[:"swift-version"] || "5", options[:"override-signing"] || false)
|
51
54
|
integrator.logger = Logger.new(STDOUT)
|
52
55
|
integrator.logger.formatter = proc do |severity, datetime, progname, msg|
|
53
56
|
"#{severity}: #{msg}\n"
|
@@ -14,7 +14,7 @@ module Mmine
|
|
14
14
|
end
|
15
15
|
|
16
16
|
class NotificationExtensionIntegrator
|
17
|
-
def initialize(application_code, project_file_path, app_group, main_target_name, cordova = false, xcframework = false, swift_ver)
|
17
|
+
def initialize(application_code, project_file_path, app_group, main_target_name, cordova = false, xcframework = false, swift_ver, override_signing)
|
18
18
|
@project_file_path = project_file_path
|
19
19
|
@app_group = app_group
|
20
20
|
@main_target_name = main_target_name
|
@@ -23,6 +23,7 @@ class NotificationExtensionIntegrator
|
|
23
23
|
@xcframework = xcframework
|
24
24
|
@swift_version = swift_ver
|
25
25
|
@application_code = application_code
|
26
|
+
@override_signing = override_signing
|
26
27
|
|
27
28
|
@project_dir = Pathname.new(@project_file_path).parent.to_s
|
28
29
|
@project = Xcodeproj::Project.open(@project_file_path)
|
@@ -51,7 +52,10 @@ class NotificationExtensionIntegrator
|
|
51
52
|
create_notification_extension_target
|
52
53
|
create_notification_extension_dir
|
53
54
|
add_notification_extension_source_code
|
54
|
-
|
55
|
+
setup_extension_target_signing(@override_signing)
|
56
|
+
if @override_signing == false
|
57
|
+
setup_development_team
|
58
|
+
end
|
55
59
|
setup_deployment_target
|
56
60
|
setup_notification_extension_info_plist
|
57
61
|
setup_notification_extension_bundle_id
|
@@ -99,6 +103,31 @@ class NotificationExtensionIntegrator
|
|
99
103
|
puts "🏁 Integration has been finished successfully!"
|
100
104
|
end
|
101
105
|
|
106
|
+
def setup_extension_target_signing(override_signing)
|
107
|
+
@logger.info("Overriding extension target signing: #{override_signing}")
|
108
|
+
|
109
|
+
signing_settings = {
|
110
|
+
'DEVELOPMENT_TEAM' => '$MM_EXTENSION_DEVELOPMENT_TEAM',
|
111
|
+
'CODE_SIGN_IDENTITY' => '$MM_EXTENSION_CODE_SIGN_IDENTITY',
|
112
|
+
}
|
113
|
+
|
114
|
+
signing_settings.keys.each do |key|
|
115
|
+
value = signing_settings[key]
|
116
|
+
@logger.info("Checking extension signing for key: #{key} value: #{value}")
|
117
|
+
if override_signing
|
118
|
+
set_notification_extension_build_settings(key, value)
|
119
|
+
else
|
120
|
+
# Delete setting if it was previously overridden
|
121
|
+
@extension_target.build_configurations.each do |config|
|
122
|
+
if config.resolve_build_setting(key) == value
|
123
|
+
@logger.info("Deletes extension setting for key: #{key} value: #{value}")
|
124
|
+
config.build_settings[key] = ''
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
102
131
|
def create_notification_extension_target
|
103
132
|
@extension_target_name = 'MobileMessagingNotificationExtension'
|
104
133
|
@extension_source_name_filepath = File.join(Mmine.root, 'resources', 'NotificationService.swift')
|
data/lib/mmine/version.rb
CHANGED