cocoapods 1.6.2 → 1.7.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +101 -7
  3. data/README.md +9 -9
  4. data/lib/cocoapods.rb +2 -0
  5. data/lib/cocoapods/command.rb +1 -1
  6. data/lib/cocoapods/command/init.rb +2 -12
  7. data/lib/cocoapods/command/install.rb +3 -0
  8. data/lib/cocoapods/command/lib/create.rb +1 -1
  9. data/lib/cocoapods/command/lib/lint.rb +5 -1
  10. data/lib/cocoapods/command/list.rb +3 -5
  11. data/lib/cocoapods/command/repo.rb +1 -0
  12. data/lib/cocoapods/command/repo/add.rb +4 -5
  13. data/lib/cocoapods/command/repo/add_cdn.rb +58 -0
  14. data/lib/cocoapods/command/repo/list.rb +5 -6
  15. data/lib/cocoapods/command/repo/push.rb +6 -5
  16. data/lib/cocoapods/command/spec/create.rb +12 -12
  17. data/lib/cocoapods/command/spec/lint.rb +1 -1
  18. data/lib/cocoapods/command/update.rb +3 -0
  19. data/lib/cocoapods/config.rb +1 -0
  20. data/lib/cocoapods/executable.rb +32 -7
  21. data/lib/cocoapods/gem_version.rb +1 -1
  22. data/lib/cocoapods/generator/app_target_helper.rb +1 -1
  23. data/lib/cocoapods/generator/embed_frameworks_script.rb +13 -0
  24. data/lib/cocoapods/generator/file_list.rb +39 -0
  25. data/lib/cocoapods/generator/module_map.rb +1 -1
  26. data/lib/cocoapods/installer.rb +188 -46
  27. data/lib/cocoapods/installer/analyzer.rb +64 -39
  28. data/lib/cocoapods/installer/analyzer/pod_variant.rb +14 -9
  29. data/lib/cocoapods/installer/analyzer/pod_variant_set.rb +11 -2
  30. data/lib/cocoapods/installer/installation_options.rb +70 -44
  31. data/lib/cocoapods/installer/pod_source_installer.rb +9 -4
  32. data/lib/cocoapods/installer/podfile_validator.rb +9 -0
  33. data/lib/cocoapods/installer/post_install_hooks_context.rb +5 -2
  34. data/lib/cocoapods/installer/project_cache/project_cache.rb +11 -0
  35. data/lib/cocoapods/installer/project_cache/project_cache_analysis_result.rb +53 -0
  36. data/lib/cocoapods/installer/project_cache/project_cache_analyzer.rb +156 -0
  37. data/lib/cocoapods/installer/project_cache/project_cache_version.rb +43 -0
  38. data/lib/cocoapods/installer/project_cache/project_installation_cache.rb +77 -0
  39. data/lib/cocoapods/installer/project_cache/project_metadata_cache.rb +63 -0
  40. data/lib/cocoapods/installer/project_cache/target_cache_key.rb +134 -0
  41. data/lib/cocoapods/installer/project_cache/target_metadata.rb +70 -0
  42. data/lib/cocoapods/installer/sandbox_dir_cleaner.rb +89 -0
  43. data/lib/cocoapods/installer/sandbox_header_paths_installer.rb +45 -0
  44. data/lib/cocoapods/installer/target_uuid_generator.rb +32 -0
  45. data/lib/cocoapods/installer/user_project_integrator.rb +8 -6
  46. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +128 -63
  47. data/lib/cocoapods/installer/xcode.rb +3 -0
  48. data/lib/cocoapods/installer/xcode/multi_pods_project_generator.rb +72 -0
  49. data/lib/cocoapods/installer/xcode/pods_project_generator.rb +102 -218
  50. data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_dependency_installer.rb +75 -0
  51. data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +1 -1
  52. data/lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb +29 -17
  53. data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +31 -65
  54. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_dependency_installer.rb +155 -0
  55. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +265 -110
  56. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +70 -43
  57. data/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb +75 -0
  58. data/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb +119 -0
  59. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb +44 -7
  60. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb +5 -7
  61. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer_helper.rb +32 -0
  62. data/lib/cocoapods/installer/xcode/pods_project_generator_result.rb +35 -0
  63. data/lib/cocoapods/installer/xcode/single_pods_project_generator.rb +38 -0
  64. data/lib/cocoapods/installer/xcode/target_validator.rb +32 -25
  65. data/lib/cocoapods/native_target_extension.rb +54 -0
  66. data/lib/cocoapods/open-uri.rb +1 -1
  67. data/lib/cocoapods/podfile.rb +13 -0
  68. data/lib/cocoapods/project.rb +88 -10
  69. data/lib/cocoapods/resolver.rb +11 -8
  70. data/lib/cocoapods/resolver/resolver_specification.rb +7 -7
  71. data/lib/cocoapods/sandbox.rb +38 -9
  72. data/lib/cocoapods/sandbox/file_accessor.rb +21 -0
  73. data/lib/cocoapods/sandbox/headers_store.rb +18 -3
  74. data/lib/cocoapods/sandbox/pod_dir_cleaner.rb +1 -14
  75. data/lib/cocoapods/sources_manager.rb +11 -3
  76. data/lib/cocoapods/target.rb +67 -7
  77. data/lib/cocoapods/target/aggregate_target.rb +70 -8
  78. data/lib/cocoapods/target/build_settings.rb +124 -65
  79. data/lib/cocoapods/target/build_type.rb +139 -0
  80. data/lib/cocoapods/target/framework_paths.rb +12 -7
  81. data/lib/cocoapods/target/pod_target.rb +322 -65
  82. data/lib/cocoapods/user_interface.rb +2 -2
  83. data/lib/cocoapods/user_interface/error_report.rb +3 -0
  84. data/lib/cocoapods/user_interface/inspector_reporter.rb +1 -1
  85. data/lib/cocoapods/validator.rb +74 -39
  86. data/lib/cocoapods/version_metadata.rb +7 -0
  87. metadata +30 -6
@@ -20,9 +20,11 @@ module Pod
20
20
  GCC_PREPROCESSOR_DEFINITIONS
21
21
  GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS
22
22
  HEADER_SEARCH_PATHS
23
+ INCLUDED_SOURCE_FILE_NAMES
23
24
  INFOPLIST_PREPROCESSOR_DEFINITIONS
24
25
  LD_RUNPATH_SEARCH_PATHS
25
26
  LIBRARY_SEARCH_PATHS
27
+ LOCALIZED_STRING_MACRO_NAMES
26
28
  OTHER_CFLAGS
27
29
  OTHER_CPLUSPLUSFLAGS
28
30
  OTHER_LDFLAGS
@@ -31,6 +33,9 @@ module Pod
31
33
  SECTORDER_FLAGS
32
34
  SWIFT_ACTIVE_COMPILATION_CONDITIONS
33
35
  SWIFT_INCLUDE_PATHS
36
+ SYSTEM_FRAMEWORK_SEARCH_PATHS
37
+ SYSTEM_HEADER_SEARCH_PATHS
38
+ USER_HEADER_SEARCH_PATHS
34
39
  WARNING_CFLAGS
35
40
  WARNING_LDFLAGS
36
41
  ).to_set.freeze
@@ -205,7 +210,7 @@ module Pod
205
210
 
206
211
  # @return [String]
207
212
  define_build_settings_method :code_sign_identity, :build_setting => true do
208
- return unless target.requires_frameworks?
213
+ return unless target.build_as_dynamic?
209
214
  return unless target.platform.to_sym == :osx
210
215
  ''
211
216
  end
@@ -226,7 +231,7 @@ module Pod
226
231
 
227
232
  # @return [Array<String>]
228
233
  define_build_settings_method :framework_search_paths, :build_setting => true, :memoized => true do
229
- framework_search_paths_to_import_developer_frameworks(frameworks)
234
+ framework_search_paths_to_import_developer_frameworks(frameworks + weak_frameworks)
230
235
  end
231
236
 
232
237
  # @param [Array<String>] frameworks
@@ -424,6 +429,22 @@ module Pod
424
429
  end
425
430
  end
426
431
 
432
+ # Merges the spec-defined xcconfig into the derived xcconfig,
433
+ # overriding any singular settings and merging plural settings.
434
+ #
435
+ # @param [Hash<String,String>] spec_xcconfig_hash the merged xcconfig defined in the spec.
436
+ #
437
+ # @param [Xcodeproj::Config] xcconfig the config to merge into.
438
+ #
439
+ # @return [Xcodeproj::Config] the merged config.
440
+ #
441
+ def merge_spec_xcconfig_into_xcconfig(spec_xcconfig_hash, xcconfig)
442
+ plural_configs, singlular_configs = spec_xcconfig_hash.partition { |k, _v| PLURAL_SETTINGS.include?(k) }.map { |a| Hash[a] }
443
+ xcconfig.attributes.merge!(singlular_configs)
444
+ xcconfig.merge!(plural_configs)
445
+ xcconfig
446
+ end
447
+
427
448
  # Filters out pod targets whose `specs` are a subset of
428
449
  # another target's.
429
450
  #
@@ -433,11 +454,13 @@ module Pod
433
454
  #
434
455
  def select_maximal_pod_targets(pod_targets)
435
456
  subset_targets = []
436
- pod_targets.uniq.combination(2) do |a, b|
437
- if (a.specs - b.specs).empty?
438
- subset_targets << a
439
- elsif (b.specs - a.specs).empty?
440
- subset_targets << b
457
+ pod_targets.uniq.group_by(&:pod_name).each do |_pod_name, targets|
458
+ targets.combination(2) do |a, b|
459
+ if (a.specs - b.specs).empty?
460
+ subset_targets << a
461
+ elsif (b.specs - a.specs).empty?
462
+ subset_targets << b
463
+ end
441
464
  end
442
465
  end
443
466
  pod_targets - subset_targets
@@ -460,29 +483,47 @@ module Pod
460
483
  attr_reader :test_xcconfig
461
484
  alias test_xcconfig? test_xcconfig
462
485
 
486
+ attr_reader :app_xcconfig
487
+ alias app_xcconfig? app_xcconfig
488
+
489
+ attr_reader :library_xcconfig
490
+ alias library_xcconfig? library_xcconfig
491
+
492
+ def non_library_xcconfig?
493
+ !library_xcconfig?
494
+ end
495
+
463
496
  # @return [Specification]
464
- # The test specification these build settings are for or `nil`.
497
+ # The non-library specification these build settings are for or `nil`.
465
498
  #
466
- attr_reader :test_spec
499
+ attr_reader :non_library_spec
467
500
 
468
501
  # Initializes a new instance
469
502
  #
470
503
  # @param [PodTarget] target
471
504
  # see {#target}
472
505
  #
473
- # @param [Specification] test_spec
474
- # see {#test_spec}
506
+ # @param [Specification] non_library_spec
507
+ # see {#non_library_spec}
475
508
  #
476
- def initialize(target, test_spec = nil)
509
+ def initialize(target, non_library_spec = nil)
477
510
  super(target)
478
- @test_spec = test_spec
479
- @test_xcconfig = !test_spec.nil?
511
+ if @non_library_spec = non_library_spec
512
+ @test_xcconfig = non_library_spec.test_specification?
513
+ @app_xcconfig = non_library_spec.app_specification?
514
+ @xcconfig_spec_type = non_library_spec.spec_type
515
+ @library_xcconfig = false
516
+ else
517
+ @test_xcconfig = @app_xcconfig = false
518
+ @xcconfig_spec_type = :library
519
+ @library_xcconfig = true
520
+ end
480
521
  end
481
522
 
482
523
  # @return [Xcodeproj::Xconfig]
483
524
  define_build_settings_method :xcconfig, :memoized => true do
484
525
  xcconfig = super()
485
- xcconfig.merge(merged_pod_target_xcconfigs)
526
+ merge_spec_xcconfig_into_xcconfig(merged_pod_target_xcconfigs, xcconfig)
486
527
  end
487
528
 
488
529
  #-------------------------------------------------------------------------#
@@ -510,14 +551,14 @@ module Pod
510
551
 
511
552
  # @return [Array<String>]
512
553
  define_build_settings_method :frameworks, :memoized => true, :sorted => true, :uniqued => true do
513
- return [] if (!target.requires_frameworks? || target.static_framework?) && !test_xcconfig?
554
+ return [] if target.build_as_static? && library_xcconfig?
514
555
 
515
556
  frameworks = []
516
557
  frameworks.concat consumer_frameworks
517
- if test_xcconfig? || (target.should_build? && target.requires_frameworks? && !target.static_framework?)
558
+ if non_library_xcconfig? || (target.should_build? && target.build_as_dynamic?)
518
559
  frameworks.concat vendored_static_frameworks.map { |l| File.basename(l, '.framework') }
519
560
  end
520
- if test_xcconfig?
561
+ if non_library_xcconfig?
521
562
  frameworks.concat vendored_dynamic_frameworks.map { |l| File.basename(l, '.framework') }
522
563
  frameworks.concat dependent_targets.flat_map { |pt| pt.build_settings.frameworks_to_import }
523
564
  end
@@ -527,22 +568,22 @@ module Pod
527
568
  # @return [Array<String>]
528
569
  define_build_settings_method :static_frameworks_to_import, :memoized => true do
529
570
  static_frameworks_to_import = []
530
- static_frameworks_to_import.concat vendored_static_frameworks.map { |f| File.basename(f, '.framework') } unless target.should_build? && target.requires_frameworks? && !target.static_framework?
531
- static_frameworks_to_import << target.product_basename if target.should_build? && target.requires_frameworks? && target.static_framework?
571
+ static_frameworks_to_import.concat vendored_static_frameworks.map { |f| File.basename(f, '.framework') } unless target.should_build? && target.build_as_dynamic?
572
+ static_frameworks_to_import << target.product_basename if target.should_build? && target.build_as_static_framework?
532
573
  static_frameworks_to_import
533
574
  end
534
575
 
535
576
  # @return [Array<String>]
536
577
  define_build_settings_method :dynamic_frameworks_to_import, :memoized => true do
537
578
  dynamic_frameworks_to_import = vendored_dynamic_frameworks.map { |f| File.basename(f, '.framework') }
538
- dynamic_frameworks_to_import << target.product_basename if target.should_build? && target.requires_frameworks? && !target.static_framework?
579
+ dynamic_frameworks_to_import << target.product_basename if target.should_build? && target.build_as_dynamic_framework?
539
580
  dynamic_frameworks_to_import.concat consumer_frameworks
540
581
  dynamic_frameworks_to_import
541
582
  end
542
583
 
543
584
  # @return [Array<String>]
544
- define_build_settings_method :weak_frameworks, :memoized => true, :sorted => true, :uniqued => true do
545
- return [] if (!target.requires_frameworks? || target.static_framework?) && !test_xcconfig?
585
+ define_build_settings_method :weak_frameworks, :memoized => true do
586
+ return [] if target.build_as_static? && library_xcconfig?
546
587
 
547
588
  weak_frameworks = spec_consumers.flat_map(&:weak_frameworks)
548
589
  weak_frameworks.concat dependent_targets.flat_map { |pt| pt.build_settings.weak_frameworks_to_import }
@@ -564,13 +605,13 @@ module Pod
564
605
  paths = super().dup
565
606
  paths.concat dependent_targets.flat_map { |t| t.build_settings.framework_search_paths_to_import }
566
607
  paths.concat framework_search_paths_to_import
567
- paths.delete(target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)) unless test_xcconfig?
608
+ paths.delete(target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)) if library_xcconfig?
568
609
  paths
569
610
  end
570
611
 
571
612
  # @return [String]
572
613
  define_build_settings_method :framework_header_search_path, :memoized => true do
573
- return unless target.requires_frameworks?
614
+ return unless target.build_as_framework?
574
615
  "#{target.build_product_path}/Headers"
575
616
  end
576
617
 
@@ -583,7 +624,7 @@ module Pod
583
624
  define_build_settings_method :framework_search_paths_to_import, :memoized => true do
584
625
  paths = framework_search_paths_to_import_developer_frameworks(consumer_frameworks)
585
626
  paths.concat vendored_framework_search_paths
586
- return paths unless target.requires_frameworks? && target.should_build?
627
+ return paths unless target.build_as_framework? && target.should_build?
587
628
 
588
629
  paths + [target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)]
589
630
  end
@@ -615,14 +656,14 @@ module Pod
615
656
 
616
657
  # @return [Array<String>]
617
658
  define_build_settings_method :libraries, :memoized => true, :sorted => true, :uniqued => true do
618
- return [] if (!target.requires_frameworks? || target.static_framework?) && !test_xcconfig?
659
+ return [] if library_xcconfig? && target.build_as_static?
619
660
 
620
661
  libraries = []
621
- if test_xcconfig? || target.requires_frameworks? && !target.static_framework?
662
+ if non_library_xcconfig? || target.build_as_dynamic?
622
663
  libraries.concat linker_names_from_libraries(vendored_static_libraries)
623
664
  libraries.concat libraries_to_import
624
665
  end
625
- if test_xcconfig?
666
+ if non_library_xcconfig?
626
667
  libraries.concat dependent_targets.flat_map { |pt| pt.build_settings.dynamic_libraries_to_import }
627
668
  libraries.concat dependent_targets.flat_map { |pt| pt.build_settings.static_libraries_to_import }
628
669
  end
@@ -632,17 +673,17 @@ module Pod
632
673
  # @return [Array<String>]
633
674
  define_build_settings_method :static_libraries_to_import, :memoized => true do
634
675
  static_libraries_to_import = []
635
- unless target.should_build? && target.requires_frameworks? && !target.static_framework?
636
- static_libraries_to_import.concat linker_names_from_libraries(vendored_static_libraries)
637
- end
638
- static_libraries_to_import << target.product_basename if target.should_build? && !target.requires_frameworks?
676
+ static_libraries_to_import.concat linker_names_from_libraries(vendored_static_libraries) unless target.should_build? && target.build_as_dynamic?
677
+ static_libraries_to_import << target.product_basename if target.should_build? && target.build_as_static_library?
639
678
  static_libraries_to_import
640
679
  end
641
680
 
642
681
  # @return [Array<String>]
643
682
  define_build_settings_method :dynamic_libraries_to_import, :memoized => true do
644
- linker_names_from_libraries(vendored_dynamic_libraries) +
645
- spec_consumers.flat_map(&:libraries)
683
+ dynamic_libraries_to_import = linker_names_from_libraries(vendored_dynamic_libraries)
684
+ dynamic_libraries_to_import.concat spec_consumers.flat_map(&:libraries)
685
+ dynamic_libraries_to_import << target.product_basename if target.should_build? && target.build_as_dynamic_library?
686
+ dynamic_libraries_to_import
646
687
  end
647
688
 
648
689
  # @return [Array<String>]
@@ -652,14 +693,14 @@ module Pod
652
693
 
653
694
  # @return [Array<String>]
654
695
  define_build_settings_method :library_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do
655
- return [] if (!target.requires_frameworks? || target.static_framework?) && !test_xcconfig?
696
+ return [] if library_xcconfig? && target.build_as_static?
656
697
 
657
698
  vendored = library_search_paths_to_import.dup
658
699
  vendored.concat dependent_targets.flat_map { |t| t.build_settings.vendored_dynamic_library_search_paths }
659
- if test_xcconfig?
660
- vendored.concat dependent_targets.flat_map { |t| t.build_settings.library_search_paths_to_import }
661
- else
700
+ if library_xcconfig?
662
701
  vendored.delete(target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE))
702
+ else
703
+ vendored.concat(dependent_targets.flat_map { |t| t.build_settings.library_search_paths_to_import })
663
704
  end
664
705
  vendored
665
706
  end
@@ -687,7 +728,7 @@ module Pod
687
728
  # @return [Array<String>]
688
729
  define_build_settings_method :library_search_paths_to_import, :memoized => true do
689
730
  vendored_library_search_paths = vendored_static_library_search_paths + vendored_dynamic_library_search_paths
690
- return vendored_library_search_paths if target.requires_frameworks? || !target.should_build?
731
+ return vendored_library_search_paths if target.build_as_framework? || !target.should_build?
691
732
 
692
733
  vendored_library_search_paths << target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)
693
734
  end
@@ -704,7 +745,7 @@ module Pod
704
745
  # @return [Array<String>]
705
746
  define_build_settings_method :module_map_file_to_import, :memoized => true do
706
747
  return unless target.should_build?
707
- return if target.requires_frameworks?
748
+ return if target.build_as_framework? # framework module maps are automatically discovered
708
749
  return unless target.defines_module?
709
750
 
710
751
  if target.uses_swift?
@@ -717,24 +758,32 @@ module Pod
717
758
 
718
759
  # @return [Array<String>]
719
760
  define_build_settings_method :header_search_paths, :build_setting => true, :memoized => true, :sorted => true do
720
- target.header_search_paths(:include_dependent_targets_for_test_spec => test_spec)
761
+ target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec)
721
762
  end
722
763
 
723
764
  # @return [Array<String>]
724
765
  define_build_settings_method :public_header_search_paths, :memoized => true, :sorted => true do
725
- target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig?, :include_private_headers => false)
766
+ target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec, :include_private_headers => false)
726
767
  end
727
768
 
728
769
  #-------------------------------------------------------------------------#
729
770
 
730
771
  # @!group Swift
731
772
 
773
+ # @see BuildSettings#other_swift_flags_without_swift?
774
+ def other_swift_flags_without_swift?
775
+ return false if library_xcconfig?
776
+
777
+ target.uses_swift_for_spec?(non_library_spec)
778
+ end
779
+
732
780
  # @return [Array<String>]
733
781
  define_build_settings_method :other_swift_flags, :build_setting => true, :memoized => true do
734
- return unless target.uses_swift?
782
+ return unless target.uses_swift? || other_swift_flags_without_swift?
783
+
735
784
  flags = super()
736
- flags << '-suppress-warnings' if target.inhibit_warnings?
737
- if !target.requires_frameworks? && target.defines_module? && !test_xcconfig?
785
+ flags << '-suppress-warnings' if target.inhibit_warnings? && library_xcconfig?
786
+ if !target.build_as_framework? && target.defines_module? && library_xcconfig?
738
787
  flags.concat %w( -import-underlying-module -Xcc -fmodule-map-file=${SRCROOT}/${MODULEMAP_FILE} )
739
788
  end
740
789
  flags
@@ -743,13 +792,13 @@ module Pod
743
792
  # @return [Array<String>]
744
793
  define_build_settings_method :swift_include_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do
745
794
  paths = dependent_targets.flat_map { |t| t.build_settings.swift_include_paths_to_import }
746
- paths.concat swift_include_paths_to_import if test_xcconfig?
795
+ paths.concat swift_include_paths_to_import if non_library_xcconfig?
747
796
  paths
748
797
  end
749
798
 
750
799
  # @return [Array<String>]
751
800
  define_build_settings_method :swift_include_paths_to_import, :memoized => true do
752
- return [] unless target.uses_swift? && !target.requires_frameworks?
801
+ return [] unless target.uses_swift? && !target.build_as_framework?
753
802
 
754
803
  [target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)]
755
804
  end
@@ -763,20 +812,20 @@ module Pod
763
812
  # @note this is only true when generating build settings for a test bundle
764
813
  #
765
814
  def requires_objc_linker_flag?
766
- test_xcconfig?
815
+ test_xcconfig? || app_xcconfig?
767
816
  end
768
817
 
769
818
  # @return [Boolean] whether the `-fobjc-arc` linker flag is required.
770
819
  #
771
820
  define_build_settings_method :requires_fobjc_arc?, :memoized => true do
772
821
  target.podfile.set_arc_compatibility_flag? &&
773
- file_accessors.any? { |fa| fa.spec_consumer.requires_arc? }
822
+ file_accessors.any? { |fa| fa.spec_consumer.requires_arc? }
774
823
  end
775
824
 
776
825
  # @return [Array<String>]
777
826
  define_build_settings_method :ld_runpath_search_paths, :build_setting => true, :memoized => true do
778
- return unless test_xcconfig?
779
- _ld_runpath_search_paths(:test_bundle => true)
827
+ return if library_xcconfig?
828
+ _ld_runpath_search_paths(:test_bundle => test_xcconfig?)
780
829
  end
781
830
 
782
831
  #-------------------------------------------------------------------------#
@@ -795,7 +844,7 @@ module Pod
795
844
 
796
845
  # @return [String]
797
846
  define_build_settings_method :configuration_build_dir, :build_setting => true, :memoized => true do
798
- return if test_xcconfig?
847
+ return if non_library_xcconfig?
799
848
  target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)
800
849
  end
801
850
 
@@ -807,7 +856,9 @@ module Pod
807
856
  define_build_settings_method :dependent_targets, :memoized => true do
808
857
  select_maximal_pod_targets(
809
858
  if test_xcconfig?
810
- target.dependent_targets_for_test_spec(test_spec)
859
+ target.dependent_targets_for_test_spec(non_library_spec)
860
+ elsif app_xcconfig?
861
+ target.dependent_targets_for_app_spec(non_library_spec)
811
862
  else
812
863
  target.recursive_dependent_targets
813
864
  end,
@@ -838,12 +889,12 @@ module Pod
838
889
 
839
890
  # @return [Array<Sandbox::FileAccessor>]
840
891
  define_build_settings_method :file_accessors, :memoized => true do
841
- target.file_accessors.select { |fa| fa.spec.test_specification? == test_xcconfig? }
892
+ target.file_accessors.select { |fa| fa.spec.spec_type == @xcconfig_spec_type }
842
893
  end
843
894
 
844
895
  # @return [Array<Specification::Consumer>]
845
896
  define_build_settings_method :spec_consumers, :memoized => true do
846
- target.spec_consumers.select { |c| c.spec.test_specification? == test_xcconfig? }
897
+ target.spec_consumers.select { |fa| fa.spec.spec_type == @xcconfig_spec_type }
847
898
  end
848
899
 
849
900
  #-------------------------------------------------------------------------#
@@ -880,7 +931,7 @@ module Pod
880
931
  # @return [Xcodeproj::Config] xcconfig
881
932
  define_build_settings_method :xcconfig, :memoized => true do
882
933
  xcconfig = super()
883
- xcconfig.merge(merged_user_target_xcconfigs)
934
+ merge_spec_xcconfig_into_xcconfig(merged_user_target_xcconfigs, xcconfig)
884
935
  end
885
936
 
886
937
  #-------------------------------------------------------------------------#
@@ -938,14 +989,14 @@ module Pod
938
989
  define_build_settings_method :header_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do
939
990
  paths = []
940
991
 
941
- if !target.requires_frameworks? || !pod_targets.all?(&:should_build?)
992
+ if !target.build_as_framework? || !pod_targets.all?(&:should_build?)
942
993
  paths.concat target.sandbox.public_headers.search_paths(target.platform)
943
994
  end
944
995
 
945
996
  # Make frameworks headers discoverable with any syntax (quotes,
946
997
  # brackets, @import, etc.)
947
998
  paths.concat pod_targets.
948
- select { |pt| pt.requires_frameworks? && pt.should_build? }.
999
+ select { |pt| pt.build_as_framework? && pt.should_build? }.
949
1000
  map { |pt| pt.build_settings.framework_header_search_path }
950
1001
 
951
1002
  paths.concat target.search_paths_aggregate_targets.flat_map { |at| at.build_settings(configuration_name).header_search_paths }
@@ -962,7 +1013,7 @@ module Pod
962
1013
  silenced_headers = []
963
1014
  silenced_frameworks = []
964
1015
  pod_targets_inhibiting_warnings.each do |pt|
965
- if pt.requires_frameworks? && pt.should_build?
1016
+ if pt.build_as_framework? && pt.should_build?
966
1017
  silenced_headers.append pt.build_settings.framework_header_search_path
967
1018
  else
968
1019
  silenced_headers.concat pt.build_settings.public_header_search_paths
@@ -1022,7 +1073,7 @@ module Pod
1022
1073
 
1023
1074
  # @return [Array<String>]
1024
1075
  define_build_settings_method :ld_runpath_search_paths, :build_setting => true, :memoized => true, :uniqued => true do
1025
- return unless target.requires_frameworks? || any_vendored_dynamic_artifacts?
1076
+ return unless pod_targets.any?(&:build_as_dynamic?) || any_vendored_dynamic_artifacts?
1026
1077
  symbol_type = target.user_targets.map(&:symbol_type).uniq.first
1027
1078
  test_bundle = symbol_type == :octest_bundle || symbol_type == :unit_test_bundle || symbol_type == :ui_test_bundle
1028
1079
  _ld_runpath_search_paths(:requires_host_target => target.requires_host_target?, :test_bundle => test_bundle)
@@ -1032,16 +1083,24 @@ module Pod
1032
1083
  define_build_settings_method :any_vendored_dynamic_artifacts?, :memoized => true do
1033
1084
  pod_targets.any? do |pt|
1034
1085
  pt.file_accessors.any? do |fa|
1035
- fa.vendored_dynamic_artifacts.any?
1086
+ !fa.vendored_dynamic_artifacts.empty?
1087
+ end
1088
+ end
1089
+ end
1090
+
1091
+ # @return [Boolean]
1092
+ define_build_settings_method :any_vendored_static_artifacts?, :memoized => true do
1093
+ pod_targets.any? do |pt|
1094
+ pt.file_accessors.any? do |fa|
1095
+ !fa.vendored_static_artifacts.empty?
1036
1096
  end
1037
1097
  end
1038
1098
  end
1039
1099
 
1040
1100
  # @return [Boolean]
1041
1101
  define_build_settings_method :requires_objc_linker_flag?, :memoized => true do
1042
- !target.requires_frameworks? ||
1043
- pod_targets.any?(&:static_framework?) ||
1044
- pod_targets.flat_map(&:file_accessors).any? { |fa| !fa.vendored_static_artifacts.empty? }
1102
+ pod_targets.any?(&:build_as_static?) ||
1103
+ any_vendored_static_artifacts?
1045
1104
  end
1046
1105
 
1047
1106
  # @return [Boolean]