mmine 0.9.7 → 0.9.8

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
  SHA256:
3
- metadata.gz: d490fc5cefe008e8fe59cd2e69bbb048c088106ce034b3d22a59cbb3c909dcf4
4
- data.tar.gz: 27c17fe2fc5fd5e885b2368d317a0de63feea805d8af3b2172599123de1aea8c
3
+ metadata.gz: 6f35cd02c0cba4408c3fd8747bdb3e791e91120ebe4bcd1d26033cb70d6b59f2
4
+ data.tar.gz: 0ee9567a25d45a1c366faa4c25b17149860233fdb704fb97c7c31a3edf977cb5
5
5
  SHA512:
6
- metadata.gz: 6c523b146a39987351240e79ec55f6eeff2cb428156c5aef7614296f7675411624e1ada2d1434ab11afe244f9b9e929d5d29afa520d19f5c4c3bf6c1b2228888
7
- data.tar.gz: 41d04924b9700394cd5d67a32eabd7a5d444a74f489f7102f158ee003a9dc00da737dc279a7f9b6bc45f590e5e938d10c4470c98263fcefba237c345770512cf
6
+ metadata.gz: cc6648442c1c45b85f9279066c3b5aa7e01c065752af509775902dca81317b94ce0a44477a1afd08db78e42df8b0bceccff43dff8de1e108faaa78dedaffc4aa
7
+ data.tar.gz: fa5fdbac1811500e5bd859b70e77e5f215cea8073e4e36a7b40ae72dc31214eb5869b4810ad7662b41104ddbaed817f868ca773784985617064763a81b04901e
data/bin/mmine CHANGED
@@ -46,7 +46,7 @@ when "integrate"
46
46
  missing = mandatory.select{ |param| options[param].nil? }
47
47
  unless missing.empty?
48
48
  raise OptionParser::MissingArgument.new(missing.join(', '))
49
- end
49
+ end
50
50
  integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:xcframework] || false, options[:"swift-version"] || "5")
51
51
  integrator.logger = Logger.new(STDOUT)
52
52
  integrator.logger.formatter = proc do |severity, datetime, progname, msg|
@@ -62,7 +62,7 @@ when "integrate"
62
62
  puts $!.to_s
63
63
  puts integrate_parse
64
64
  exit
65
- end
65
+ end
66
66
  else
67
67
  if first_arg == nil
68
68
  puts "Please specify a command. For example 'mmine integrate'"
@@ -59,8 +59,8 @@ class NotificationExtensionIntegrator
59
59
  setup_user_app_group_value
60
60
  setup_background_modes_plist_value
61
61
 
62
- setup_target_capabilities(@extension_target.uuid)
63
- setup_target_capabilities(@main_target.uuid)
62
+ setup_target_capabilities_for_extension_target
63
+ setup_target_capabilities_for_main_target
64
64
 
65
65
  setup_embed_extension_action
66
66
  setup_main_target_dependency
@@ -71,12 +71,12 @@ class NotificationExtensionIntegrator
71
71
  erease_bridging_header
72
72
 
73
73
  if @cordova
74
- setup_entitlements(resolve_absolute_paths(["$(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-Debug.plist"]),
75
- resolve_absolute_paths(["$(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-Release.plist"]),
74
+ setup_entitlements(nil,
76
75
  nil,
77
- @main_build_settings_debug,
78
- @main_build_settings_release)
79
- setup_extension_lib_cordova_link
76
+ @extension_target_name,
77
+ @extension_build_settings_debug,
78
+ @extension_build_settings_release)
79
+ #setup_extension_lib_cordova_link
80
80
  setup_framework_search_paths
81
81
  unless @xcframework
82
82
  setup_copy_framework_script
@@ -265,8 +265,8 @@ class NotificationExtensionIntegrator
265
265
  end
266
266
 
267
267
  def setup_entitlements(entitlements_debug_file_paths, entitlements_release_file_paths, target_name, _build_settings_debug, _build_settings_release)
268
- entitlements_debug_file_paths = entitlements_debug_file_paths.compact
269
- entitlements_release_file_paths = entitlements_release_file_paths.compact
268
+ entitlements_debug_file_paths = entitlements_debug_file_paths ? entitlements_debug_file_paths.compact : nil
269
+ entitlements_release_file_paths = entitlements_release_file_paths ? entitlements_release_file_paths.compact : nil
270
270
  @logger.debug("setup_entitlements #{entitlements_debug_file_paths} #{entitlements_release_file_paths} #{target_name} #{_build_settings_debug} #{_build_settings_release}")
271
271
  code_sign_entitlements_key = 'CODE_SIGN_ENTITLEMENTS'
272
272
  aps_env_key = 'aps-environment'
@@ -292,7 +292,11 @@ class NotificationExtensionIntegrator
292
292
  @logger.info("\tEntitlements settings are equal for debug and release schemes.")
293
293
 
294
294
  put_key_array_element("com.apple.security.application-groups", @app_group, entitlements_debug_file_paths)
295
- put_string_value_into_xml(aps_env_key, development, entitlements_debug_file_paths)
295
+
296
+ #aps env should be set only for main target
297
+ if (target_name != @extension_target_name)
298
+ put_string_value_into_xml(aps_env_key, development, entitlements_debug_file_paths)
299
+ end
296
300
  else
297
301
  if (entitlements_debug_file_paths == nil or entitlements_debug_file_paths.empty?) and target_name != nil
298
302
  @logger.error("\tEntitlements debug settings are not set, creating entitlements file")
@@ -313,8 +317,12 @@ class NotificationExtensionIntegrator
313
317
  end
314
318
 
315
319
  put_key_array_element("com.apple.security.application-groups", @app_group, entitlements_debug_file_paths + entitlements_release_file_paths)
316
- put_string_value_into_xml(aps_env_key, development, entitlements_debug_file_paths)
317
- put_string_value_into_xml(aps_env_key, production, entitlements_release_file_paths)
320
+
321
+ #aps env should be set only for main target
322
+ if (target_name != @extension_target_name)
323
+ put_string_value_into_xml(aps_env_key, development, entitlements_debug_file_paths)
324
+ put_string_value_into_xml(aps_env_key, production, entitlements_release_file_paths)
325
+ end
318
326
  end
319
327
  end
320
328
 
@@ -410,11 +418,16 @@ class NotificationExtensionIntegrator
410
418
  remove_embed_framework_phase
411
419
  end
412
420
 
413
- def setup_target_capabilities(target_uuid)
414
- unless @project.root_object.attributes["TargetAttributes"]
415
- @project.root_object.attributes["TargetAttributes"] = Hash.new
416
- end
417
- existing_capabilities = @project.root_object.attributes["TargetAttributes"][target_uuid]
421
+ def setup_target_capabilities_for_extension_target
422
+ mobile_messaging_capabilities = {"SystemCapabilities" =>
423
+ {
424
+ "com.apple.ApplicationGroups.iOS" => {"enabled" => 1},
425
+ }
426
+ }
427
+ setup_target_capabilities(@extension_target.uuid, mobile_messaging_capabilities)
428
+ end
429
+
430
+ def setup_target_capabilities_for_main_target
418
431
  mobile_messaging_capabilities = {"SystemCapabilities" =>
419
432
  {
420
433
  "com.apple.ApplicationGroups.iOS" => {"enabled" => 1},
@@ -422,12 +435,20 @@ class NotificationExtensionIntegrator
422
435
  "com.apple.BackgroundModes" => {"enabled" => 1}
423
436
  }
424
437
  }
438
+ setup_target_capabilities(@main_target.uuid, mobile_messaging_capabilities)
439
+ end
440
+
441
+ def setup_target_capabilities(target_uuid, capabilities)
442
+ unless @project.root_object.attributes["TargetAttributes"]
443
+ @project.root_object.attributes["TargetAttributes"] = Hash.new
444
+ end
445
+ existing_capabilities = @project.root_object.attributes["TargetAttributes"][target_uuid]
425
446
  if existing_capabilities == nil
426
- @logger.info("\tSetting TargetAttributes #{mobile_messaging_capabilities} for target #{target_uuid}")
427
- @project.root_object.attributes["TargetAttributes"][target_uuid] = mobile_messaging_capabilities
447
+ @logger.info("\tSetting TargetAttributes #{capabilities} for target #{target_uuid}")
448
+ @project.root_object.attributes["TargetAttributes"][target_uuid] = capabilities
428
449
  else
429
- @logger.info("\tMerging TargetAttributes #{mobile_messaging_capabilities} for target #{target_uuid}")
430
- @project.root_object.attributes["TargetAttributes"][target_uuid] = existing_capabilities.merge(mobile_messaging_capabilities)
450
+ @logger.info("\tMerging TargetAttributes #{capabilities} for target #{target_uuid}")
451
+ @project.root_object.attributes["TargetAttributes"][target_uuid] = existing_capabilities.merge(capabilities)
431
452
  end
432
453
  end
433
454
 
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmine
2
- VERSION = "0.9.7"
3
- end
2
+ VERSION = "0.9.8"
3
+ end
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.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kadochnikov
@@ -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.8
76
+ rubygems_version: 3.1.2
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Mobile Messaging iOS Notification Extension Integration Tool made at Infobip