Commit bfe37a1d authored by Fabio Pelosin's avatar Fabio Pelosin

[Command::Init] Add dependencies of the normal targets inside the target block

This patch also improves indentation.

/c @ianyh
parent dd8a958f
......@@ -55,9 +55,6 @@ module Pod
# Uncomment this line to define a global platform for your project
# platform :ios, "6.0"
PLATFORM
if config.default_podfile_path.exist?
open(config.default_podfile_path, 'r') { |f| podfile << f.read }
end
for target in project.targets
podfile << target_module(target)
end
......@@ -70,15 +67,23 @@ module Pod
# @return [String] the text for the target module
#
def target_module(target)
target_module = <<-TARGET.strip_heredoc
target_module = "\ntarget \"#{target.name}\" do\n"
if target.name =~ /tests?/i
target_module << template_contents(config.default_test_podfile_path)
else
target_module << template_contents(config.default_podfile_path)
end
target_module << "\nend\n"
end
target "#{target.name}" do
TARGET
if config.default_test_podfile_path.exist? and target.name =~ /tests?/i
open(config.default_test_podfile_path, 'r') { |f| target_module << f.read }
def template_contents(path)
if path.exist?
path.read.chomp.lines.map{ |line| " #{line}" }.join("\n")
else
String.new
end
target_module << "\nend"
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