-
Notifications
You must be signed in to change notification settings - Fork 922
[release/13.0] MAUI Integration Android + OtlpDevTunnel #12762
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
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6121d5c
Android integration
jfversluis b3168b6
Update tests and readme
jfversluis 57b1894
Address comment in #12342
jfversluis ad01125
Address other comment in #12342
jfversluis 305bffe
Remove duplicate name check
jfversluis 2b74c77
Add WithOtlpDevTunnel functionality
jfversluis 8f86c6c
Apply suggestions from code review
jfversluis 75639df
Update src/Aspire.Hosting.Maui/Utilities/MauiEnvironmentHelper.cs
jfversluis c807391
Improve DCP value detection
jfversluis ee29b54
Refactor MauiAndroidEnvironmentProcessedAnnotation marker
jfversluis b74851b
Revert "Update src/Aspire.Hosting.Maui/Utilities/MauiEnvironmentHelpe…
jfversluis 7d3e32a
Share OtlpEndpointResolver
jfversluis 230d6d0
Refactor OTLP endpoint default value handling
jfversluis 7d1cf9c
Improve OTLP tunnel name
jfversluis da8cc55
Revert sharing OtlpResolver code for now
jfversluis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/Aspire.Hosting.Maui/Annotations/OtlpDevTunnelConfigurationAnnotation.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Aspire.Hosting.ApplicationModel; | ||
| using Aspire.Hosting.DevTunnels; | ||
| using Aspire.Hosting.Maui.Otlp; | ||
|
|
||
| namespace Aspire.Hosting.Maui.Annotations; | ||
|
|
||
| /// <summary> | ||
| /// Annotation that stores the OTLP dev tunnel configuration for a MAUI project. | ||
| /// This allows sharing a single dev tunnel infrastructure across multiple platform resources. | ||
| /// </summary> | ||
| internal sealed class OtlpDevTunnelConfigurationAnnotation : IResourceAnnotation | ||
| { | ||
| /// <summary> | ||
| /// The OTLP loopback stub resource that acts as the service discovery target. | ||
| /// </summary> | ||
| public OtlpLoopbackResource OtlpStub { get; } | ||
|
|
||
| /// <summary> | ||
| /// The resource builder for the OTLP stub (used for WithReference calls). | ||
| /// </summary> | ||
| public IResourceBuilder<OtlpLoopbackResource> OtlpStubBuilder { get; } | ||
|
|
||
| /// <summary> | ||
| /// The dev tunnel resource that tunnels the OTLP endpoint. | ||
| /// </summary> | ||
| public IResourceBuilder<DevTunnelResource> DevTunnel { get; } | ||
|
|
||
| public OtlpDevTunnelConfigurationAnnotation( | ||
| OtlpLoopbackResource otlpStub, | ||
| IResourceBuilder<OtlpLoopbackResource> otlpStubBuilder, | ||
| IResourceBuilder<DevTunnelResource> devTunnel) | ||
| { | ||
| OtlpStub = otlpStub; | ||
| OtlpStubBuilder = otlpStubBuilder; | ||
| DevTunnel = devTunnel; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Aspire.Hosting.ApplicationModel; | ||
|
|
||
| namespace Aspire.Hosting.Maui; | ||
|
|
||
| /// <summary> | ||
| /// A resource that represents an Android physical device for running a .NET MAUI application. | ||
| /// </summary> | ||
| /// <param name="name">The name of the Android device resource.</param> | ||
| /// <param name="parent">The parent MAUI project resource.</param> | ||
| public sealed class MauiAndroidDeviceResource(string name, MauiProjectResource parent) | ||
| : ProjectResource(name), IMauiPlatformResource | ||
| { | ||
| /// <summary> | ||
| /// Gets the parent MAUI project resource. | ||
| /// </summary> | ||
| public MauiProjectResource Parent { get; } = parent; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Aspire.Hosting.ApplicationModel; | ||
|
|
||
| namespace Aspire.Hosting.Maui; | ||
|
|
||
| /// <summary> | ||
| /// A resource that represents an Android emulator for running a .NET MAUI application. | ||
| /// </summary> | ||
| /// <param name="name">The name of the Android emulator resource.</param> | ||
| /// <param name="parent">The parent MAUI project resource.</param> | ||
| public sealed class MauiAndroidEmulatorResource(string name, MauiProjectResource parent) | ||
| : ProjectResource(name), IMauiPlatformResource | ||
| { | ||
| /// <summary> | ||
| /// Gets the parent MAUI project resource. | ||
| /// </summary> | ||
| public MauiProjectResource Parent { get; } = parent; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.