Commit 08bd4c95 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4620 from dnkoutso/master

Add @import UIKit; or @import Cocoa; for generated main.m
parents ae13ab00 4b8898ca
......@@ -421,7 +421,12 @@ module Pod
''
end
end
source_file.open('w') { |f| f << "@import Foundation;\n#{import_statement}int main() {}\n" }
source_file.open('w') do |f|
f << "@import Foundation;\n"
f << "@import UIKit;\n" if consumer.platform_name == :ios || consumer.platform_name == :tvos
f << "@import Cocoa;\n" if consumer.platform_name == :osx
f << "#{import_statement}int main() {}\n"
end
end
source_file
end
......
......@@ -524,6 +524,7 @@ module Pod
file.basename.to_s.should == 'main.m'
file.read.should == <<-OBJC.strip_heredoc
@import Foundation;
@import UIKit;
@import ModuleName;
int main() {}
OBJC
......@@ -547,6 +548,7 @@ module Pod
file.basename.to_s.should == 'main.m'
file.read.should == <<-OBJC.strip_heredoc
@import Foundation;
@import UIKit;
#import <ModuleName/ModuleName.h>
int main() {}
OBJC
......@@ -559,6 +561,7 @@ module Pod
file.basename.to_s.should == 'main.m'
file.read.should == <<-OBJC.strip_heredoc
@import Foundation;
@import UIKit;
int main() {}
OBJC
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