mmine 0.6.5 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f2045b61641a12e8589ce89426cd8073c7d4cf53f1a5168cb39819156bbcaa4
4
- data.tar.gz: 540a3ddc21c8b271c39cd4cb16313f7a3ef39151011a5d5462026bb425f07226
3
+ metadata.gz: e954c8320114b22e8062b363ded4f3274ebe323b27a39f24432facebf5a958d0
4
+ data.tar.gz: e5b4394d26966e6a4d7e739f689f9f1fa4ea2862b0d1f53643958d26a6ec78ac
5
5
  SHA512:
6
- metadata.gz: aea5dcc25c0e993d5d8da8ff13d3b9654fc657dbcc149bb1b009294a7bcef4920e7b81b1c65fe4d1fabc040cf17b16602770c55811aefad8d05d4d1eeec3bdbc
7
- data.tar.gz: 65517bb0840ce538f47ea6df617f6f66b74100257b810ca0355485d513b9e21013cf244a15bdc8d188cfe8f62a1220d599aca74b0966d4322cd487677cc35360
6
+ metadata.gz: 52eee2c13848eb4023dac1179808622631a9d473af152a7938fabfc620473b0357b20045043cfcec57497bec9be095ca0cba5a907a22e38a14381a901db98d26
7
+ data.tar.gz: d689da4b712e5c27044eaa51de005986ea03415344b72f0e723b2d6de5d18868c82f42de3ed4fde9a0c8c13340eca992bffa17ce477aace0f05b2c1a1b9529f8
data/bin/mmine CHANGED
@@ -23,7 +23,7 @@ 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("--cordova", "--cordova", "Provide Cordova project specific settings.") do |verbose|
26
+ opts.on("-c", "--cordova", "Provide Cordova project specific settings.") do |verbose|
27
27
  options[:cordova] = verbose
28
28
  end
29
29
  opts.on("--swift-version", "--swift-version SWIFT_VER", "Provide Swift Language version for notification extension (by default 4.2)") do |ver|
@@ -24,6 +24,7 @@ class NotificationExtensionIntegrator
24
24
  @project_dir = Pathname.new(@project_file_path).parent.to_s
25
25
  @project = Xcodeproj::Project.open(@project_file_path)
26
26
  @ne_target_name = 'MobileMessagingNotificationExtension'
27
+ @framework_file_name = "MobileMessaging.framework"
27
28
  @extension_source_name_filepath = File.join(Mmine.root, 'resources','NotificationService.swift')
28
29
  @extension_dir_name = 'NotificationExtension'
29
30
  @extension_destination_dir = File.join(@project_dir, @extension_dir_name)
@@ -67,9 +68,7 @@ class NotificationExtensionIntegrator
67
68
  setupMainTargetDependency()
68
69
  setupSwiftVersion()
69
70
  setupProductName()
70
- setupBuilNumber()
71
-
72
- # todo : remove MobileMessaging.framework from mains target Embed Frameworks
71
+ setupBuildNumber()
73
72
 
74
73
  if @cordova
75
74
  setupFrameworkSearchPaths()
@@ -222,7 +221,7 @@ class NotificationExtensionIntegrator
222
221
  setNotificationExtensionBuildSettings('PRODUCT_NAME', @ne_target_name)
223
222
  end
224
223
 
225
- def setupBuilNumber
224
+ def setupBuildNumber
226
225
  version_key = "CFBundleShortVersionString"
227
226
  build_key = "CFBundleVersion"
228
227
  main_version = getXMLStringValue(version_key, @main_target_release_plist)
@@ -249,8 +248,8 @@ class NotificationExtensionIntegrator
249
248
  def setupCopyFrameworkScript
250
249
  phase_name = "Copy Frameworks"
251
250
  shell_script = "/usr/local/bin/carthage copy-frameworks"
252
- input_path = "$SRCROOT/$PROJECT/Plugins/com-infobip-plugins-mobilemessaging/MobileMessaging.framework"
253
- output_path = "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/MobileMessaging.framework"
251
+ input_path = "$SRCROOT/$PROJECT/Plugins/com-infobip-plugins-mobilemessaging/#{@framework_file_name}"
252
+ output_path = "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/#{@framework_file_name}"
254
253
  existing_phase = @main_target.shell_script_build_phases.select { |phase| phase.shell_script.include? shell_script }.first
255
254
 
256
255
  unless existing_phase
@@ -266,6 +265,7 @@ class NotificationExtensionIntegrator
266
265
 
267
266
  @logger.info("Main target already has #{phase_name} shell script set up")
268
267
  end
268
+ removeEmbedFrameworkPhase()
269
269
  end
270
270
 
271
271
  def setupEntitlements(_build_settings_debug, _build_settings_release, target_name)
@@ -324,8 +324,10 @@ class NotificationExtensionIntegrator
324
324
  }
325
325
  }
326
326
  if exitsting_capabilities == nil
327
+ @logger.info("\tSetting TargetAttributes #{mobilemessaging_capabilities} for extension")
327
328
  @project.root_object.attributes["TargetAttributes"][@ne_target.uuid] = mobilemessaging_capabilities
328
329
  else
330
+ @logger.info("\tMerging TargetAttributes #{mobilemessaging_capabilities} for extension")
329
331
  @project.root_object.attributes["TargetAttributes"][@ne_target.uuid] = exitsting_capabilities.merge(mobilemessaging_capabilities)
330
332
  end
331
333
  end
@@ -343,12 +345,29 @@ class NotificationExtensionIntegrator
343
345
  }
344
346
  }
345
347
  if exitsting_capabilities == nil
348
+ @logger.info("\tSetting TargetAttributes #{mobilemessaging_capabilities} for main target")
346
349
  @project.root_object.attributes["TargetAttributes"][@main_target.uuid] = mobilemessaging_capabilities
347
350
  else
351
+ @logger.info("\tMerging TargetAttributes #{mobilemessaging_capabilities} for main target")
348
352
  @project.root_object.attributes["TargetAttributes"][@main_target.uuid] = exitsting_capabilities.merge(mobilemessaging_capabilities)
349
353
  end
350
354
  end
351
355
 
356
+
357
+ def removeEmbedFrameworkPhase
358
+ emb_fs = @main_target.copy_files_build_phases
359
+ .select { |phase|
360
+ phase.dst_subfolder_spec == '10'
361
+ }.each { |phase|
362
+ phase.files.select { |file|
363
+ file.display_name == @framework_file_name
364
+ }.each { |file|
365
+ @logger.info("\tRemoving embeddin #{@framework_file_name} from phase #{phase.display_name}")
366
+ phase.remove_build_file(file)
367
+ }
368
+ }
369
+ end
370
+
352
371
  def resolveXcodePath(path)
353
372
  return path.sub(@project_dir, '$(PROJECT_DIR)')
354
373
  end
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmine
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
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.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kadochnikov