Commit b595e11
authored
[build] Use netstandard2.0 for all workload packs (#5812)
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-inputs1 parent 12da145 commit b595e11
File tree
2 files changed
+7
-1
lines changed- build-tools/create-packs
- src/Microsoft.Android.Templates
2 files changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
0 commit comments