Skip to content

Address build log warnings#11625

Open
simonrozsival wants to merge 5 commits into
mainfrom
dev/simonrozsival/build-log-warning-cleanup
Open

Address build log warnings#11625
simonrozsival wants to merge 5 commits into
mainfrom
dev/simonrozsival/build-log-warning-cleanup

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

This separates warning cleanups from the Java.Interop work branch so they can be reviewed independently.\n\nThe changes address warnings surfaced in local build logs across runtime, installer, and test infrastructure code.

Copilot AI review requested due to automatic review settings June 10, 2026 09:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to reduce local build-log warnings by cleaning up XML documentation issues, removing unused usings, and adding targeted warning suppressions across installer, runtime, and test infrastructure code.

Changes:

  • Suppress or resolve documentation-related warnings (e.g., CS1591) and improve XML doc completeness/accuracy.
  • Add targeted analyzer suppressions / nullability tweaks in runtime + test utilities.
  • Remove unused usings / tighten some nullable flows.
Show a summary per file
File Description
src/Xamarin.Installer.Common/Xamarin.Installer.Common.csproj Adds CS1591 suppression to reduce doc-warning noise.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Repository.cs Removes incorrect/obsolete XML doc parameter tag.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/JavaDependencyInstaller.cs Adjusts temp-file creation to address compiler warning.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/IProgressMonitor.cs Completes XML docs for progress-reporting parameters.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/DirectorySizeMonitoringTimer.cs Fixes XML doc parameter name/description.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/HttpClientProvider.cs Adds missing XML docs for optional parameters.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/Archive.cs Adjusts XML documentation text to avoid doc warnings.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/Common/AndroidLicensesStorage.cs Adds missing XML doc for a boolean parameter.
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK/AndroidSDKInstaller.cs Fixes/extends XML docs (param tags, formatting).
src/Xamarin.Installer.AndroidSDK/Xamarin.Installer.AndroidSDK.csproj Adds CS1591 suppression to reduce doc-warning noise.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/SolutionBuilder.cs Adds nullability annotation to help static analysis.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidSdkResolver.cs Suppresses CA1416 around Windows registry usage in tests.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/InlineData.cs Removes unused using.
src/Mono.Android/Mono.Android.csproj Removes a compile item from Mono.Android build inputs.
src/Mono.Android/Java.Interop/TypeManager.cs Tightens nullable flow around typemap resolution.
src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs Updates P/Invoke signature nullability for typemap lookup.
src/Mono.Android/Android.Runtime/JNIEnv.cs Qualifies RuntimeFeature usage and adjusts nullable return types.
src/Mono.Android/Android.Runtime/AndroidRuntime.cs Removes unused usings; qualifies RuntimeHelpers usage.
build-tools/jnienv-gen/Generator.cs Suppresses an “unassigned field” warning in generator model types.

Copilot's findings

  • Files reviewed: 19/19 changed files
  • Comments generated: 4

Comment on lines +267 to 271
static Type? GetJavaToManagedTypeCore (string? class_name)
{
if (TypeManagerMapDictionaries.JniToManaged.TryGetValue (class_name, out Type? type)) {
if (class_name is not null && TypeManagerMapDictionaries.JniToManaged.TryGetValue (class_name, out Type? type)) {
return type;
}
Comment on lines 366 to 370
<Compile Include="Microsoft.Android.Runtime\ManagedTypeManager.cs" />
<Compile Include="Microsoft.Android.Runtime\ManagedTypeMapping.cs" />
<Compile Include="Microsoft.Android.Runtime\JavaMarshalValueManager.cs" />
<Compile Include="Microsoft.Android.Runtime\RuntimeFeature.cs" />
<Compile Include="Microsoft.Android.Runtime\SimpleValueManager.cs" />
<Compile Include="Microsoft.Android.Runtime\SingleUniverseTypeMap.cs" />

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot we need to figure out how to remove it AND make sure it's accessible everywhere where it's needed (via InternalsVisibleTo I imagine). This way we don't have the same class in both Mono.Android and Mono.Android.Runtime. Only the Mono.Android.Runtime should be used everywhere.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done in the latest commit. RuntimeFeature.cs is now removed from Mono.Android.csprojMono.Android.Runtime already had [assembly: InternalsVisibleTo("Mono.Android, ...")] in its AssemblyInfo.cs.in, so AndroidRuntimeFeature (internal) remains accessible from Mono.Android via that existing declaration.

Comment thread build-tools/jnienv-gen/Generator.cs Outdated
@simonrozsival

Copy link
Copy Markdown
Member Author

@copilot address code review

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@copilot address code review

Addressed all four review points in commit 9cffd94:

  1. TypeManager.cs – Replaced the combined null-and-dict check with an early return null guard when class_name is null, so neither the native typemap APIs nor the dictionary Add can ever see a null key.

  2. Mono.Android.csproj – Restored RuntimeFeature.cs to the compile items. The type is internal and the copy in Mono.Android.Runtime is not accessible from Mono.Android, so it needs to be compiled into both assemblies.

  3. JavaDependencyInstaller.cs – Replaced the empty using (...); statement + CS0642 pragma with using var _ = File.Create(...).

  4. Generator.cs – Replaced the CS0649 pragma with an explicit = false field initializer.

@simonrozsival

Copy link
Copy Markdown
Member Author

@copilot let's rename RuntimeFeature class to AndroidRuntimeFeature to avoid the conflicts

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@copilot let's rename RuntimeFeature class to AndroidRuntimeFeature to avoid the conflicts

Done in commit 9b3e06d. Renamed RuntimeFeatureAndroidRuntimeFeature across all 9 affected files. JNIEnvInit.cs retains the local alias (using RuntimeFeature = Microsoft.Android.Runtime.AndroidRuntimeFeature) so its call sites didn't need individual updates. The FeatureSwitchPrefix string ("Microsoft.Android.Runtime.RuntimeFeature.") is left unchanged since it's the public feature-switch identifier used with AppContext.TryGetSwitch.

Comment thread src/Mono.Android/Java.Interop/TypeManager.cs Outdated
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
…lsVisibleTo from Mono.Android.Runtime

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
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.

3 participants