Skip to content
Browse files

Force a rebuild if jake.yml or Jakefile has been modified since the l…

…ast build.
  • Loading branch information...
1 parent dd3c119 commit bdb5edccf7c3dd94b5628a36f8dfda78451e8758 @jcoglan committed Apr 7, 2012
Showing with 9 additions and 3 deletions.
  1. +6 −2 lib/jake/build.rb
  2. +3 −1 lib/jake/buildable.rb
View
8 lib/jake/build.rb
@@ -8,7 +8,7 @@ class Build
DEFAULT_LAYOUT = 'together'
include Enumerable
- attr_reader :helper
+ attr_reader :config_files, :helper
# Builds are initialized using a directory in which to run the build, and an
# options hash. Options are passed through to helper methods in the +options+
@@ -21,10 +21,14 @@ def initialize(dir, options = {})
path = Jake.path(dir, CONFIG_FILE)
yaml = File.read(path)
+ @config_files = [path]
@config = Jake.symbolize_hash( YAML.load(Jake.erb(yaml).result(@helper.scope)) )
helpers = Jake.path(dir, HELPER_FILE)
- load helpers if File.file?(helpers)
+ if File.file?(helpers)
+ load helpers
+ @config_files << helpers
+ end
@builds = @config[:builds] || {:src => false, :min => @config[:packer]}
View
4 lib/jake/buildable.rb
@@ -49,7 +49,9 @@ def build_needed?(name)
path = build_path(name)
return true unless File.file?(path)
build_time = File.mtime(path)
- files.any? { |path| File.mtime(path) > build_time }
+
+ input_files = files + @build.config_files
+ input_files.any? { |path| File.mtime(path) > build_time }
end
# Returns the header string being used for this package.

0 comments on commit bdb5edc

Please sign in to comment.
Something went wrong with that request. Please try again.