mmine 0.7.5 → 0.7.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
- SHA1:
3
- metadata.gz: '067639c9e8125d67e9385f760218f5157bc00692'
4
- data.tar.gz: 75b4b96d6e3e5903ddc1fec0ab31868aa4e05598
2
+ SHA256:
3
+ metadata.gz: b93bff8cb6f6805674448c80182bb7528c615151558b0f3fa895f82f688be025
4
+ data.tar.gz: e4d80b4079119fd0ed02f25ab06c96be9c3b0acc147349fb3c7aeaefb82970d8
5
5
  SHA512:
6
- metadata.gz: 368bc89e02e79061374c25d3fdc031446607073e8b89e061de852181ed435fa9aa3b38ec83cf6ef8b2459fee95a849a0c064a09ee21e08c22369719a3b38b74c
7
- data.tar.gz: 2a6e089e40329a2f76781935a8c785682a1b1217967895850197228d2b39a5ef176e20bb6289f8ea36c4def5ef4bedf37c9d25a83406a01f2ab488eadbbedcb0
6
+ metadata.gz: 251873c65c14bb0098e2aa6bd179d4925f36229b075ffdc2854cf7c8d19fb0b6941d4f9b5943da5fbc7b1e4dd623a94a6b8a99aee4ab6aad1d967b83ca1715d2
7
+ data.tar.gz: bb3949d9bf9b815ef100fb19f8cefdf4f1a5c7e514701c55d6e6bf4dce656d3357c45c2cc50e533cf917cc7c96a761fc9bba15d5f53f95d362475f4290506fd1
@@ -60,7 +60,7 @@ class NotificationExtensionIntegrator
60
60
  setupDeploymentTarget()
61
61
  setupNotificationExtensionInfoPlist()
62
62
  setupNotificationExtensionBundleId()
63
- setupCommonEntitlementsFiles()
63
+
64
64
  setupUserAppGroupValue()
65
65
  setupBackgroundModesPlistValue()
66
66
 
@@ -74,10 +74,14 @@ class NotificationExtensionIntegrator
74
74
  setupBuildNumber()
75
75
 
76
76
  if @cordova
77
+ setupEntitlements(resolveAbsolutePath("$(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-Debug.plist"),resolveAbsolutePath("$(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-Release.plist"), nil, @main_target_build_settings_debug, @main_target_build_settings_release)
77
78
  setupFrameworkSearchPaths()
78
79
  setupRunpathSearchPaths()
79
80
  setupLibCordovaLink()
80
81
  setupCopyFrameworkScript()
82
+ else
83
+ setupEntitlements(@main_target_build_settings_debug['CODE_SIGN_ENTITLEMENTS'], @main_target_build_settings_release['CODE_SIGN_ENTITLEMENTS'], @main_target_name, @main_target_build_settings_debug, @main_target_build_settings_release)
84
+ setupEntitlements(@extension_build_settings_debug['CODE_SIGN_ENTITLEMENTS'], @extension_build_settings_release['CODE_SIGN_ENTITLEMENTS'], @ne_target_name, @extension_build_settings_debug, @extension_build_settings_release)
81
85
  end
82
86
 
83
87
  @project.save()
@@ -171,35 +175,57 @@ class NotificationExtensionIntegrator
171
175
  end
172
176
  end
173
177
 
174
- def setupCommonEntitlementsFiles
175
- entitlements_debug_filepath = resolveAbsolutePath("$(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-Debug.plist") #todo
176
- entitlements_release_filepath = resolveAbsolutePath("$(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-Release.plist") #todo
178
+ def createEntitlementsFile(_entitlements_name)
179
+ entitlements_destination_filepath = File.join(@project_dir, _entitlements_name)
180
+ entitlements_source_filepath = File.join(Mmine.root, 'resources', "MobileMessagingNotificationExtension.entitlements")
181
+ unless File.exist?(entitlements_destination_filepath)
182
+ @logger.info("\tCopying entitlemenst file to path: #{entitlements_destination_filepath}")
183
+ FileUtils.cp(entitlements_source_filepath, entitlements_destination_filepath)
184
+ ref = @project.main_group.new_reference(entitlements_destination_filepath)
185
+ ref.last_known_file_type = "text.xml"
186
+ else
187
+ @logger.info("\tEntitlements file already exists on path: #{entitlements_destination_filepath}")
188
+ end
189
+ return resolveXcodePath(entitlements_destination_filepath)
190
+ end
177
191
 
192
+ def setupEntitlements(entitlements_debug_filepath, entitlements_release_filepath, target_name, _build_settings_debug, _build_settings_release)
178
193
  key = 'CODE_SIGN_ENTITLEMENTS'
179
194
 
195
+ if entitlements_debug_filepath == nil and entitlements_release_filepath == nil and target_name != nil
196
+ @logger.info("\tEntitlements are not set for both release and debug schemes, setting up...")
197
+ entitlements_destination_filepath = createEntitlementsFile("#{target_name}.entitlements")
198
+
199
+ @logger.info("\tSetting build settings:\n\t\tdebug: \t#{key}\t#{entitlements_destination_filepath}\n\t\trelease:\t#{key}\t#{entitlements_destination_filepath}")
200
+
201
+ _build_settings_debug[key] = entitlements_destination_filepath
202
+ _build_settings_release[key] = entitlements_destination_filepath
203
+ entitlements_debug_filepath = entitlements_destination_filepath
204
+ entitlements_release_filepath = entitlements_destination_filepath
205
+ end
206
+
180
207
  if entitlements_debug_filepath == entitlements_release_filepath
181
208
  @logger.info("\tEntitlements settings are equal for debug and release schemes.")
182
209
 
183
210
  putKeyArrayElement("com.apple.security.application-groups", @app_group, entitlements_debug_filepath)
184
211
  putStringValueIntoXML("aps-environment", "development", entitlements_debug_filepath)
185
212
  else
186
- if entitlements_debug_filepath != nil
187
- @logger.info("\tEntitlements debug settings already set, updating settings...")
188
- putKeyArrayElement("com.apple.security.application-groups", @app_group, entitlements_debug_filepath)
189
- putStringValueIntoXML("aps-environment", "development", entitlements_debug_filepath)
190
- else
191
- @logger.error("\tEntitlements debug settings are not set")
192
- # stop here
213
+ if entitlements_debug_filepath == nil and target_name != nil
214
+ @logger.error("\tEntitlements debug settings are not set, creating entitlements file")
215
+ entitlements_debug_filepath = createEntitlementsFile("#{target_name}_debug.entitlements")
216
+ _build_settings_debug[key] = entitlements_debug_filepath
193
217
  end
194
218
 
195
- if entitlements_release_filepath != nil
196
- @logger.info("\tEntitlements release settings already set, updating settings...")
197
- putKeyArrayElement("com.apple.security.application-groups", @app_group, entitlements_release_filepath)
198
- putStringValueIntoXML("aps-environment", "production", entitlements_release_filepath)
199
- else
200
- @logger.error("\tEntitlements debug settings are not set")
201
- # stop here
219
+ if entitlements_release_filepath == nil and target_name != nil
220
+ @logger.error("\tEntitlements release settings are not set, creating entitlements file")
221
+ entitlements_release_filepath = createEntitlementsFile("#{target_name}_release.entitlements")
222
+ _build_settings_release[key] = entitlements_release_filepath
202
223
  end
224
+
225
+ putKeyArrayElement("com.apple.security.application-groups", @app_group, entitlements_debug_filepath)
226
+ putStringValueIntoXML("aps-environment", "development", entitlements_debug_filepath)
227
+ putKeyArrayElement("com.apple.security.application-groups", @app_group, entitlements_release_filepath)
228
+ putStringValueIntoXML("aps-environment", "production", entitlements_release_filepath)
203
229
  end
204
230
  end
205
231
 
@@ -422,6 +448,7 @@ class NotificationExtensionIntegrator
422
448
  end
423
449
 
424
450
  def putKeyArrayElement(key, value, filepath) # check if it appends to existing array
451
+ filepath = resolveAbsolutePath(filepath)
425
452
  doc = Nokogiri::XML(IO.read(filepath))
426
453
  key_node = doc.search("//dict//key[text() = '#{key}']").first
427
454
  string_app_group_value = Nokogiri::XML::Node.new("string",doc)
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmine
2
- VERSION = "0.7.5"
2
+ VERSION = "0.7.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.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Kadochnikov
@@ -73,8 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubyforge_project:
77
- rubygems_version: 2.5.2.3
76
+ rubygems_version: 3.0.2
78
77
  signing_key:
79
78
  specification_version: 4
80
79
  summary: Mobile Messaging iOS Notification Extension Integration Tool made at Infobip