summaryrefslogtreecommitdiff
path: root/gen
diff options
context:
space:
mode:
authorAntonio Terceiro <terceiro@softwarelivre.org>2011-10-02 08:35:05 -0300
committerAntonio Terceiro <terceiro@softwarelivre.org>2011-11-13 21:57:48 -0200
commitde1c7813f651d9e8f3c212618d622829d9a08a7a (patch)
tree99f1da04eb0d8dc8cc8b32e9819dcd01d77d1085 /gen
parenta96729a41561aa0fd15d212d44af57550889c354 (diff)
downloadffi-de1c7813f651d9e8f3c212618d622829d9a08a7a.tar.gz
Keep a log of generated types.conf files
And allow to clean them up!
Diffstat (limited to 'gen')
-rw-r--r--gen/Rakefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/gen/Rakefile b/gen/Rakefile
index 12261a5..f71a1da 100644
--- a/gen/Rakefile
+++ b/gen/Rakefile
@@ -3,7 +3,9 @@ require 'fileutils'
require 'ffi'
require 'ffi/platform'
require 'ffi/tools/types_generator'
-types_conf = File.join(FFI::Platform::CONF_DIR, 'types.conf')
+types_conf = File.expand_path(File.join(FFI::Platform::CONF_DIR, 'types.conf'))
+
+logfile = File.join(File.dirname(__FILE__), 'log')
file types_conf do |task|
options = {}
@@ -11,7 +13,18 @@ file types_conf do |task|
File.open(task.name, File::CREAT|File::TRUNC|File::RDWR, 0644) do |f|
f.puts FFI::TypesGenerator.generate(options)
end
+ File.open(logfile, 'w') do |log|
+ log.puts(types_conf)
+ end
end
task :default => types_conf do
end
+
+task :clean do
+ File.readlines(logfile).each do |file|
+ file.strip!
+ rm_f file
+ end
+ rm_f logfile
+end