Allow building nuget packages for MSBuild#95
Conversation
Update build.pl adding -p switch to create the package.
There was a problem hiding this comment.
Why are the sources included in the nuget package?
There was a problem hiding this comment.
The tools as the destination does not work. Either because of the reference items in the nuspec file or because I use the -symbols flag. That's the flag that creates a special symbols package on Windows with the sources and pdb files for debugging (Microsoft.Build.Debug.14.1.0.0-prerelease.symbols.nupkg). The Microsoft.Build.Debug.14.1.0.0-prerelease.nupkg includes only binaries. On Linux the Microsoft.Build.Mono.Debug.14.1.0.0-prerelease.nupkg (main and only) package contains sources in it. The symbols are not present for now on Linux since Roslyn does not create them.
|
Really looking forward to seeing this 👍 |
|
LGTM |
Allow building nuget packages for MSBuild
|
What kind of packages are these and why do they have so many dlls in them? |
…4+ (dotnet#95) Razor SDK (in dotnet 3.0x preview4+) has a target `RazorCoreCompile` in `Microsoft.NET.Sdk.Razor.Compilation.targets` as part of the SDK. This is a copy of the `Microsoft.CSharp.Core.targets` file, but is meant for use with csc 8.0 . So, it uses Csc task parameters introduced in that, namely `DisableSdkPath` and `NullableContextOptions`. But on mono the Roslyn tasks and targets are used from what mono bundles, which is older than 8.0, which breaks any Razor sdk projects with: ``` /usr/local/share/dotnet/sdk/3.0.100-preview4-011223/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Compilation.targets(136,10): error MSB4064: The "DisableSdkPath" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property. [/private/tmp/test/mvc/mvc.csproj] /usr/local/share/dotnet/sdk/3.0.100-preview4-011223/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Compilation.targets(120,5): error MSB4063: The "Csc" task could not be initialized with its input parameters. [/private/tmp/test/mvc/mvc.csproj] ``` The temporary workaround is to have a copy of that targets file (`Microsoft.NET.Sdk.Razor.Compilation.targets`) and import that via the hook `CustomAfterRazorSdkTargets`. Comment added to the copy of the file: ``` This is a copy of `Microsoft.NET.Sdk.Razor.Compilation.targets` from the `Microsoft.NET.Sdk.Razor` bundled in `3.0.100-preview4-011223`. Changes made: 1. LangVersion changed to 7.3 from 8.0 2. Csc task parameters `DisableSdkPath` and `NullableContextOptions` were removed. This was done due to a mismatch in Roslyn version that the sdk expects to use and the one that mono has. Mono's version is < 8.0 and the task is missing the above mentioned two new parameters. This is *temporary* and a HACK and will be removed as soon as mono gets the roslyn update. ```
Created nuspec files and a target.
Updated build.pl adding -p switch to create the package.