I have some post build event to minify my css and javascript using ajaxmin
if $(ConfigurationName) == Debug $(ProjectDir)..\Tools\ajaxmin.exe -xml $(ProjectDir)Scripts\Combine.xml -js -clobber
if $(ConfigurationName) == Debug $(ProjectDir)..\Tools\ajaxmin.exe
This increased my build time from about 7 or 8 seconds to about 12 – 15, (building the project during development those seconds add up you know. I’ve gone to a lot of effort to reduce build time for this app. )
I’d like to run this task only if the files in the combine.xml have changed.
My initial thought is to set up a file watch windows service to write changes to a txt file,
Then check the text file on the post build command,
But I don’t know how to do this last bit.
Is there a way to check a value in a Text file using post build events ?
You could use a PowerShell script as postbuild event, and check the files modification dates, e.g.
Then you regenerate the file only if the
LastWriteTimeof the partial files is greater than theLastWriteTimeof the combined file.I don’t know if you can do that with a regular post-build script.