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

Version Path
sproutit-sproutcore-1.0.0.20090407205609 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.0.20090408130025 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.0.20090416161445 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.0.20090720093355 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.0.20090720202429 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.0.20090721125122 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.126 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.20090721145236 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.20090721145251 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.20090721145280 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.20090721145281 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.20090721145282 lib/sproutcore/buildfile/build_task.rb
sproutit-sproutcore-1.0.203 lib/sproutcore/buildfile/build_task.rb