Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
fix generate_command rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
marcisme committed Feb 5, 2012
1 parent bea4cbe commit 6806dd6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Rakefile
Expand Up @@ -49,12 +49,17 @@ task :generate_command do


Dir.glob("src/*.pro").each do |project_file_name| Dir.glob("src/*.pro").each do |project_file_name|
project = IO.read(project_file_name) project = IO.read(project_file_name)
project.gsub!(/^(HEADERS = .*)/, "\\1 #{name}.h") project.gsub!(/^(HEADERS = .*)/, "\\1\n #{name}.h \\")
project.gsub!(/^(SOURCES = .*)/, "\\1 #{name}.cpp") project.gsub!(/^(SOURCES = .*)/, "\\1\n #{name}.cpp \\")
File.open(project_file_name, "w") { |file| file.write(project) } File.open(project_file_name, "w") { |file| file.write(project) }
end end


File.open("src/find_command.h", "a") do |file| File.open("src/find_command.h", "a") do |file|
file.write("CHECK_COMMAND(#{name})") file.write("CHECK_COMMAND(#{name})\n")
end end

command_factory_file_name = "src/CommandFactory.cpp"
command_factory = IO.read(command_factory_file_name)
command_factory.sub!(/^$/, "#include \"#{name}.h\"\n")
File.open(command_factory_file_name, "w") { |file| file.write(command_factory) }
end end

0 comments on commit 6806dd6

Please sign in to comment.