Skip to content

Instantly share code, notes, and snippets.

@llatzhar
Created December 8, 2008 00:24
Show Gist options
  • Save llatzhar/33287 to your computer and use it in GitHub Desktop.
Save llatzhar/33287 to your computer and use it in GitHub Desktop.
rakefile for delphi
require 'rake/clean'
def win_sh(cmd)
`#{cmd}`.each do |l|
/\((\d*)\)/ =~ l.gsub!('
','')
if $& == nil
puts l
else
puts "#{$`}:#{$1}:#{$'}"
end
end
end
compiler = "dcc32 -Q -W -H "
imports = []
imports << "c:\\program files\\borland\\delphi7\\imports"
imports << "d:\\genki\\GisClient\\Lib"
dpr = "HogeHoge.dpr"
exe = "HogeHoge.exe"
task :default => exe
CLEAN.include("**/*.dcu", exe)
task exe => [dpr] do |t|
units = ""
imports.each do |u|
units += " \"-U#{u}\" "
end
win_sh "#{compiler} #{units} #{dpr}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment