6

I've got a msbuild task in cruiseControl which first Clearn and then Rebuild. Can there be any difference if I change it as Clean and Build (rather than rebuild) ?

Rebuild does "Clean + Build" for each project. "Clean + Build" in the solution will clean all the projects and then build each of them. Can there be some corner cases that can make differences?

CharithJ
  • 46,289
  • 20
  • 116
  • 131

2 Answers2

7

Assuming the msbuild targets have not been modified to add extra functionality then:

Rebuild = Clean + Build
Paul Creasey
  • 28,321
  • 10
  • 54
  • 90
5

Rebuild is a shortcut for doing Clean and then Build - so you should get the same results.

Josh M.
  • 26,437
  • 24
  • 119
  • 200
  • Rebuild does "Clean + Build" each project. "Clean + Build" in the solution will clean all the projects and then build. I thought there can be some corner cases that can make differences? – CharithJ May 06 '11 at 01:11
  • You can do rebuild on a single project or the entire solution, same with clean and build. – Josh M. May 06 '11 at 01:14
  • Cannot there be cases like referencing the old dlls(that to be cleaned) because they were not cleaned initially? My solution has main application, couple of tools and few dlls. We've referenced them as projects rather than dlls. Still there can be some corner cases..? – CharithJ May 06 '11 at 01:21
  • Maybe? Is there specific issue you're seeing that you're trying to resolve? If so, you should include that in your question. – Josh M. May 06 '11 at 01:23
  • As I've mentioned in the question at the moment we have Clean+Rebuild. I am thinking to change it as Clean+Build. But I am doubtful whether both are the same or can be different (at least in some special cases). I don't want to change it if that can be problametic at all... – CharithJ May 06 '11 at 01:27
  • And I, along with everyone else, has answered that yes - they are the same. You can look in the MSBuild file to confirm this - just track down the `Rebuild`, `Clean`, and `Build` targets. – Josh M. May 06 '11 at 01:30
  • Thanks Josh, appreciate your comments! – CharithJ May 06 '11 at 01:39