Commit 6b66e200 authored by Samuel Giddins's avatar Samuel Giddins

[ModuleMap] Only add the ‘framework’ prefix when building a framework

parent ceb00de0
......@@ -38,7 +38,7 @@ module Pod
#
def generate
<<-MODULE_MAP.strip_heredoc
framework module #{target.product_module_name} {
#{module_specificier_prefix}module #{target.product_module_name} {
umbrella header "#{target.umbrella_header_path.basename}"
export *
......@@ -46,6 +46,19 @@ module Pod
}
MODULE_MAP
end
private
# The prefix to `module` to prepend in the module map.
# Ensures that only framework targets have `framework` prepended.
#
def module_specificier_prefix
if target.requires_frameworks?
'framework '
else
''
end
end
end
end
end
......@@ -10,6 +10,7 @@ module Pod
it 'writes the module map to the disk' do
path = temporary_directory + 'BananaLib.modulemap'
@pod_target.stubs(:requires_frameworks?).returns(true)
@gen.save_as(path)
path.read.should == <<-EOS.strip_heredoc
framework module BananaLib {
......@@ -20,5 +21,19 @@ module Pod
}
EOS
end
it 'writes the module map to the disk for a library' do
path = temporary_directory + 'BananaLib.modulemap'
@pod_target.stubs(:requires_frameworks?).returns(false)
@gen.save_as(path)
path.read.should == <<-EOS.strip_heredoc
module BananaLib {
umbrella header "BananaLib-umbrella.h"
export *
module * { export * }
}
EOS
end
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