maui
maui copied to clipboard
[foldable] Package reference instead of project reference
Reverts #5891 and converts Foldable to a package, following instructions in #5894
Description of Change
- Update Controls.Foldable.csproj to make NuGet
- Restore commented-out foldable code in the Maui.Controls.Sample project
- Update Maui.Controls.Sample.csproj to use a
PackageReference
- Remove Foldable.csproj reference from Samples.slnf
Issues Fixed
#5894 where a GENERATEPROJECTPRIFILE : error : PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry'
was being generated in the CI builds, assumed to be because the Foldable project was being referenced and bringing in all its dependencies as duplicates...
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Latest commits build a NuGet package in the /artifacts/ folder (thanks to Microsoft.Maui.Packages.slnf), but I'm not sure the sample will be able to load it...
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Current error D:\a\_work\1\s\src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj : error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a\_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]
There IS there is a Microsoft.Maui.Controls.Foldable.nupkg NuGet, but it's in
D:\a\_work\1\s\artifacts\nuget
and the Samples project is looking in
D:\a\_work\1\s\bin\dotnet\library-packs
Need to figure out how to add another NuGet source for the sample project OR get the Foldable NuGet into the library-packs directory...
UPDATE: confirmed that manually dropping the nupkg into bin\dotnet\library-packs
enables the samples build to succeed.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Azure Pipelines successfully started running 2 pipeline(s).
Azure Pipelines successfully started running 2 pipeline(s).
Azure Pipelines successfully started running 2 pipeline(s).
It feels like what's happening on the server must be different to what's happening locally. Will probably roll-back these YAML changes that are trying to copy the nupkg around and revisit assumptions about what files are where 😬
The build logs show the Download Packages step successfully grabs the Foldable NuGet:
Downloaded nuget/Microsoft.Maui.Controls.Foldable.6.0.300-rc.3.7406.nupkg to D:\a\_work\1\s\artifacts\nuget\Microsoft.Maui.Controls.Foldable.6.0.300-rc.3.7406.nupkg
But the Build .NET 6 samples step isn't finding it
error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a\_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a\_work\1\s\Microsoft.Maui.Samples.slnf]
even though the added PowerShell command seems like it should be copying it across
Move-Item -Path artifacts\nuget\*.nupkg -Destination artifacts -Force
Copy-Item -Path artifacts\*.nupkg -Destination "bin\dotnet\library-packs" -Filter *Foldable* -Force
Is it in the artifact? Can you confirm in the artifact on devops or in the copy logs?
Maybe add a dir artifacts/* to a step after the download
The Foldable NuGet is definitely in the nuget artifact at the end!
I don't see the artifacts folder in here:
error NU1101: Unable to find package Microsoft.Maui.Controls.Foldable. No packages exist with this id in source(s): D:\a_work\1\s\bin\dotnet\library-packs, darc-pub-dotnet-runtime-a21b9a2, dotnet-eng, dotnet-public, dotnet6, dotnet7, skiasharp [D:\a_work\1\s\Microsoft.Maui.Samples.slnf]
I got a feeling we need an extra step in the samples to copy nuget-only packages into a folder and then add that to the samples nuget.config. This can probably be done by copying the repo's nuget.config to a temporary location and then adding the path to the new artifacts folder and then setting the RestoreConfigFile
property to the path of the nuget.config: https://github.com/dotnet/maui/blob/main/eng/cake/dotnet.cake#L71
I am also thinking to prevent accidental issues, we should also make a new folder in the temp and copy the 2 foldable files in there and make the nuget.config point to that. By doing that we can make sure we get a build fail if suddenly a package is used instead of the workloads.
@mattleibow yeah, that's why I was trying to copy the Foldable NuGet into bin\dotnet\library-packs
, because it's already in the sources search list for the Samples project 😬
Still not sure why it wasn't working on the server, but either way it was a little hacky and your explanation/suggestion sounds more robust.
After such a long time, we eventually got a bunch of things to make all this work much better.
@conceptdev is this ready to be merged?
I have not had a chance to test the NuGet. Will try to get it done today and approve if it works, thanks.
@conceptdev did you had a chance to try it ? thanks
@rmarinho I started testing this today, but needed to rebuild my VS2022 config, workloads, etc as nothing initially worked. Will finish off tomorrow and let you know how it goes.
UPDATE: I was able to test the code in this branch and it still seems to work 💯 i.e. it detects the hinge when present and snaps the panes to it.
RE: Matt's warning above about generating a NuGet - I'm assuming it will be a "preview" NuGet? What release date would we be aiming for with this package? I recall when working with Shane that there might still be some edge cases we need to test/verify.
Right now, it will have the same branding and version as maui itself.
So in this merge world, it probably will be released as RC 1.
@mattleibow thanks for the clarification! In that case, I wonder if the PMs should chime in as this sounds like a bit of a messaging decision as well as a technical one?
FWIW here's some screenshot of the sample on dual and single screens