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