mmine 0.9.2 → 0.9.6
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 +57 -6
- 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: 58f6d1e85921571f00ab881a2c0b2ba38be942f08bc66e335b76c4c711c65f27
|
|
4
|
+
data.tar.gz: 6ef078a0f9858d9e8b6ff0414c83ad1e38f5d290600535479800b69974f75e74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74dce8885cb1281a0e20a512ad2dc23d0bd774e4ba1b07114a3137fa209ead1109002eae27a807d0bf6cde0661abfba825288f92b03c65a5e4904760982970a2
|
|
7
|
+
data.tar.gz: 869cfcd11e5e8596d10cf290c708d4fa8ba183e34874eb146d3357fc2620a2a2f9eaac4673e08886b0a1c8a71d4afe025ad1310f6e18e4e8d34314fcf79cefc1
|
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,9 +78,9 @@ class NotificationExtensionIntegrator
|
|
|
76
78
|
@main_build_settings_release)
|
|
77
79
|
setup_extension_lib_cordova_link
|
|
78
80
|
setup_framework_search_paths
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
unless @xcframework
|
|
82
|
+
setup_copy_framework_script
|
|
83
|
+
end
|
|
82
84
|
else
|
|
83
85
|
setup_entitlements(@main_build_configurations_debug.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
|
|
84
86
|
@main_build_configurations_release.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
|
|
@@ -191,7 +193,7 @@ class NotificationExtensionIntegrator
|
|
|
191
193
|
suffix = 'notification-extension'
|
|
192
194
|
key = 'PRODUCT_BUNDLE_IDENTIFIER'
|
|
193
195
|
(@main_build_configurations_release + @main_build_configurations_debug).each do |config|
|
|
194
|
-
bundleId = config
|
|
196
|
+
bundleId = resolve_recursive_build_setting(config, key)
|
|
195
197
|
if bundleId == nil
|
|
196
198
|
plist_path = resolve_absolute_paths([config.resolve_build_setting("INFOPLIST_FILE")]).first
|
|
197
199
|
bundleId = get_xml_string_value(key, plist_path)
|
|
@@ -205,6 +207,49 @@ class NotificationExtensionIntegrator
|
|
|
205
207
|
end
|
|
206
208
|
end
|
|
207
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
|
+
|
|
208
253
|
def create_entitlements_file(_entitlements_name)
|
|
209
254
|
entitlements_destination_filepath = File.join(@project_dir, _entitlements_name)
|
|
210
255
|
entitlements_source_filepath = File.join(Mmine.root, 'resources', "MobileMessagingNotificationExtension.entitlements")
|
|
@@ -300,6 +345,10 @@ class NotificationExtensionIntegrator
|
|
|
300
345
|
end
|
|
301
346
|
end
|
|
302
347
|
|
|
348
|
+
def erease_bridging_header
|
|
349
|
+
set_notification_extension_build_settings('SWIFT_OBJC_BRIDGING_HEADER', '')
|
|
350
|
+
end
|
|
351
|
+
|
|
303
352
|
def setup_framework_search_paths
|
|
304
353
|
set_notification_extension_build_settings('FRAMEWORK_SEARCH_PATHS', '$SRCROOT/$PROJECT/Plugins/com-infobip-plugins-mobilemessaging')
|
|
305
354
|
end
|
|
@@ -357,6 +406,8 @@ class NotificationExtensionIntegrator
|
|
|
357
406
|
new_phase.input_paths << input_path
|
|
358
407
|
new_phase.output_paths << output_path
|
|
359
408
|
end
|
|
409
|
+
|
|
410
|
+
remove_embed_framework_phase
|
|
360
411
|
end
|
|
361
412
|
|
|
362
413
|
def setup_target_capabilities(target_uuid)
|
|
@@ -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.6
|
|
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
|