Build the Bundler as a library (dotnet/core-setup#5798)
* Build the Bundler as a library
Currently, the single-file bundler is
* Built as an app instead of a library
* Invoked from the SDK out-of-proc in order to enforce strict API boundaries
However, since the SDK implementation progressed, we've had to revisit the above decisions.
First, the bundler currently is implemented to take a folder vs a list of files to bundle.
* This causes unnecessary extra copies to the publish directory.
* The files to be bundled need not be first copied to the publish directory.
* Instead they can be written directly to the bundle.
* Stale items remaining in the publish directory may be written into the bundle unnecessarily.
Therefore, we decided that the bundler should take tuples of (source file-path, relative-path within bundle) instead of the publish folder as input.
* While it is possible to provide this input on the command-line/response file, it is convenient and more efficient to do it in-proc.
* Further, the SDK team agrees that the bundler is simple enough to run in-proc with the build system.
Therefore, the changes proposed are:
* Bundler will be built into a library Microsoft.NET.HostModel in core-setup repo (similar to DependencyModel)
* It is not a task directly because we don't have to worry about multi-targeting
* Other apphost related services like stamping the app.dll name into the apphost will be moded into this library
* A task in the SDK repo will consume this library through package reference (from myget)
* (WIP) SDK changes: https://github.com/dotnet/sdk/compare/master...swaroop-sridhar:bundle-lib?expand=1
Commit migrated from https://github.com/dotnet/core-setup/commit/
345061995531c6f8de00189842a27298d5d1a9b1