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

Suppress binding warnings. #1025

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
<!-- .NET 6+ packages support back to API-21 -->
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>

<!-- Mark .NET6+ packages as supporting trimming -->
<IsTrimmable>true</IsTrimmable>

<!-- Assemblies should be deterministic -->
<Deterministic>true</Deterministic>

Expand All @@ -35,6 +32,38 @@
<!-- NU5104: A stable release of a package should not have a prerelease dependency. -->
<WarningsAsErrors>$(WarningsAsErrors);NU5104</WarningsAsErrors>

<!-- Ignore binding generator warnings by default -->
<_AndroidIgnoreGeneratorWarnings>true</_AndroidIgnoreGeneratorWarnings>

<!--
BG8102: Class 'foo' has unknown base type 'foo'.
BG8103: Class 'foo' has invalid base type 'foo'.
BG8300: For constructor 'foo', could not find enclosing type 'foo'.
BG8400: Unexpected field type `foo` (foo).
BG8401: Skipping 'foo' due to a duplicate nested type name. (Java type: 'foo')
BG8402: Skipping 'foo' due to a duplicate field. (Java type: 'foo')
BG8403: Type 'foo' has a type name which matches the enclosing namespace name. See https://aka.ms/BG8403 for more information.
BG8501: No event name provided in 'foo'.
BG8502: Invalidating 'IFoo' and all its nested types because some of its interfaces were invalid.
BG8503: Invalidating 'IFoo' and all its nested types because some of its methods were invalid.
BG8504: Event name for 'foo' is invalid. A valid 'eventName' or 'argsType' can be assigned by adding a rule to the Metadata.xml transforms file.
BG8601: No '<package>' elements found.
BG8604: Could not find top ancestor type 'foo' for nested type 'foo'.
BG8605: The Java type 'foo' could not be found (are you missing a Java reference jar/aar or a Java binding library NuGet?)
BG8606: Some types or members could not be bound because referenced Java types could not be found. See the 'java-resolution-report.log' file for details.
BG8700: Unknown return type 'foo' for member 'foo'.
BG8701: Invalid return type 'foo' for member 'foo'.
BG8800: Unknown parameter type 'foo' for member 'foo (foo)'.
BG8801: Invalid parameter type 'foo' for member 'foo'.
BG8A00: Metadata.xml element '<foo>' matched no nodes.
BG8A01: Metadata.xml element '<add-node path="foo" />' matched no nodes.
BG8A04: Metadata.xml element '<attr path="foo" />' matched no nodes.
BG8B00: Unknown generic argument constraint type 'S' for member 'foo'.
BG8C00: Could not find base interface 'foo' for type 'foo'.
BG8C01: For type 'IFoo', base interface 'foo' is invalid.
-->
<NoWarn Condition=" '$(_AndroidIgnoreGeneratorWarnings)' == 'true' ">$(NoWarn);BG8102;BG8103;BG8300;BG8400;BG8401;BG8402;BG8403;BG8501;BG8502;BG8503;BG8504;BG8601;BG8604;BG8605;BG8606;BG8700;BG8701;BG8800;BG8801;BG8A00;BG8A01;BG8A04;BG8B00;BG8C00;BG8C01;nullable</NoWarn>

<!-- Common package metadata -->
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@
<_ProjectReferencesWithVersions Include="@(_ProjectReferenceWithReassignedVersion)" />
</ItemGroup>
</Target>

<PropertyGroup>
<!-- Mark .NET6+ packages as supporting trimming -->
<IsTrimmable Condition=" $([MSBuild]::VersionGreaterThanOrEquals('$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))', '6.0')) ">true</IsTrimmable>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion source/AndroidXProject.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- CS1572: XML comment has a param tag for '', but there is no parameter by that name
- XAOBS001: While this member is 'public', Google considers it internal API and reserves the right to modify or delete it in the future. Use at your own risk.
-->
<NoWarn>0618;0109;0114;0628;0108;0809;1572;XAOBS001</NoWarn>
<NoWarn>$(NoWarn);0618;0109;0114;0628;0108;0809;1572;XAOBS001</NoWarn>

@if (Model.AllowPrereleaseDependencies) {
<!-- Allow this package to have prerelease dependencies -->
Expand Down