Class: SC::Buildfile::BuildTask
- Defined in:
- lib/sproutcore/buildfile/build_task.rb
Overview
Just like a normal task, but will not run if the destination path already exists and it is newer than the source.
Constant Summary
Constants inherited from Task
Instance Attribute Summary
Attributes inherited from Task
#actions, #application, #comment, #execute_count, #full_comment, #invoke_count, #prerequisites, #scope, #sources, #task_options
Instance Method Summary collapse
Methods inherited from Task
#add_description, #add_options, #arg_description, #arg_names, #clear, #clear_actions, #clear_prerequisites, #dup, #enhance, #execute, #initialize, #inspect, #investigation, #invoke, #invoke_prerequisites, #name, #name_with_args, scope_name, #set_arg_names, #source, #timestamp, #to_s
Methods included from Cloneable
Constructor Details
This class inherits a constructor from SC::Buildfile::Task
Instance Method Details
#needed? ⇒ Boolean
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# 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... = File.exist?(path) ? File.mtime(path) : EARLY ret = ret || (dst_mtime < ) break if ret end return ret end |