jimweirich/rake — Issue #82: Illogical behaviors with the "task" task
Author: zimbatm
Created: 2011-10-26 10:11:51+00:00
State: open

```
task :default => "file1"
file "file1" => "foo" do
puts "file1"
touch "file1"
end

task "foo" => "file2" do
puts "foo"
end

file "file2" do
puts "file2"
touch "file2"
end
```

On the second run, "foo" gets executed, but not "file1" ? I can't see why you would want to have a task execute only in the middle of a dependency tree.

If "foo" where to become a dependency of "file2" instead, the whole tree would get executed the whole time. Why ?

I propose to change the "Rake::Task#timestamp" method to:

```
def timestamp
return Time.now if needed?
prerequisite_tasks.collect { |pre| pre.timestamp }.max || Rake::EARLY
end
```

and introduce a new "alias" task type that has "#needed?" set to false for the cases where you don't want to always type long file dependencies.