I've created a custom build step in Visual Studio 2010 that produces multiple files by running a command-l开发者_开发技巧ine tool. The step creates these files as it should when invoking a build, but on a clean, it only cleans the first file I listed as an output of the step in the "Outputs" field of the custom build step. I've separated individual files with a semicolon and also tried the multi-line editor for the field and put each file on a separate line (VS inserts the semicolons when closing the multi-line editor). In any case, it doesn't seem to be the format of the field that's the issue - whatever file is first gets cleaned, the rest don't.
From reading the documentation, it seems that you should be able to have multiple files listed as output so that the step can properly clean any artifacts it produces. Does anything special need to be done to clean multiple files or is this a bug?
If the temporary output file extension filter doesn't work (which seems to be your case), try making a script that checks if any files were generated from a previous build; if so, delete them, if not do nothing, then carry on with the script you normally use. Set this as a prebuild step.
I had a custom VS shell and I couldn't select the temporary file extensions in that shell and this was the only solution I could use at the time. (obviously, if you're in a hurry, you can just call rm or del and not worry about checking first).
If you're good at perl, try using that, if not just use a normal batch file.
If it is a bug that happens to a lot of people, maybe they'll fix it someday. Personally I use VS2008 just cos I don't trust VS2010.
精彩评论