-
Notifications
You must be signed in to change notification settings - Fork 564
[build] Use netstandard2.0 for all workload packs #5812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4614104&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=9492f091-fb29-57d7-1f68-ecbf86da9c24 After bumping msbuild on macOS we ran into an issue when packing our workload .nupkg files: /Users/builder/.dotnet/sdk/5.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 6.0. Either target .NET Core 5.0 or lower, or use a version of the .NET SDK that supports .NET Core 6.0. [/Users/builder/azdo/_work/1/s/xamarin-android/build-tools/create-packs/Microsoft.Android.Sdk.proj] The target framework used by the projects that create our workload packs should not matter. Updating them to netstandard2.0 should improve compatibility when restoring, packing, or otherwise using these projects to invoke other targets. The target framework does end up in the .nuspec file in these packages however, but we can prevent this with: <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> Finally, these packages use the DotnetPlatform or Template PackageType and are not intended to be functional NuGets. We can supress certain nuspec related warnings to clean up build output: C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below: [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5128: - Add lib or ref assemblies for the netstandard2.0 target framework [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5130: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder have compatible matches, but not exact matches in the other location. Unless intentional, consult the list of actions below: [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5130: - Add a dependency group for net6.0 to the nuspec [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: References were found in the nuspec, but some reference assemblies were not found in both the nuspec and ref folder. Add the following reference assemblies: [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add Java.Interop.dll to the net6.0 reference group in the nuspec [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add Mono.Android.dll to the net6.0 reference group in the nuspec [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add Mono.Android.Export.dll to the net6.0 reference group in the nuspec [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add mono.android.jar to the net6.0 reference group in the nuspec [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add mono.android.dex to the net6.0 reference group in the nuspec [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj] C:\Program Files\dotnet\sdk\5.0.201\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add AndroidApiInfo.xml to the net6.0 reference group in the nuspec [C:\Users\Peter\source\xamarin-android\build-tools\create-packs\Microsoft.Android.Ref.proj]
jonathanpeppers
approved these changes
Apr 1, 2021
jonathanpeppers
pushed a commit
that referenced
this pull request
Apr 2, 2021
Context: #5806 Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4614104&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=9492f091-fb29-57d7-1f68-ecbf86da9c24 PR #5806 (currently a draft) bumped the system mono and msbuild on various CI machines. As these machines are *not* VMs, and do *not* "start from clean" for every PR build (for performance reasons), the inadvertent result is that *every subsequent build* on these machines now *fails* when packing our workload .nupkg files: /Users/builder/.dotnet/sdk/5.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 6.0. Either target .NET Core 5.0 or lower, or use a version of the .NET SDK that supports .NET Core 6.0. [/Users/builder/azdo/_work/1/s/xamarin-android/build-tools/create-packs/Microsoft.Android.Sdk.proj] The target framework used by the projects that create our workload packs should not matter; they do not need to be `net6.0`. Update `$(TargetFramework)` to `netstandard2.0`, which improves compatibility when restoring, packing, or otherwise using these projects to invoke other targets. The `$(TargetFramework)` value *does* end up in the `.nuspec` file in these packages however, but we can prevent this by setting the [`$(SuppressDependenciesWhenPacking)` property][0] to true: <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> Finally, these packages use the DotnetPlatform or Template PackageType and are not intended to be functional NuGets. We can suppress certain nuspec related warnings to clean up build output: …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below: …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5128: - Add lib or ref assemblies for the netstandard2.0 target framework …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5130: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder have compatible matches, but not exact matches in the other location. Unless intentional, consult the list of actions below: …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5130: - Add a dependency group for net6.0 to the nuspec …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: References were found in the nuspec, but some reference assemblies were not found in both the nuspec and ref folder. Add the following reference assemblies: …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add Java.Interop.dll to the net6.0 reference group in the nuspec …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add Mono.Android.dll to the net6.0 reference group in the nuspec …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add Mono.Android.Export.dll to the net6.0 reference group in the nuspec …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add mono.android.jar to the net6.0 reference group in the nuspec …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add mono.android.dex to the net6.0 reference group in the nuspec …\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5131: - Add AndroidApiInfo.xml to the net6.0 reference group in the nuspec [0]: https://docs.microsoft.com/nuget/reference/msbuild-targets#pack-target-inputs
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4614104&view=logs&j=96fd57f5-f69e-53c7-3d47-f67e6cf9b93e&t=9492f091-fb29-57d7-1f68-ecbf86da9c24
After bumping msbuild on macOS we ran into an issue when packing our
workload .nupkg files:
The target framework used by the projects that create our workload packs
should not matter. Updating them to netstandard2.0 should improve
compatibility when restoring, packing, or otherwise using these projects
to invoke other targets.
The target framework does end up in the .nuspec file in these packages
however, but we can prevent this with:
Finally, these packages use the DotnetPlatform or Template PackageType
and are not intended to be functional NuGets. We can supress certain
nuspec related warnings to clean up build output: