mmine 0.9.3 → 0.9.7
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 +7 -4
- data/lib/mmine/notification_extension_integrator.rb +56 -5
- data/lib/mmine/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d490fc5cefe008e8fe59cd2e69bbb048c088106ce034b3d22a59cbb3c909dcf4
|
4
|
+
data.tar.gz: 27c17fe2fc5fd5e885b2368d317a0de63feea805d8af3b2172599123de1aea8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c523b146a39987351240e79ec55f6eeff2cb428156c5aef7614296f7675411624e1ada2d1434ab11afe244f9b9e929d5d29afa520d19f5c4c3bf6c1b2228888
|
7
|
+
data.tar.gz: 41d04924b9700394cd5d67a32eabd7a5d444a74f489f7102f158ee003a9dc00da737dc279a7f9b6bc45f590e5e938d10c4470c98263fcefba237c345770512cf
|
data/bin/mmine
CHANGED
@@ -23,10 +23,13 @@ integrate_parse = OptionParser.new do |opts|
|
|
23
23
|
opts.on("-v", "--verbose", "Make verbose logs visible") do |verbose|
|
24
24
|
options[:verbose] = verbose
|
25
25
|
end
|
26
|
-
opts.on("-c", "--cordova", "Provide Cordova project specific settings.") do |
|
27
|
-
options[:cordova] =
|
26
|
+
opts.on("-c", "--cordova", "Provide Cordova project specific settings.") do |cordova|
|
27
|
+
options[:cordova] = cordova
|
28
28
|
end
|
29
|
-
opts.on("
|
29
|
+
opts.on("-x", "--xcframework", "Should Cordova project use xcframework or framework.") do |xcframework|
|
30
|
+
options[:xcframework] = xcframework
|
31
|
+
end
|
32
|
+
opts.on("--swift-version", "--swift-version SWIFT_VER", "Provide Swift Language version for notification extension (by default 5)") do |ver|
|
30
33
|
options[:"swift-version"] = ver
|
31
34
|
end
|
32
35
|
opts.on("-h", "--help", "Prints this help") do
|
@@ -44,7 +47,7 @@ when "integrate"
|
|
44
47
|
unless missing.empty?
|
45
48
|
raise OptionParser::MissingArgument.new(missing.join(', '))
|
46
49
|
end
|
47
|
-
integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:"swift-version"] || "
|
50
|
+
integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:xcframework] || false, options[:"swift-version"] || "5")
|
48
51
|
integrator.logger = Logger.new(STDOUT)
|
49
52
|
integrator.logger.formatter = proc do |severity, datetime, progname, msg|
|
50
53
|
"#{severity}: #{msg}\n"
|
@@ -14,12 +14,13 @@ 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, swift_ver)
|
17
|
+
def initialize(application_code, project_file_path, app_group, main_target_name, cordova = false, xcframework = false, swift_ver)
|
18
18
|
@project_file_path = project_file_path
|
19
19
|
@app_group = app_group
|
20
20
|
@main_target_name = main_target_name
|
21
21
|
@logger = nil
|
22
22
|
@cordova = cordova
|
23
|
+
@xcframework = xcframework
|
23
24
|
@swift_version = swift_ver
|
24
25
|
@application_code = application_code
|
25
26
|
|
@@ -67,6 +68,7 @@ class NotificationExtensionIntegrator
|
|
67
68
|
setup_product_name
|
68
69
|
setup_extension_build_number
|
69
70
|
setup_run_path_search_paths
|
71
|
+
erease_bridging_header
|
70
72
|
|
71
73
|
if @cordova
|
72
74
|
setup_entitlements(resolve_absolute_paths(["$(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-Debug.plist"]),
|
@@ -76,7 +78,9 @@ class NotificationExtensionIntegrator
|
|
76
78
|
@main_build_settings_release)
|
77
79
|
setup_extension_lib_cordova_link
|
78
80
|
setup_framework_search_paths
|
79
|
-
|
81
|
+
unless @xcframework
|
82
|
+
setup_copy_framework_script
|
83
|
+
end
|
80
84
|
else
|
81
85
|
setup_entitlements(@main_build_configurations_debug.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
|
82
86
|
@main_build_configurations_release.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
|
@@ -189,7 +193,7 @@ class NotificationExtensionIntegrator
|
|
189
193
|
suffix = 'notification-extension'
|
190
194
|
key = 'PRODUCT_BUNDLE_IDENTIFIER'
|
191
195
|
(@main_build_configurations_release + @main_build_configurations_debug).each do |config|
|
192
|
-
bundleId = config
|
196
|
+
bundleId = resolve_recursive_build_setting(config, key)
|
193
197
|
if bundleId == nil
|
194
198
|
plist_path = resolve_absolute_paths([config.resolve_build_setting("INFOPLIST_FILE")]).first
|
195
199
|
bundleId = get_xml_string_value(key, plist_path)
|
@@ -203,6 +207,49 @@ class NotificationExtensionIntegrator
|
|
203
207
|
end
|
204
208
|
end
|
205
209
|
|
210
|
+
# https://github.com/CocoaPods/Xcodeproj/issues/505#issuecomment-584699008
|
211
|
+
# Augments config.resolve_build_setting from xcproject
|
212
|
+
# to continue expanding build settings and evaluate modifiers
|
213
|
+
def resolve_recursive_build_setting(config, setting)
|
214
|
+
resolution = config.resolve_build_setting(setting)
|
215
|
+
|
216
|
+
# finds values with one of
|
217
|
+
# $VALUE
|
218
|
+
# $(VALLUE)
|
219
|
+
# $(VALUE:modifier)
|
220
|
+
# ${VALUE}
|
221
|
+
# ${VALUE:modifier}
|
222
|
+
resolution.gsub(/\$[\(\{]?.+[\)\}]?/) do |raw_value|
|
223
|
+
# strip $() characters
|
224
|
+
unresolved = raw_value.gsub(/[\$\(\)\{\}]/, '')
|
225
|
+
|
226
|
+
# Get the modifiers after the ':' characters
|
227
|
+
name, *modifiers = unresolved.split(':')
|
228
|
+
|
229
|
+
# Expand variable name
|
230
|
+
subresolution = resolve_recursive_build_setting(config, name)
|
231
|
+
|
232
|
+
# Apply modifiers
|
233
|
+
# NOTE: not all cases accounted for
|
234
|
+
#
|
235
|
+
# See http://codeworkshop.net/posts/xcode-build-setting-transformations
|
236
|
+
# for various modifier options
|
237
|
+
modifiers.each do |modifier|
|
238
|
+
case modifier
|
239
|
+
when 'lower'
|
240
|
+
subresolution.downcase!
|
241
|
+
when 'upper'
|
242
|
+
subresolution.upcase!
|
243
|
+
else
|
244
|
+
# Fastlane message
|
245
|
+
@logger.info("Unknown modifier: `#{modifier}` in `#{raw_value}")
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
subresolution
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
206
253
|
def create_entitlements_file(_entitlements_name)
|
207
254
|
entitlements_destination_filepath = File.join(@project_dir, _entitlements_name)
|
208
255
|
entitlements_source_filepath = File.join(Mmine.root, 'resources', "MobileMessagingNotificationExtension.entitlements")
|
@@ -298,8 +345,12 @@ class NotificationExtensionIntegrator
|
|
298
345
|
end
|
299
346
|
end
|
300
347
|
|
348
|
+
def erease_bridging_header
|
349
|
+
set_notification_extension_build_settings('SWIFT_OBJC_BRIDGING_HEADER', '')
|
350
|
+
end
|
351
|
+
|
301
352
|
def setup_framework_search_paths
|
302
|
-
set_notification_extension_build_settings('FRAMEWORK_SEARCH_PATHS', '$SRCROOT/$PROJECT/Plugins/com-infobip-plugins-mobilemessaging')
|
353
|
+
set_notification_extension_build_settings('FRAMEWORK_SEARCH_PATHS', '$SRCROOT/$PROJECT/Plugins/com-infobip-plugins-mobilemessaging/**')
|
303
354
|
end
|
304
355
|
|
305
356
|
def setup_run_path_search_paths
|
@@ -421,7 +472,7 @@ class NotificationExtensionIntegrator
|
|
421
472
|
return group_reference
|
422
473
|
end
|
423
474
|
|
424
|
-
def resolve_absolute_paths(paths)
|
475
|
+
def resolve_absolute_paths(paths)
|
425
476
|
paths.map do |path|
|
426
477
|
ret = path
|
427
478
|
["$(PROJECT_DIR)", "$PROJECT_DIR"].each do |proj_dir|
|
data/lib/mmine/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Kadochnikov
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.20.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.20.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
|
-
rubygems_version: 3.0.
|
76
|
+
rubygems_version: 3.0.8
|
77
77
|
signing_key:
|
78
78
|
specification_version: 4
|
79
79
|
summary: Mobile Messaging iOS Notification Extension Integration Tool made at Infobip
|