Skip to content

Commit a110495

Browse files
committed
[Xamarin.Android.Build.Tasks] Emit warnings if using deprecated bindings fallback flags.
1 parent 3659766 commit a110495

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ It is shared between "legacy" binding projects and .NET 5 projects.
3333
<NoWarn Condition=" '$(DocumentationFile)' != '' ">$(NoWarn);CS1573;CS1591</NoWarn>
3434
</PropertyGroup>
3535

36+
<Target Name="_CheckNonIdealBindingConfigurations">
37+
<AndroidWarning Code="XA1037"
38+
ResourceName="XA1037"
39+
FormatArguments="_AndroidUseJavaLegacyResolver;10"
40+
Condition=" '$(_AndroidUseJavaLegacyResolver)' == 'true' "
41+
/>
42+
<AndroidWarning Code="XA1037"
43+
ResourceName="XA1037"
44+
FormatArguments="_AndroidEmitLegacyInterfaceInvokers;10"
45+
Condition=" '$(_AndroidEmitLegacyInterfaceInvokers)' == 'true' "
46+
/>
47+
</Target>
48+
3649
<Target Name="_SetAndroidGenerateManagedBindings"
3750
Condition=" '@(InputJar->Count())' != '0' Or '@(EmbeddedJar->Count())' != '0' Or '@(LibraryProjectZip->Count())' != '0' Or '@(_JavaBindingSource->Count())' != '0' ">
3851
<PropertyGroup>

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ properties that determine build ordering.
8282
<PropertyGroup Condition=" '$(AndroidApplication)' != 'True' ">
8383
<BuildDependsOn>
8484
_ValidateLinkMode;
85+
_CheckNonIdealBindingConfigurations;
8586
_SetupMSBuildAllProjects;
8687
_SetupDesignTimeBuildForBuild;
8788
_CategorizeAndroidLibraries;

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods Condition=" '$(AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods)' == '' ">true</AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods>
4040
<AndroidBoundInterfacesContainTypes Condition=" '$(AndroidBoundInterfacesContainTypes)' == '' ">true</AndroidBoundInterfacesContainTypes>
4141
<AndroidBoundInterfacesContainConstants Condition=" '$(AndroidBoundInterfacesContainConstants)' == '' ">true</AndroidBoundInterfacesContainConstants>
42-
<_AndroidEmitLegacyInterfaceInvokers Condition=" '$(AndroidEmitLegacyInterfaceInvokers)' == '' ">false</_AndroidEmitLegacyInterfaceInvokers>
42+
<_AndroidEmitLegacyInterfaceInvokers Condition=" '$(_AndroidEmitLegacyInterfaceInvokers)' == '' ">false</_AndroidEmitLegacyInterfaceInvokers>
4343
<AndroidEnableObsoleteOverrideInheritance Condition=" '$(AndroidEnableObsoleteOverrideInheritance)' == '' ">true</AndroidEnableObsoleteOverrideInheritance>
4444
<AndroidEnableRestrictToAttributes Condition=" '$(AndroidEnableRestrictToAttributes)' == '' ">obsolete</AndroidEnableRestrictToAttributes>
4545

src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Xamarin.Android.Build.Tasks/Properties/Resources.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,4 +996,10 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS
996996
<comment>The following are literal names and should not be translated: Maven
997997
{0} - User supplied Maven repository type</comment>
998998
</data>
999+
<data name="XA1037" xml:space="preserve">
1000+
<value>The '{0}' MSBuild property is deprecated and will be removed in .NET {1}. See https://aka.ms/net-android-deprecations for more details.</value>
1001+
<comment>The following are literal names and should not be translated: MSBuild, .NET.
1002+
{0} - The deprecated MSBuild property name
1003+
{1} - The numeric version of .NET</comment>
1004+
</data>
9991005
</root>

0 commit comments

Comments
 (0)