mmine 0.8.6 → 0.9.5

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: e5dd59a39d23c3d53c40ceeaf519eec10e74db28ddc4a57fd11750de577b3df1
4
- data.tar.gz: 147ea27c12354f50c206ba27bd07bddd431b4b8ce57ca2b2d177d198124a260f
3
+ metadata.gz: 405a52d98e4702d1036467797ff10e3744660aa817059c7d5c51b0d186af94de
4
+ data.tar.gz: 0b4bd052c74edfe002c0dac01493df6ca442256f12380f007bba5d7527f918a7
5
5
  SHA512:
6
- metadata.gz: 0a0237cca59b19fd977e288433271e62c896167b11158dae837f7a7c2c957815512e8803b1d6c36bf5883290f819ecbfeee3400ff3bc12501b1a4e53327e2566
7
- data.tar.gz: 06c16f9ff748485fb16c0dbbf237a5038e2deb4e27ad909761b199070b2acb94928fd0b478dc31506203898e8cea3f8724ea2db0d94816689bd810b53706f668
6
+ metadata.gz: db7f77d620c59e9ea1aa2592b0133622a6583bdeb446c6daf5d5758c5485f7ed8dfd4c86fa201e71c372324a9b0dd0e06681af82626a666bf045e3ac7069e2bf
7
+ data.tar.gz: 571c5a83fad2c049a6d677fdeca72ce4853fc2e17c54868ce8c08e07dab62c45582203d40fec55f2bb62c8f1790ae7f923e37fdca7532468122383589fe1ad27
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 |verbose|
27
- options[:cordova] = verbose
26
+ opts.on("-c", "--cordova", "Provide Cordova project specific settings.") do |cordova|
27
+ options[:cordova] = cordova
28
28
  end
29
- opts.on("--swift-version", "--swift-version SWIFT_VER", "Provide Swift Language version for notification extension (by default 4.2)") do |ver|
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"] || "4.2")
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
 
@@ -76,7 +77,9 @@ class NotificationExtensionIntegrator
76
77
  @main_build_settings_release)
77
78
  setup_extension_lib_cordova_link
78
79
  setup_framework_search_paths
79
- setup_copy_framework_script
80
+ unless @xcframework
81
+ setup_copy_framework_script
82
+ end
80
83
  else
81
84
  setup_entitlements(@main_build_configurations_debug.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
82
85
  @main_build_configurations_release.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
@@ -189,7 +192,7 @@ class NotificationExtensionIntegrator
189
192
  suffix = 'notification-extension'
190
193
  key = 'PRODUCT_BUNDLE_IDENTIFIER'
191
194
  (@main_build_configurations_release + @main_build_configurations_debug).each do |config|
192
- bundleId = config.resolve_build_setting(key)
195
+ bundleId = resolve_recursive_build_setting(config, key)
193
196
  if bundleId == nil
194
197
  plist_path = resolve_absolute_paths([config.resolve_build_setting("INFOPLIST_FILE")]).first
195
198
  bundleId = get_xml_string_value(key, plist_path)
@@ -203,6 +206,49 @@ class NotificationExtensionIntegrator
203
206
  end
204
207
  end
205
208
 
209
+ # https://github.com/CocoaPods/Xcodeproj/issues/505#issuecomment-584699008
210
+ # Augments config.resolve_build_setting from xcproject
211
+ # to continue expanding build settings and evaluate modifiers
212
+ def resolve_recursive_build_setting(config, setting)
213
+ resolution = config.resolve_build_setting(setting)
214
+
215
+ # finds values with one of
216
+ # $VALUE
217
+ # $(VALLUE)
218
+ # $(VALUE:modifier)
219
+ # ${VALUE}
220
+ # ${VALUE:modifier}
221
+ resolution.gsub(/\$[\(\{]?.+[\)\}]?/) do |raw_value|
222
+ # strip $() characters
223
+ unresolved = raw_value.gsub(/[\$\(\)\{\}]/, '')
224
+
225
+ # Get the modifiers after the ':' characters
226
+ name, *modifiers = unresolved.split(':')
227
+
228
+ # Expand variable name
229
+ subresolution = resolve_recursive_build_setting(config, name)
230
+
231
+ # Apply modifiers
232
+ # NOTE: not all cases accounted for
233
+ #
234
+ # See http://codeworkshop.net/posts/xcode-build-setting-transformations
235
+ # for various modifier options
236
+ modifiers.each do |modifier|
237
+ case modifier
238
+ when 'lower'
239
+ subresolution.downcase!
240
+ when 'upper'
241
+ subresolution.upcase!
242
+ else
243
+ # Fastlane message
244
+ @logger.info("Unknown modifier: `#{modifier}` in `#{raw_value}")
245
+ end
246
+ end
247
+
248
+ subresolution
249
+ end
250
+ end
251
+
206
252
  def create_entitlements_file(_entitlements_name)
207
253
  entitlements_destination_filepath = File.join(@project_dir, _entitlements_name)
208
254
  entitlements_source_filepath = File.join(Mmine.root, 'resources', "MobileMessagingNotificationExtension.entitlements")
@@ -421,7 +467,7 @@ class NotificationExtensionIntegrator
421
467
  return group_reference
422
468
  end
423
469
 
424
- def resolve_absolute_paths(paths)
470
+ def resolve_absolute_paths(paths)
425
471
  paths.map do |path|
426
472
  ret = path
427
473
  ["$(PROJECT_DIR)", "$PROJECT_DIR"].each do |proj_dir|
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmine
2
- VERSION = "0.8.6"
2
+ VERSION = "0.9.5"
3
3
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kadochnikov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2018-10-16 00:00:00.000000000 Z
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.6.0
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.6.0
26
+ version: 1.20.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ licenses:
58
58
  - MIT
59
59
  metadata:
60
60
  source_code_url: https://github.com/infobip/mobile-messaging-mmine
61
- post_install_message:
61
+ post_install_message:
62
62
  rdoc_options: []
63
63
  require_paths:
64
64
  - lib
@@ -73,8 +73,8 @@ 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.2
77
- signing_key:
76
+ rubygems_version: 3.1.2
77
+ signing_key:
78
78
  specification_version: 4
79
79
  summary: Mobile Messaging iOS Notification Extension Integration Tool made at Infobip
80
80
  (https://www.infobip.com)!!!