ghunit 1.0.3 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ghunit/project.rb +35 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a66f630cc8d025fc49e667d21003270f4801852
4
- data.tar.gz: 17b660998273b7c109caf58cd00052acc6983516
3
+ metadata.gz: 63824f5fdb56f2b3030584f509eedddc8a213113
4
+ data.tar.gz: f09b4e77865153c4d4253b3ed985f68aedb2be55
5
5
  SHA512:
6
- metadata.gz: 5f9ea6fdc8920b70a7b1c136cf1afc6ae42ad6a4d0742f0619281f46734e14b8a23984fc280b238269903b7193125134b331df20938c7e4ad99011f149dd37bd
7
- data.tar.gz: 034250b2339e8bb010a47d074a8f2b170ee3d39792d6f81174da28165a5f8ee3f35d1eddab19c169571ba5ca29bf98344af19a3b12573afcd53bf8e1921e50ab
6
+ metadata.gz: b45dd7c6617090494abee3b35af536d258273b63ca68002a94666a8a2d58b31291e617df6aa461bdbd4d07f90e8425d4c88de00c8ba85b084623ee4d855b2d85
7
+ data.tar.gz: f9065ab432fedb4031d2987534e7c598b94fb7d6b9f5d91bc2594ef3c963b7e39878e8f3dabd75d741628581611a9704edce25a8134c3fba3f616e20d0e3f94e
@@ -1,5 +1,4 @@
1
1
  require 'xcodeproj'
2
- require 'xcodeproj/ext'
3
2
  require 'fileutils'
4
3
  require 'logger'
5
4
  require 'colorize'
@@ -153,7 +152,8 @@ class GHUnit::Project
153
152
  end
154
153
 
155
154
  # Get main target prefix header
156
- prefix_header = main_target.build_settings("Debug")["GCC_PREFIX_HEADER"]
155
+ debug_settings = main_target.build_settings("Debug")
156
+ prefix_header = debug_settings["GCC_PREFIX_HEADER"] if debug_settings
157
157
 
158
158
  # Clear default OTHER_LDFLAGS (otherwise CocoaPods gives a warning)
159
159
  test_target.build_configurations.each do |c|
@@ -277,6 +277,39 @@ Make sure to open the .xcworkspace.
277
277
  EOS
278
278
  end
279
279
 
280
+ def sync_test_target_membership
281
+ test_target = find_test_target
282
+ if !test_target
283
+ logger.error "No test target to add to"
284
+ return false
285
+ end
286
+
287
+ tests_group = project.groups.select { |g| g.name == test_target_name }.first
288
+ if !tests_group
289
+ logger.error "No test group to add to"
290
+ return false
291
+ end
292
+
293
+ sources_phase = main_target.build_phases.select { |p|
294
+ p.class == Xcodeproj::Project::Object::PBXSourcesBuildPhase }.first
295
+
296
+ if !sources_phase
297
+ logger.error "No main target source phase found"
298
+ return false
299
+ end
300
+
301
+ logger.debug "Adding to test target: "
302
+ sources_phase.files_references.each do |file_ref|
303
+ next if file_ref.path == "main.m"
304
+ test_file = tests_group.find_file_by_path(file_ref.path)
305
+ if !test_file
306
+ logger.debug " #{file_ref.path}"
307
+ test_target.add_file_references([file_ref])
308
+ end
309
+ end
310
+ project.save
311
+ end
312
+
280
313
  def install_run_tests_script
281
314
  run_script_name = "Run Tests (CLI)"
282
315
  # Find run script build phase and install RunTests.sh
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghunit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Handford
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.2.2
104
+ rubygems_version: 2.4.5
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: GHUnit