I came across IncrementalGet and IncrementalBuild properties of MSBuild 3.5 while I was upgrading MSBuild 2.0 to MSBuild 3.5. I found it very useful for me so I thought let you guys give overview of those properties.
Note: By default value of these properties are set to false for backwards compatibility so if you want to take advantage of these properties you can set that up in tfsbuild.proj file.
IncrementalGet: You can set this property to true to do an incremental get. What it does internally is it sets CleanCompilationOutputOnly to true, SkipInitializeWorkspace to true and ForceGet to false.
IncrementalBuild: You can set this property to true to do an incremental build. What it does internally is it sets SkipClean to true, SkipInitializeWorkspace to true and ForceGet to false.
Here is the description of other property set by IncrementalGet and IncrementalBuild.
When you create a new build definition, TFS will create a workspace and map the source control folder to local working folder. So whenever you run the build, it deletes the old workspace and recreates it. So if you set SkipInitializeWorkspace property to true, it doesn’t delete old workspace.
when you run the build, TFS build creates mainly three folder physically on the build machine.
1) Binaries — all build output binaries will be stored here
2) BuildTypes — all build related files like TFSBuild.proj, TFSBuild.rsp, WorkspaceMapping.xml files will be here
3) Sources — Team project map here. Build will download source files from source control into this folder
So if you set ForceGet to false, CoreGetTask(MSBuild task that downloads source from source control) only affect the above “sources” folder and downloads only the files that are changed since last build.
If you set CleanCompilationOutputOnly to true and SkipClean to false meaning you only set IncrementalGet to true, it deletes Binaries folder and re-build all source codes. This is not incremental build.
If you set SkipClean to true, it doesn’t deletes any of the above three folders and build will build binaries corresponding to the source that’s been changed
For more information about these and other useful properties, you can refer this MSDN article.
Hope this helps.