Skip to content
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

Added avalonia sample app and detailed description #2199

Draft
wants to merge 1 commit into
base: rel/5.8.0
Choose a base branch
from

Conversation

gentledepp
Copy link

@gentledepp gentledepp commented Oct 7, 2024

Hello!

Me again.

I managed to fix the build.

  • The samples do work. (Desktop, iOS and Android)
  • the package versions are configured in the Directory.packages.props file.

However, the .\build.cmd fails with the ".Android" and ".iOS" Avalonia projects claiming:

.\build.cmd
Determining projects to restore...
Alle Projekte sind für die Wiederherstellung auf dem neuesten Stand.
Runtime toolset 'aspnetcore/x64 v6.0.32' already installed.
Runtime toolset 'aspnetcore/x64 v7.0.20' already installed.
Determining projects to restore...
C:\Code_gh\openiddict-core_gd.dotnet\sdk\8.0.303\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(117,5): error NETSDK1139: The target platform identifier ios was not recognized [C:\Code_gh\openiddict-cor
e_gd\sandbox\OpenIddict.Sandbox.Avalonia.Client\OpenIddict.Sandbox.Avalonia.Client.iOS\OpenIddict.Sandbox.Avalonia.Client.iOS.csproj]
C:\Code_gh\openiddict-core_gd.dotnet\sdk\8.0.303\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(117,5): error NETSDK1139: The target platform identifier android was not recognized [C:\Code_gh\openiddict
-core_gd\sandbox\OpenIddict.Sandbox.Avalonia.Client\OpenIddict.Sandbox.Avalonia.Client.Android\OpenIddict.Sandbox.Avalonia.Client.Android.csproj]

Error during the build process.

C:\Code_gh\openiddict-core_gd.dotnet\sdk\8.0.303\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(117,5): error NETSDK1139: The target platform identifier ios was not recognized [C:\Code_gh\openiddict-cor
e_gd\sandbox\OpenIddict.Sandbox.Avalonia.Client\OpenIddict.Sandbox.Avalonia.Client.iOS\OpenIddict.Sandbox.Avalonia.Client.iOS.csproj]
C:\Code_gh\openiddict-core_gd.dotnet\sdk\8.0.303\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(117,5): error NETSDK1139: The target platform identifier android was not recognized. [C:\Code_gh\openiddict
-core_gd\sandbox\OpenIddict.Sandbox.Avalonia.Client\OpenIddict.Sandbox.Avalonia.Client.Android\OpenIddict.Sandbox.Avalonia.Client.Android.csproj]
0 Warnung(en)
2 Fehler

Build failed with exit code 1. Check errors above.

Interestingly, when I run dotnet build in the openiddict-core root folder, I get a similar error.

However, if I specify the Android sdk explicitly, like the following, then the build succeeds:

dotnet build -p:AndroidSdkDirectory="C:\SDKs\Android\android-sdk" -p:JavaSdkDirectory="C:\SDKs\Android\openjdk\jdk-17.0.8.101-hotspot"

It seems that for whatever reason the .\build.cmd does not pick up the sdks properly.

Any idea why that is the case?
I am terribly sorry for asking this question, but I could not figure out your complex build script until now :-|

Once that is fixed, I am

  • planning to re-base on the dev branch and create a new PR
    Before I do that, please let me know if this effort is welcome. Otherwise I'll create a sample in the avalonia repo as an alternative. But for that I'd have to copy your OpenIddict.Sandbox.AspNet.Server and OpenIddict.Sandbox.AspNetCore.Server and I am not sure if that is ok (given your OS license)
  • contribute a documentation on the openiddict docs website regarding how to use ms devtunnels with openIddict and how to configure the server (information from my /avalonia/readme.md) in better english. Are you interested in this at all?

@gentledepp gentledepp force-pushed the feature/avalonia_wbp branch 2 times, most recently from a0d75d1 to 3f594f0 Compare October 8, 2024 07:47
Copy link
Member

@kevinchalet kevinchalet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

Directory.Packages.props Outdated Show resolved Hide resolved
sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs Outdated Show resolved Hide resolved
sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs Outdated Show resolved Hide resolved
sandbox/OpenIddict.Sandbox.AspNetCore.Server/Startup.cs Outdated Show resolved Hide resolved
@@ -0,0 +1,482 @@
# Avalonia sample app guide
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These samples are engineering samples - hence the name, "sandbox" - meant to be used to test OpenIddict features as they are being developed. They are not meant to be used by the general public, so this is likely not the right place for this guidance.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I can add this to the official docs then and reduce this to

How to run the sample on iOS and Android

  • set the issuer URI on client and server
  • and start the server in dev tunnel with host header forwarding
  • for details, please check out the guide on using dev tunnels (that I am going to write)

Would that be ok?

sandbox/OpenIddict.Sandbox.Maui.Client/MainPage.xaml.cs Outdated Show resolved Hide resolved
sandbox/OpenIddict.Sandbox.Maui.Client/MauiProgram.cs Outdated Show resolved Hide resolved
@kevinchalet
Copy link
Member

Any idea why that is the case?
I am terribly sorry for asking this question, but I could not figure out your complex build script until now :-|

Honestly, no idea: OpenIddict doesn't do anything fancy and simply uses .NET Arcade.

Before I do that, please let me know if this effort is welcome.

If we can fix the build issues in a way it doesn't prevent the solution from building correctly and eliminate all the tiny extensions/classes - aka "make it minimal" - so it doesn't become a pain to maintain, I don't mind merging it 😄

@gentledepp gentledepp force-pushed the feature/avalonia_wbp branch 3 times, most recently from f9e6114 to c50e147 Compare October 9, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants