Tool for shrinking Visual C++ projects
#1 Members - Reputation: 3279
Posted 25 August 2011 - 08:38 PM
So anyways, long story short, I got sick of it and wrote a simple tool that does it for me. I am just throwing it out there in case anyone is interested you can download the app ( and source code) here. It's written in C# and compiled against .NET 4.0, but I don't think I do anything that wouldn't compile on .NET 1.1 or Mono if you dont have .net 4 runtimes installed.
Of course, all these temporary files do something and there is a cost for deleting them. First off, they need to rebuild the next time you open or compile your project, so its obviously going to be slower the next time you start up. That said, my savings in time from copying backups more than makes up for this penalty! Not to mention my poor Dropbox account is bulging at its 2GB seams!
Anyways, if you find yourself in the same boat, I hope I have saved you a small bit of time.
#2 Members - Reputation: 1868
Posted 26 August 2011 - 12:13 AM
get-childitem -path . -recurse -include ("*.ilk", "*.pdb", "*.sdf", "*.suo", "*.vcxproj.user", "Debug", "Release", "ipch") | foreach-object -process { remove-item $_ }
Of course you can get fancy with reading the project name and parsing the vcxproj to find what configurations it has and what-not ...
Or you could use the "Clean solution" under "Build" in Visual Studio ...
#4 Members - Reputation: 360
Posted 26 August 2011 - 02:47 AM
Personally, I just use a file extension exclusion list in my mercurial configuration for the project. Most version control software handles this sort of thing pretty well.
Though, I found it was a little more complicated to set up a dedicated version control solution than just installing dropbox + 7zip.
#5 Members - Reputation: 3279
Posted 26 August 2011 - 06:26 AM
That said, the same thing could be built with relative ease in Powershell, then again, Powershell can be pretty much considered a first class langauge these days, so just about anything could be created in powershell.
#6 Crossbones+ - Reputation: 1328
Posted 27 August 2011 - 05:31 AM
So delete them.Recently I've been zipping/sharing/backing up a number of Visual C++ projects and I noticed unlike other Visual Studio projects the bloat is somewhat obscene. Intellisense and precompiled header files alone can cause your folder to grow by an order of magnitude.
#7 Members - Reputation: 3279
Posted 28 August 2011 - 02:34 PM
So delete them.
Recently I've been zipping/sharing/backing up a number of Visual C++ projects and I noticed unlike other Visual Studio projects the bloat is somewhat obscene. Intellisense and precompiled header files alone can cause your folder to grow by an order of magnitude.
... well, that's what the tool does, it deletes the crap for me. Granted, its a 2 minute job, but a 2 minute job I have had to perform 40 or 50 times thus far since writing the tool.
#9 Members - Reputation: 3279
Posted 28 August 2011 - 05:02 PM
If you store your projects in a version control system you normally don't include extra stuff like bin and obj and those extra files. Then people can just pull a cleaned version magically after you commit changes.
True, but this isn't exactly massive projects I am dealing with. These are short one offs and tutorials.






