fsprojects / ProjectScaffold

A prototypical .NET solution (file system layout and tooling), recommended for F# projects
http://fsprojects.github.io/ProjectScaffold
The Unlicense
515 stars 154 forks source link

Why used Rebuild task instead Build in build.template file? #258

Open Chicker opened 8 years ago

Chicker commented 8 years ago

Hi, all!

Maybe answer will be obvious, but I can't understand why in the target Build in the file build.template, used task Rebuild instead Build for build solution (project).

As far as I know, only Build task allows incremental build that gives us the big boost in the build speed.

adamchester commented 8 years ago

Good question. I don't have the answer, but here's my thoughts.

Maybe rebuild is considered more "safe", and I was OK with that before I started using ionide plugins to build from my editor.

These days, I think the default should be build (incremental) unless you are doing a release (where perhaps rebuild is more appropriate).

Chicker commented 8 years ago

About the task Rebuild in MSDN documentation says: initially, will delete all temporary files and artifacts, and then will build the project, include recompilation of all the source files.

In practice, in most cases, it is recommended to run Build project as it runs much faster. And just in case "strange" errors when building, it is recommended to try Rebuild, because temporary files are cleared, due to which the project could fail build.

So, in my opinion, would be perfect to make the following changes:

  1. In the target Build to set the task to Build. In 99% of cases, it will be OK and faster.
  2. Add the target Rebuild, where to set the taskRebuild.

Actually, it is done in MS Visual Studio, where we have two items in the application build menu.

If there is no objection, I can make a PR.