mmine 0.9.8 → 0.9.9

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: 6f35cd02c0cba4408c3fd8747bdb3e791e91120ebe4bcd1d26033cb70d6b59f2
4
- data.tar.gz: 0ee9567a25d45a1c366faa4c25b17149860233fdb704fb97c7c31a3edf977cb5
3
+ metadata.gz: cdd2da8bbe98ba3e12f896877783e2d66a3c65189e626ca2f91e1c9701cbb87f
4
+ data.tar.gz: 62536d99142467ad563846ad3a669f486ad0f89623de6970c1c106794ae5a558
5
5
  SHA512:
6
- metadata.gz: cc6648442c1c45b85f9279066c3b5aa7e01c065752af509775902dca81317b94ce0a44477a1afd08db78e42df8b0bceccff43dff8de1e108faaa78dedaffc4aa
7
- data.tar.gz: fa5fdbac1811500e5bd859b70e77e5f215cea8073e4e36a7b40ae72dc31214eb5869b4810ad7662b41104ddbaed817f868ca773784985617064763a81b04901e
6
+ metadata.gz: 2d1ea2afc7248f1e211b7a9f20a84f78fa5dcdc6cd3a78bba172fdad1cfc01514ac13240e3e566002f28125922b54f3a7386384364ccf52e0615a4f3789542d1
7
+ data.tar.gz: b9d8c6d40e423c64df0340874e4513367ca781b4b563bd64b4fa06a24f91c7c35f95b33980304a363f85196db47d95c0eba8363e100313cf0cac671247bdd379
data/bin/mmine CHANGED
@@ -32,6 +32,9 @@ integrate_parse = OptionParser.new do |opts|
32
32
  opts.on("--swift-version", "--swift-version SWIFT_VER", "Provide Swift Language version for notification extension (by default 5)") do |ver|
33
33
  options[:"swift-version"] = ver
34
34
  end
35
+ opts.on("-s", "--override-signing", "Override parameters for MobileMessagingNotificationExtension signing using build flags") do |override|
36
+ options[:"override-signing"] = override
37
+ end
35
38
  opts.on("-h", "--help", "Prints this help") do
36
39
  puts opts
37
40
  exit
@@ -47,7 +50,7 @@ when "integrate"
47
50
  unless missing.empty?
48
51
  raise OptionParser::MissingArgument.new(missing.join(', '))
49
52
  end
50
- integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:xcframework] || false, options[:"swift-version"] || "5")
53
+ integrator = NotificationExtensionIntegrator.new(options[:"application-code"], options[:project], options[:"app-group"], options[:target], options[:cordova] || false, options[:xcframework] || false, options[:"swift-version"] || "5", options[:"override-signing"] || false)
51
54
  integrator.logger = Logger.new(STDOUT)
52
55
  integrator.logger.formatter = proc do |severity, datetime, progname, msg|
53
56
  "#{severity}: #{msg}\n"
@@ -14,7 +14,7 @@ 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, xcframework = false, swift_ver)
17
+ def initialize(application_code, project_file_path, app_group, main_target_name, cordova = false, xcframework = false, swift_ver, override_signing)
18
18
  @project_file_path = project_file_path
19
19
  @app_group = app_group
20
20
  @main_target_name = main_target_name
@@ -23,6 +23,7 @@ class NotificationExtensionIntegrator
23
23
  @xcframework = xcframework
24
24
  @swift_version = swift_ver
25
25
  @application_code = application_code
26
+ @override_signing = override_signing
26
27
 
27
28
  @project_dir = Pathname.new(@project_file_path).parent.to_s
28
29
  @project = Xcodeproj::Project.open(@project_file_path)
@@ -51,7 +52,10 @@ class NotificationExtensionIntegrator
51
52
  create_notification_extension_target
52
53
  create_notification_extension_dir
53
54
  add_notification_extension_source_code
54
- setup_development_team
55
+ setup_extension_target_signing(@override_signing)
56
+ if @override_signing == false
57
+ setup_development_team
58
+ end
55
59
  setup_deployment_target
56
60
  setup_notification_extension_info_plist
57
61
  setup_notification_extension_bundle_id
@@ -99,6 +103,31 @@ class NotificationExtensionIntegrator
99
103
  puts "🏁 Integration has been finished successfully!"
100
104
  end
101
105
 
106
+ def setup_extension_target_signing(override_signing)
107
+ @logger.info("Overriding extension target signing: #{override_signing}")
108
+
109
+ signing_settings = {
110
+ 'DEVELOPMENT_TEAM' => '$MM_EXTENSION_DEVELOPMENT_TEAM',
111
+ 'CODE_SIGN_IDENTITY' => '$MM_EXTENSION_CODE_SIGN_IDENTITY',
112
+ }
113
+
114
+ signing_settings.keys.each do |key|
115
+ value = signing_settings[key]
116
+ @logger.info("Checking extension signing for key: #{key} value: #{value}")
117
+ if override_signing
118
+ set_notification_extension_build_settings(key, value)
119
+ else
120
+ # Delete setting if it was previously overridden
121
+ @extension_target.build_configurations.each do |config|
122
+ if config.resolve_build_setting(key) == value
123
+ @logger.info("Deletes extension setting for key: #{key} value: #{value}")
124
+ config.build_settings[key] = ''
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
130
+
102
131
  def create_notification_extension_target
103
132
  @extension_target_name = 'MobileMessagingNotificationExtension'
104
133
  @extension_source_name_filepath = File.join(Mmine.root, 'resources', 'NotificationService.swift')
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmine
2
- VERSION = "0.9.8"
2
+ VERSION = "0.9.9"
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.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kadochnikov