jimweirich/rake — Issue #104: FileTask#timestamp should also include prereq timestamps
Author: zenspider
Created: 2012-01-17 22:56:43+00:00
State: open

Running this rakefile as-is:

``` ruby
# -*- ruby -*-

class Rake::FileTask
def timestamp
if File.exist?(name)
if ENV['ORIGINAL'] then
File.mtime(name.to_s)
else
[File.mtime(name.to_s), super].max
end
else
Rake::EARLY
end
end
end

rm_f %w[a.out f.c f.h]
sh "touch -t 200001010101 a.out f.c f.h"
sh "touch f.h"

file "a.out" => "f.c"

file "f.c" => "f.h"

task :clean do
rm_f %w[a.out f.c f.h]
end
```

outputs with the original:

```
% rake -t a.out ORIGINAL=1
rm -f a.out f.c f.h
touch -t 200001010101 a.out f.c f.h
touch f.h
** Invoke a.out (first_time, not_needed)
** Invoke f.c (first_time)
** Invoke f.h (first_time, not_needed)
** Execute f.c
```

vs my patched version:

```
% rake -t a.out
rm -f a.out f.c f.h
touch -t 200001010101 a.out f.c f.h
touch f.h
** Invoke a.out (first_time)
** Invoke f.c (first_time)
** Invoke f.h (first_time, not_needed)
** Execute f.c
** Execute a.out
```