unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.89k stars 720 forks source link

Generated NotImplementedAttribute does not contain specific platform on types #4893

Closed jeromelaban closed 2 years ago

jeromelaban commented 3 years ago

Current behavior

The SymbolIcon type is marked as not implemented, even if members are implemented.

Expected behavior

The SymbolIcon is not marked as not implemented.

How to reproduce it (as minimally and precisely as possible)

Workaround

Anything else we need to know?

The API generator should determine if inner elements have been implemented and include the proper not implemented list, like the #if statement above.

Note for contributors

The code locations to update are referencing this block: https://github.com/unoplatform/uno/blob/93818bee2424961c31237c5c154ee35648cf9208/src/Uno.UWPSyncGenerator/Generator.cs#L277-L290

Youssef1313 commented 3 years ago

@jeromelaban @MartinZikmund Was this fixed in #6118?

jeromelaban commented 3 years ago

6118 was specific to SymbolIcon, there a larger case for determining the platform list to include the fact that any of the members have been implemented.

Youssef1313 commented 3 years ago

@jeromelaban I'm unable to run UWPSyncGenerator locally to be able to test and debug this. Here is the output:

Generating for Uno.Foundation Windows.Foundation.FoundationContract
Loading for : Uno.UWPSyncGenerator.Reference.csproj
Searching for [Microsoft.CodeAnalysis.Features, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Searching for [Microsoft.CodeAnalysis.CSharp.Features, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Searching for [Microsoft.CodeAnalysis.VisualBasic.Features, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Searching for [Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Loaded [Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/Microsoft.Build.Framework.dll]
Searching for [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Loaded [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [file:///C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/Microsoft.Build.dll]
Searching for [Microsoft.Build.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Searching for [Microsoft.Build.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Searching for [Microsoft.Build.Tasks.Core.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Searching for [Microsoft.Build.Tasks.Core.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Users\PC\Desktop\uno\src\Uno.UWPSyncGenerator\bin\Debug]
Loading for xamarinios10: Uno.Foundation.csproj
[Failure] Msbuild failed when processing the file 'C:\Users\PC\Desktop\uno\src\Uno.Foundation\Uno.Foundation.csproj' with message: The SDK 'Microsoft.NET.Sdk' specified could not be found.  C:\Users\PC\.nuget\packages\msbuild.sdk.extras\3.0.22\Sdk\Sdk.props
C:\Users\PC\.nuget\packages\msbuild.sdk.extras\3.0.22\Sdk\Sdk.props(7,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildSdkResolver" failed to run. An item with the same key has already been added.
C:\Users\PC\.nuget\packages\msbuild.sdk.extras\3.0.22\Sdk\Sdk.props(7,31): error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

Any idea what's going wrong?

Youssef1313 commented 3 years ago

Edit: Editing the comment since I was incorrect :)

Bug seems to be here:

https://github.com/unoplatform/uno/blob/9d816d20cdb890c352bb5542753202e7270471d6/src/Uno.UWPSyncGenerator/SyncGenerator.cs#L73

@jeromelaban Any instructions to run and debug the generator locally?

jeromelaban commented 3 years ago

@Youssef1313 you may find those here: https://github.com/unoplatform/uno/pull/6856 (there's a small fix to get the generator running on VS2022 as well)