Commit a86e24cb authored by Samuel Giddins's avatar Samuel Giddins Committed by GitHub

Merge pull request #5844 from dnkoutso/fix/5291

Wrap generated import headers using __OBJC__ for C only pods
parents d0f874bc ccfa78f2
...@@ -87,6 +87,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -87,6 +87,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Wrap generated import headers with __OBJC__ to fix C only pods.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#5291](https://github.com/CocoaPods/CocoaPods/issues/5291)
* Prevent crash when generating acknowledgements when license type is not specified. * Prevent crash when generating acknowledgements when license type is not specified.
[Marcelo Fabri](https://github.com/marcelofabri) [Marcelo Fabri](https://github.com/marcelofabri)
[#5826](https://github.com/CocoaPods/CocoaPods/issues/5826) [#5826](https://github.com/CocoaPods/CocoaPods/issues/5826)
......
...@@ -40,8 +40,9 @@ module Pod ...@@ -40,8 +40,9 @@ module Pod
# #
def generate def generate
result = '' result = ''
result << "#ifdef __OBJC__\n"
result << generate_platform_import_header result << generate_platform_import_header
result << "#endif\n"
result << "\n" result << "\n"
imports.each do |import| imports.each do |import|
......
...@@ -55,18 +55,6 @@ module Pod ...@@ -55,18 +55,6 @@ module Pod
result result
end end
protected
# Generates the contents of the header according to the platform.
#
# @return [String]
#
def generate_platform_import_header
result = "#ifdef __OBJC__\n"
result << super
result << "#endif\n"
end
end end
end end
end end
Subproject commit c58c9df1fed4f993062a58eb22a5bf567720c2bb Subproject commit 3ccf80e8c7adc855611e2f98fc60a190abf6531b
...@@ -9,7 +9,9 @@ module Pod ...@@ -9,7 +9,9 @@ module Pod
it 'includes the imports' do it 'includes the imports' do
@gen.imports << 'header.h' @gen.imports << 'header.h'
@gen.generate.should == <<-EOS.strip_heredoc @gen.generate.should == <<-EOS.strip_heredoc
#ifdef __OBJC__
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#endif
#import "header.h" #import "header.h"
EOS EOS
...@@ -18,7 +20,9 @@ module Pod ...@@ -18,7 +20,9 @@ module Pod
it 'includes the module imports' do it 'includes the module imports' do
@gen.module_imports << 'Module' @gen.module_imports << 'Module'
@gen.generate.should == <<-EOS.strip_heredoc @gen.generate.should == <<-EOS.strip_heredoc
#ifdef __OBJC__
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#endif
@import Module @import Module
...@@ -49,7 +53,9 @@ module Pod ...@@ -49,7 +53,9 @@ module Pod
path = temporary_directory + 'Test.h' path = temporary_directory + 'Test.h'
@gen.save_as(path) @gen.save_as(path)
path.read.should == <<-EOS.strip_heredoc path.read.should == <<-EOS.strip_heredoc
#ifdef __OBJC__
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#endif
EOS EOS
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment