class SC::Buildfile::BuildTask
Just like a normal task, but will not run if the destination path already exists and it is newer than the source.
Public Instance Methods
needed?()
click to toggle source
# File lib/sproutcore/buildfile/build_task.rb, line 16 def needed? return true if DST_PATH.nil? || SRC_PATHS.nil? # just try to build... return true if !File.exist?(DST_PATH) ret = false dst_mtime = File.mtime(DST_PATH) SRC_PATHS.each do |path| next if path.nil? # skip incase of bad src paths... timestamp = File.exist?(path) ? File.mtime(path) : EARLY ret = ret || (dst_mtime < timestamp) break if ret end return ret end