mmine 0.9.11 → 0.12.0

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: 846ed86ca1bf73356fc8537b406e7dcd72cdbde4eee20f2c2a900b7662de81ec
4
- data.tar.gz: 6cca4fd1ff6d955392d66155aa2ee6ec5c40d6f38c7e2445264c569dcb31bb95
3
+ metadata.gz: f132bbc3d5d76e16424df401d6082e6a6804e25df28f11e78340ddd21cf178f5
4
+ data.tar.gz: e4651cd79878f66d210628b6a5d52d528a346a80aba742126943ab6ecea4c564
5
5
  SHA512:
6
- metadata.gz: ff1750a7f8f986ea26c3945b31e836311e54daef8c9936bd60a459ca91f4e0910ce03425ee25bc031b033e90df7a74e6313b95e6fc03e0fdb3ec6947028ea31e
7
- data.tar.gz: 93e728c640cf959abe354da9815534acc08a9131d3b0777d329687c319803075a2f82a4f50770f0499079762c2e017a096eaaaedb1557b32100f1878343c8ff1
6
+ metadata.gz: fd9414de4a3510f9f6761fd1d6a138e7e7a69f52893ec7883421724edcd3f9052adfc5e5aac582c834c7e5349b4424f84909769070526c086b4c3064dc21f4eb
7
+ data.tar.gz: 8713bc9396e9564a239f21e9f2d7936a8f1f08b7b739bec6651fc44cc432e4a52a62a83d0725aa6eb513073aa841f0f052daf3bd6324f8811cd8d0e1eff1875f
data/bin/mmine CHANGED
@@ -33,7 +33,13 @@ integrate_parse = OptionParser.new do |opts|
33
33
  options[:"swift-version"] = ver
34
34
  end
35
35
  opts.on("-s", "--override-signing", "Override parameters for MobileMessagingNotificationExtension signing using build flags") do |override|
36
- options[:"override-signing"] = override
36
+ options[:"override-signing"] = override
37
+ end
38
+ opts.on("-l", "--static-linkage", "If cocoapods static linkage used for MobileMessaging pods") do |static_linkage|
39
+ options[:"static-linkage"] = static_linkage
40
+ end
41
+ opts.on("-r", "--react-native", "Provide React-Native specific settings") do |react_native|
42
+ options[:"react-native"] = react_native
37
43
  end
38
44
  opts.on("-h", "--help", "Prints this help") do
39
45
  puts opts
@@ -50,7 +56,7 @@ when "integrate"
50
56
  unless missing.empty?
51
57
  raise OptionParser::MissingArgument.new(missing.join(', '))
52
58
  end
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)
59
+ 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, options[:"react-native"] || false)
54
60
  integrator.logger = Logger.new(STDOUT)
55
61
  integrator.logger.formatter = proc do |severity, datetime, progname, msg|
56
62
  "#{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, override_signing)
17
+ def initialize(application_code, project_file_path, app_group, main_target_name, cordova = false, xcframework = false, swift_ver, override_signing, static_linkage, react_native)
18
18
  @project_file_path = project_file_path
19
19
  @app_group = app_group
20
20
  @main_target_name = main_target_name
@@ -24,6 +24,8 @@ class NotificationExtensionIntegrator
24
24
  @swift_version = swift_ver
25
25
  @application_code = application_code
26
26
  @override_signing = override_signing
27
+ @static_linkage = static_linkage
28
+ @react_native = react_native
27
29
 
28
30
  @project_dir = Pathname.new(@project_file_path).parent.to_s
29
31
  @project = Xcodeproj::Project.open(@project_file_path)
@@ -35,6 +37,7 @@ class NotificationExtensionIntegrator
35
37
  @main_build_configurations_release = @main_target.build_configurations.select { |config| config.type == :release }
36
38
  @main_build_settings_debug = @main_build_configurations_debug.map(&:build_settings)
37
39
  @main_build_settings_release = @main_build_configurations_release.map(&:build_settings)
40
+
38
41
  end
39
42
 
40
43
  def logger=(_logger)
@@ -86,23 +89,50 @@ class NotificationExtensionIntegrator
86
89
  setup_copy_framework_script
87
90
  end
88
91
  else
89
- setup_entitlements(@main_build_configurations_debug.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
90
- @main_build_configurations_release.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
92
+ setup_entitlements(@main_build_configurations_debug.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
93
+ @main_build_configurations_release.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
91
94
  @main_target_name,
92
95
  @main_build_settings_debug,
93
96
  @main_build_settings_release)
94
97
 
95
- setup_entitlements(@extension_build_configurations_debug.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
96
- @extension_build_configurations_release.map { |config| config.resolve_build_setting('CODE_SIGN_ENTITLEMENTS') },
98
+ setup_entitlements(@extension_build_configurations_debug.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
99
+ @extension_build_configurations_release.map { |config| config.build_settings['CODE_SIGN_ENTITLEMENTS'] },
97
100
  @extension_target_name,
98
101
  @extension_build_settings_debug,
99
102
  @extension_build_settings_release)
100
103
  end
101
104
 
105
+ if @static_linkage
106
+ setup_extension_lib_link('libMobileMessaging.a')
107
+ unless @react_native
108
+ setup_extension_lib_link('libCocoaLumberjack.a')
109
+ end
110
+ setup_library_search_paths
111
+ end
112
+
102
113
  @project.save
103
114
  puts "🏁 Integration has been finished successfully!"
104
115
  end
105
116
 
117
+ def setup_library_search_paths
118
+ @logger.debug("Setup library search path")
119
+ set_notification_extension_build_settings('LIBRARY_SEARCH_PATHS', '"${BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/CocoaLumberjack" "${BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/MobileMessaging"')
120
+ end
121
+
122
+ def setup_extension_lib_link(lib_name)
123
+ if @extension_target.frameworks_build_phase.files_references.select { |ref| ref.path == lib_name }.first
124
+ @logger.info("Notification Extension target already has "+ lib_name + " linked.")
125
+ else
126
+ @logger.info("Adding "+ lib_name + " to Notification Extension target...")
127
+ ref = @project['Frameworks'].new_file(lib_name);
128
+ if ref
129
+ @extension_target.frameworks_build_phase.add_file_reference(ref)
130
+ else
131
+ @logger.error("Unable to add "+ lib_name + " to Notification Extension target!")
132
+ end
133
+ end
134
+ end
135
+
106
136
  def setup_extension_target_signing(override_signing)
107
137
  @logger.info("Overriding extension target signing: #{override_signing}")
108
138
 
@@ -204,7 +234,7 @@ class NotificationExtensionIntegrator
204
234
  end
205
235
 
206
236
  def setup_deployment_target
207
- set_notification_extension_build_settings('IPHONEOS_DEPLOYMENT_TARGET', "10.0")
237
+ set_notification_extension_build_settings('IPHONEOS_DEPLOYMENT_TARGET', "12.0")
208
238
  end
209
239
 
210
240
  def setup_notification_extension_info_plist
@@ -212,6 +242,7 @@ class NotificationExtensionIntegrator
212
242
  @logger.info("Notification extension info plist already exists on path: #{@extension_info_plist_path}")
213
243
  else
214
244
  @logger.info("Copying extension plist file to path: #{@extension_info_plist_path}")
245
+
215
246
  FileUtils.cp(@extension_plist_source_filepath, @extension_info_plist_path)
216
247
  get_notification_extension_group_reference.new_reference(@extension_info_plist_path) #check if additional plist manipulations needed (target membership?)
217
248
  end
data/lib/mmine/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mmine
2
- VERSION = "0.9.11"
2
+ VERSION = "0.12.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.11
4
+ version: 0.12.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