You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1884 introduces the MetalamaPlatformRequirement item and seeds it for Metalama.Framework alone. The comment
on that issue lists four packages of this repository whose requirement is stricter than the framework's, and
records that adding their contributions in a follow-up issue is the acceptable order:
If the plain check has to ship sooner, the fallback is to implement the target so that it reads @(MetalamaPlatformRequirement) from the start, seed the item from Metalama.Framework alone, and add the
contributions of the four packages listed above in a follow-up issue. The documentation of the item as a public
contract can then follow in that second issue.
It declares net472;net8.0-windows, which #1876 turns into net472;net10.0-windows. It has no netstandard2.0 asset and it requires the Windows platform, so it is narrower than the framework on two dimensions at once. This is the motivating case, and #1876 records it as a breaking change.
Metalama.LinqPad
It targets net8.0-windows, which becomes net10.0-windows. Its requirement follows the LINQPad host rather than the framework.
Metalama.Extensions.DiffEngine
It already selects assets per target framework through MetalamaExtensionAssembly, so it has a requirement to state and already has the build folder to state it in.
Metalama.Extensions.HtmlWriter
The same.
The Metalama.Patterns.* packages that declare netstandard2.0 beside the .NET target framework have the same
requirement as the framework and should declare nothing. None of them has a build folder today, and none should
gain one for this.
What has to be done
For each of the four packages, add a MetalamaPlatformRequirement item to its build/<PackageId>.props and to
the same file under buildTransitive. Metalama.Patterns.Wpf and Metalama.LinqPad have no build folder yet,
so this issue creates one for them, which is a packaging change and needs its own verification that the props file
reaches the consumer.
The item must be declared in a .props file rather than a .targets file. NuGet imports the build props of
every package before it reads any targets file, so the check sees every contribution whatever the order in which
NuGet imports the packages.
The values to declare are the target frameworks that #1876 leaves each package with. Doing this issue before #1876 would declare values that #1876 immediately changes, so this issue should follow #1876.
Acceptance criteria
A project that targets net10.0 without the Windows platform and references Metalama.Patterns.Wpf reports LAMA0600 naming Metalama.Patterns.Wpf.
A project that targets net10.0-windows and references Metalama.Patterns.Wpf reports nothing.
MetalamaSupportedPlatformExclusion with Metalama.Patterns.Wpf suppresses that warning and leaves the
warning of Metalama.Framework, if any, in place.
Building this repository reports none of these warnings.
Summary
#1884 introduces the
MetalamaPlatformRequirementitem and seeds it forMetalama.Frameworkalone. The commenton that issue lists four packages of this repository whose requirement is stricter than the framework's, and
records that adding their contributions in a follow-up issue is the acceptable order:
This is that follow-up issue. The mechanism shipped in #1886 and is documented in
metalama/Metalama.Documentation#290.
The packages that should declare a requirement
Metalama.Patterns.Wpfnet472;net8.0-windows, which #1876 turns intonet472;net10.0-windows. It has nonetstandard2.0asset and it requires the Windows platform, so it is narrower than the framework on two dimensions at once. This is the motivating case, and #1876 records it as a breaking change.Metalama.LinqPadnet8.0-windows, which becomesnet10.0-windows. Its requirement follows the LINQPad host rather than the framework.Metalama.Extensions.DiffEngineMetalamaExtensionAssembly, so it has a requirement to state and already has thebuildfolder to state it in.Metalama.Extensions.HtmlWriterThe
Metalama.Patterns.*packages that declarenetstandard2.0beside the .NET target framework have the samerequirement as the framework and should declare nothing. None of them has a
buildfolder today, and none shouldgain one for this.
What has to be done
For each of the four packages, add a
MetalamaPlatformRequirementitem to itsbuild/<PackageId>.propsand tothe same file under
buildTransitive.Metalama.Patterns.WpfandMetalama.LinqPadhave nobuildfolder yet,so this issue creates one for them, which is a packaging change and needs its own verification that the props file
reaches the consumer.
The item must be declared in a
.propsfile rather than a.targetsfile. NuGet imports thebuildprops ofevery package before it reads any targets file, so the check sees every contribution whatever the order in which
NuGet imports the packages.
Order with respect to #1876
The values to declare are the target frameworks that #1876 leaves each package with. Doing this issue before
#1876 would declare values that #1876 immediately changes, so this issue should follow #1876.
Acceptance criteria
net10.0without the Windows platform and referencesMetalama.Patterns.WpfreportsLAMA0600namingMetalama.Patterns.Wpf.net10.0-windowsand referencesMetalama.Patterns.Wpfreports nothing.MetalamaSupportedPlatformExclusionwithMetalama.Patterns.Wpfsuppresses that warning and leaves thewarning of
Metalama.Framework, if any, in place.MetalamaPlatformRequirementitem is documented as a public contract that a third-party package may use,with the compatibility obligations that Warn when the target framework, the .NET SDK or the Visual Studio version is outside the tested support matrix #1884 records: unknown metadata is ignored, and absent metadata means no
constraint.
— Claude for Gaël Fraiteur (@gfraiteur)