mmine 0.9.8 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f35cd02c0cba4408c3fd8747bdb3e791e91120ebe4bcd1d26033cb70d6b59f2
4
- data.tar.gz: 0ee9567a25d45a1c366faa4c25b17149860233fdb704fb97c7c31a3edf977cb5
3
+ metadata.gz: 9d120f4519d83f2b9d20285ebb9576ee4d2e57bcf4d0e13522d017b48cda3264
4
+ data.tar.gz: b98a2fa77b4fbdb6aaf8db620b0395abf4fb322fa4821b46fb8f27d93f4403e9
5
5
  SHA512:
6
- metadata.gz: cc6648442c1c45b85f9279066c3b5aa7e01c065752af509775902dca81317b94ce0a44477a1afd08db78e42df8b0bceccff43dff8de1e108faaa78dedaffc4aa
7
- data.tar.gz: fa5fdbac1811500e5bd859b70e77e5f215cea8073e4e36a7b40ae72dc31214eb5869b4810ad7662b41104ddbaed817f868ca773784985617064763a81b04901e
6
+ metadata.gz: c2d1965b045b7986ed53f91a34a5b5cee6bcf03d22646ad137c5197223d150b2a34ae0a75ae99645b554546322eae384205653e41d223d275e5e7310a0faf9e7
7
+ data.tar.gz: 5baaeef187da9f3153b80c00c7c444767f342467cba204aceb5af139c454f24edd688375a9a386a5ebe5b8bd3915388474e7697a21f061c1ba3159d0bef0d14d
data/bin/mmine CHANGED
@@ -32,6 +32,12 @@ 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
38
+ opts.on("-sl", "--static-linkage", "If cocoapods static linkage used for MobileMessaging pods") do |static_linkage|
39
+ options[:"static-linkage"] = static_linkage
40
+ end
35
41
  opts.on("-h", "--help", "Prints this help") do
36
42
  puts opts
37
43
  exit
@@ -47,7 +53,7 @@ when "integrate"
47
53
  unless missing.empty?
48
54
  raise OptionParser::MissingArgument.new(missing.join(', '))
49
55
  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")
56
+ 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, options[:"static-linkage"] || false)
51
57
  integrator.logger = Logger.new(STDOUT)
52
58
  integrator.logger.formatter = proc do |severity, datetime, progname, msg|
53
59
  "#{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, static_linkage)
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,8 @@ class NotificationExtensionIntegrator
23
23
  @xcframework = xcframework
24
24
  @swift_version = swift_ver
25
25
  @application_code = application_code
26
+ @override_signing = override_signing
27
+ @static_linkage = static_linkage
26
28
 
27
29
  @project_dir = Pathname.new(@project_file_path).parent.to_s
28
30
  @project = Xcodeproj::Project.open(@project_file_path)
@@ -34,6 +36,7 @@ class NotificationExtensionIntegrator
34
36
  @main_build_configurations_release = @main_target.build_configurations.select { |config| config.type == :release }
35
37
  @main_build_settings_debug = @main_build_configurations_debug.map(&:build_settings)
36
38
  @main_build_settings_release = @main_build_configurations_release.map(&:build_settings)
39
+
37
40
  end
38
41
 
39
42
  def logger=(_logger)
@@ -51,7 +54,10 @@ class NotificationExtensionIntegrator
51
54
  create_notification_extension_target
52
55
  create_notification_extension_dir
53
56
  add_notification_extension_source_code
54
- setup_development_team
57
+ setup_extension_target_signing(@override_signing)
58
+ if @override_signing == false
59
+ setup_development_team
60
+ end
55
61
  setup_deployment_target
56
62
  setup_notification_extension_info_plist
57
63
  setup_notification_extension_bundle_id
@@ -82,23 +88,73 @@ class NotificationExtensionIntegrator
82
88
  setup_copy_framework_script
83
89
  end
84
90
  else
85
- setup_entitlements(@main_build_configurations_debug.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
86
- @main_build_configurations_release.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
91
+ setup_entitlements(@main_build_configurations_debug.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
92
+ @main_build_configurations_release.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
87
93
  @main_target_name,
88
94
  @main_build_settings_debug,
89
95
  @main_build_settings_release)
90
96
 
91
- setup_entitlements(@extension_build_configurations_debug.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
92
- @extension_build_configurations_release.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
97
+ setup_entitlements(@extension_build_configurations_debug.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
98
+ @extension_build_configurations_release.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
93
99
  @extension_target_name,
94
100
  @extension_build_settings_debug,
95
101
  @extension_build_settings_release)
96
102
  end
97
103
 
104
+ if @static_linkage
105
+ setup_extension_lib_link('libMobileMessaging.a')
106
+ setup_extension_lib_link('libCocoaLumberjack.a')
107
+ setup_library_search_paths
108
+ end
109
+
98
110
  @project.save
99
111
  puts "🏁 Integration has been finished successfully!"
100
112
  end
101
113
 
114
+ def setup_library_search_paths
115
+ @logger.debug("Setup library search path")
116
+ set_notification_extension_build_settings('LIBRARY_SEARCH_PATHS', '"${BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/CocoaLumberjack" "${BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/MobileMessaging"')
117
+ end
118
+
119
+ def setup_extension_lib_link(lib_name)
120
+ if @extension_target.frameworks_build_phase.files_references.select { |ref| ref.path == lib_name }.first
121
+ @logger.info("Notification Extension target already has "+ lib_name + " linked.")
122
+ else
123
+ @logger.info("Adding "+ lib_name + " to Notification Extension target...")
124
+ ref = @project['Frameworks'].new_file(lib_name);
125
+ if ref
126
+ @extension_target.frameworks_build_phase.add_file_reference(ref)
127
+ else
128
+ @logger.error("Unable to add "+ lib_name + " to Notification Extension target!")
129
+ end
130
+ end
131
+ end
132
+
133
+ def setup_extension_target_signing(override_signing)
134
+ @logger.info("Overriding extension target signing: #{override_signing}")
135
+
136
+ signing_settings = {
137
+ 'DEVELOPMENT_TEAM' => '$MM_EXTENSION_DEVELOPMENT_TEAM',
138
+ 'CODE_SIGN_IDENTITY' => '$MM_EXTENSION_CODE_SIGN_IDENTITY',
139
+ }
140
+
141
+ signing_settings.keys.each do |key|
142
+ value = signing_settings[key]
143
+ @logger.info("Checking extension signing for key: #{key} value: #{value}")
144
+ if override_signing
145
+ set_notification_extension_build_settings(key, value)
146
+ else
147
+ # Delete setting if it was previously overridden
148
+ @extension_target.build_configurations.each do |config|
149
+ if config.resolve_build_setting(key) == value
150
+ @logger.info("Deletes extension setting for key: #{key} value: #{value}")
151
+ config.build_settings[key] = ''
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
157
+
102
158
  def create_notification_extension_target
103
159
  @extension_target_name = 'MobileMessagingNotificationExtension'
104
160
  @extension_source_name_filepath = File.join(Mmine.root, 'resources', 'NotificationService.swift')
@@ -175,7 +231,7 @@ class NotificationExtensionIntegrator
175
231
  end
176
232
 
177
233
  def setup_deployment_target
178
- set_notification_extension_build_settings('IPHONEOS_DEPLOYMENT_TARGET', "10.0")
234
+ set_notification_extension_build_settings('IPHONEOS_DEPLOYMENT_TARGET', "12.0")
179
235
  end
180
236
 
181
237
  def setup_notification_extension_info_plist
@@ -183,6 +239,7 @@ class NotificationExtensionIntegrator
183
239
  @logger.info("Notification extension info plist already exists on path: #{@extension_info_plist_path}")
184
240
  else
185
241
  @logger.info("Copying extension plist file to path: #{@extension_info_plist_path}")
242
+
186
243
  FileUtils.cp(@extension_plist_source_filepath, @extension_info_plist_path)
187
244
  get_notification_extension_group_reference.new_reference(@extension_info_plist_path) #check if additional plist manipulations needed (target membership?)
188
245
  end
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmine
2
- VERSION = "0.9.8"
2
+ VERSION = "0.10.0"
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.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kadochnikov
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.8.5
33
+ version: 1.13.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.8.5
40
+ version: 1.13.4
41
41
  description: Use this tool to automatically integrate your Xcode project with Infobips
42
42
  (https://www.infobip.com) Notification Service Extension
43
43
  email: andrey.kadochnikov@infobip.com
@@ -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.1.2
76
+ rubygems_version: 3.1.6
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Mobile Messaging iOS Notification Extension Integration Tool made at Infobip