MSBuild.NodeTools icon indicating copy to clipboard operation
MSBuild.NodeTools copied to clipboard

Enable "Incremental Builds"

Open carlin-q-scott opened this issue 10 years ago • 3 comments

Supposedly MSBuild can intelligently run build targets if they specify an "Inputs" and "Outputs" parameter. What it will try to do is compare timestamps of the input files to the output files and if the input files are newer it will run the target. See Incremental Builds for more details.

I tried implementing this in my own grunt and npm build targets but it wasn't working so I gave up but maybe someone else can figure it out.

carlin-q-scott avatar Jan 14 '16 20:01 carlin-q-scott

https://gist.github.com/carlin-q-scott/718361d78955f980205b

carlin-q-scott avatar Jan 14 '16 21:01 carlin-q-scott

Hi @carlin-q-scott, I have a workaround for your issue, you can use a gulp package called "gulp-newer", it will skip files in the gulp pipeline. For example:

gulp.task('bundle-vendor-js', ['restore-bower'], function() { return gulp.src(config.vendorJs) .pipe(newer(config.scriptOut + 'vendor.min.js')) .pipe(strip()) .pipe(concat('vendor.min.js')) .pipe(gulp.dest(config.scriptOut)); });

In this way, it checks the latest modified time of vendor.min.js, and compare to all files defined in config.vendorJs. If no newer files, it will skip.

Hope it helps.

jwu-au avatar Mar 11 '16 06:03 jwu-au

I'm not using gulp so I suspect that doesn't solve my problem. Meanwhile I figured out how to get MSBuild to recognize changes for npm.

carlin-q-scott avatar Mar 14 '16 23:03 carlin-q-scott