Skip to content

Disable event source in mobile sample apps #106880

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vitek-karas
Copy link
Member

Event source support is disabled by default by the iOS and Android SDKs, and ideally the sample app should match that behavior as closely as possible in general runtime functionality.

The sample app is also used to measure app size, and so it should be representative of the defaults users will get when using SDK.

Event source support is disabled by default by the iOS and Android SDKs, and ideally the sample app should match that behavior as closely as possible in general runtime functionality.

The sample app is also used to measure app size, and so it should be representative of the defaults users will get when using SDK.
@vitek-karas vitek-karas added test-enhancement Improvements of test source code os-android os-ios Apple iOS labels Aug 23, 2024
@vitek-karas vitek-karas added this to the 10.0.0 milestone Aug 23, 2024
@vitek-karas vitek-karas self-assigned this Aug 23, 2024
Copy link
Contributor

Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

@akoeplinger
Copy link
Member

We already have this code which sets the ~same default for testing:

<!-- Reduce library test app size by trimming framework library features -->
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">false</UseSystemResourceKeys>
<UseNativeHttpHandler Condition="'$(UseNativeHttpHandler)' == ''">false</UseNativeHttpHandler>

Would be nice to move this to extract this into a common .targets that we can import into the samples apps.
Browser/wasm sample apps have the same issue.

@matouskozak
Copy link
Member

We already have this code which sets the ~same default for testing:

<!-- Reduce library test app size by trimming framework library features -->
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">false</UseSystemResourceKeys>
<UseNativeHttpHandler Condition="'$(UseNativeHttpHandler)' == ''">false</UseNativeHttpHandler>

Would be nice to move this to extract this into a common .targets that we can import into the samples apps. Browser/wasm sample apps have the same issue.

What kind of feature switches would Browser/wasm sample apps want to turn off/on?

For mobile sample apps, I think it would make sense to set an intersection of Android https://github.com/dotnet/android/blob/119d46c3a424ffeb3721718043616bfb10f5622f/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets#L109-L120 and macios https://github.com/xamarin/xamarin-macios/blob/92092f67fdc0979b9db95bdef55a9c8280d383e4/dotnet/targets/Xamarin.Shared.Sdk.targets#L121-L136 settings.

E.g.:

<EnableUnsafeBinaryFormatterSerialization Condition="'$(EnableUnsafeBinaryFormatterSerialization)' == ''">false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
<UseNativeHttpHandler Condition="'$(UseNativeHttpHandler)' == ''">true</UseNativeHttpHandler>

@ivanpovazan
Copy link
Member

I agree with @akoeplinger
Probably we can make use of this file: https://github.com/dotnet/runtime/blob/main/src/mono/msbuild/common/CommonMobileBuild.props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VM-meta-mono os-android os-ios Apple iOS test-enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants