Sha256: 95e8922a6f8d4e6b22546826c5dcd83a8632afe13314219f536ec50a868a9a78
Contents?: true
Size: 1.04 KB
Versions: 13
Compression:
Stored size: 1.04 KB
Contents
# =========================================================================== # Project: Abbot - SproutCore Build Tools # Copyright: ©2009 Apple, Inc. # portions copyright @2006-2009 Sprout Systems, Inc. # and contributors # =========================================================================== require File.expand_path(File.join(File.dirname(__FILE__), 'task')) module SC # Just like a normal task, but will not run if the destination path already # exists and it is newer than the source. class Buildfile::BuildTask < ::SC::Buildfile::Task 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 end end
Version data entries
13 entries across 13 versions & 1 rubygems