gruntjs/grunt — pull request #851 by tschaub (2013-07-25 04:17:04+00:00)
Title: Add support for "newer" property on file mappings

The `newer` property limits `src` files to those that have been modified since the last time a multi-task was run. Values of `true`, `false` (the default), and `'any'` are supported. If `'any'`, then all `src` files will be made available to the task if any one of them has been modified since the last run.

Example with `grunt-contrib-jshint`:

```js
// configure jshint to only lint lib files that have been modified
jshint: {
lib: {
src: 'lib/**/*.js',
newer: true
}
}
```

Example with `grunt-contrib-uglify`:

```js
// configure uglify to rebuild all if any files have been modified
uglify: {
lib: {
src: ['lib/one.js', 'lib/two.js'],
dest: 'dist/lib.min.js',
newer: 'any'
}
}
```

Being able to specify `newer: true` is particularly useful when linting a large library with a watch task, for example. To compare file modification times to previous run times, `timestamp` files are created in `.grunt//` directories.

I'll add more tests if others agree with the direction this is going. I'm also happy to change the implementation if anybody has any suggestions.