Skip to content

Commit 1c14614

Browse files
[xabt] remove Xamarin.Android.Bindings.targets and $(_AndroidIsBindingProject) (#10337)
Fixes: #10336 This PR removes the classic `Xamarin.Android.Bindings.targets` file and all usage of the private `$(_AndroidIsBindingProject)` MSBuild property, as these are only relevant for classic Xamarin.Android binding projects and are not used in .NET 6+ projects. ## Changes Made ### Removed Legacy Files - **Deleted `Xamarin.Android.Bindings.targets`** (172 lines) - This file was the entry point for legacy binding projects and is not imported by .NET 6+ projects - **Removed reference** to the targets file from `Xamarin.Android.Build.Tasks.targets` ### Inlined `$(_AndroidIsBindingProject)` Logic Since `$(_AndroidIsBindingProject)` can never be true in .NET 6+, the logic has been simplified by: - **Removing conditions that check `== 'True'`** - These blocks would never run - **Removing conditions that check `!= 'True'`** - These blocks would always run, so the condition was removed - **Keeping the logic that runs when the property is false/empty** Co-authored-by: Jonathan Peppers <[email protected]>
1 parent 209d846 commit 1c14614

File tree

6 files changed

+5
-188
lines changed

6 files changed

+5
-188
lines changed

src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.AvailableItems.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This item group populates the Build Action drop-down in IDEs.
1010
<Project>
1111

1212
<!-- Not legacy binding projects -->
13-
<ItemGroup Condition=" '$(_AndroidIsBindingProject)' != 'true' ">
13+
<ItemGroup>
1414
<AvailableItemName Include="AndroidAotProfile" />
1515
<AvailableItemName Include="AndroidAsset" />
1616
<AvailableItemName Include="AndroidEnvironment" />

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

Lines changed: 0 additions & 172 deletions
This file was deleted.

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@
9191
<None Include="Xamarin.Android.Application.targets">
9292
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
9393
</None>
94-
<None Include="Xamarin.Android.Bindings.targets">
95-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
96-
</None>
9794
<None Include="Xamarin.Android.Common.props">
9895
<SubType>Designer</SubType>
9996
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/Xamarin.Android.Build.Tasks/Xamarin.Android.DesignTime.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This file is used by all project types, including binding projects.
5050
<_AndroidResgenFlagFile Condition=" '$(DesignTimeBuild)' == 'true' And !Exists('$(_AndroidResgenFlagFile)') ">$(_AndroidIntermediateDesignTimeBuildDirectory)R.cs.flag</_AndroidResgenFlagFile>
5151
</PropertyGroup>
5252
<MakeDir
53-
Condition=" '$(_AndroidIsBindingProject)' != 'true' And !Exists ('$(_AndroidIntermediateDesignTimeBuildDirectory)') "
53+
Condition=" !Exists ('$(_AndroidIntermediateDesignTimeBuildDirectory)') "
5454
Directories="$(_AndroidIntermediateDesignTimeBuildDirectory)"
5555
/>
5656
<MakeDir

src/Xamarin.Android.Build.Tasks/Xamarin.Android.EmbeddedResource.targets

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ This file is used by all project types, including binding projects.
8787
</Target>
8888

8989
<PropertyGroup>
90-
<_GetLibraryImportsDependsOnTargets Condition=" '$(_AndroidIsBindingProject)' == 'true' ">
91-
_ExtractLibraryProjectImports;
92-
_BuildLibraryImportsCache;
93-
</_GetLibraryImportsDependsOnTargets>
94-
<_GetLibraryImportsDependsOnTargets Condition=" '$(_AndroidIsBindingProject)' != 'true' ">
90+
<_GetLibraryImportsDependsOnTargets>
9591
_ExtractLibraryProjectImports;
9692
_AddMultiDexDependencyJars;
9793
_BuildLibraryImportsCache;

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ projects.
1717
<UsingTask TaskName="Xamarin.Android.Tasks.ResolveJdkJvmPath" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
1818

1919
<PropertyGroup>
20-
<_SetLatestTargetFrameworkVersionDependsOnTargets Condition=" '$(_AndroidIsBindingProject)' == 'True'">
21-
_ResolveSdks;
22-
_ResolveAndroidTooling;
23-
</_SetLatestTargetFrameworkVersionDependsOnTargets>
24-
<_SetLatestTargetFrameworkVersionDependsOnTargets Condition=" '$(_AndroidIsBindingProject)' != 'True'">
20+
<_SetLatestTargetFrameworkVersionDependsOnTargets>
2521
_ResolveSdks;
2622
_ResolveAndroidTooling;
2723
_InjectAaptDependencies;
@@ -83,7 +79,7 @@ projects.
8379
JavaSdkPath="$(_JavaSdkDirectory)"
8480
MinimumSupportedJavaVersion="$(MinimumSupportedJavaVersion)"
8581
LatestSupportedJavaVersion="$(LatestSupportedJavaVersion)"
86-
Condition=" '$(DesignTimeBuild)' != 'True' And '$(_AndroidIsBindingProject)' != 'True' And '$(AndroidGenerateJniMarshalMethods)' == 'True' And '$(JdkJvmPath)' == '' ">
82+
Condition=" '$(DesignTimeBuild)' != 'True' And '$(AndroidGenerateJniMarshalMethods)' == 'True' And '$(JdkJvmPath)' == '' ">
8783
<Output TaskParameter="JdkJvmPath" PropertyName="JdkJvmPath" />
8884
</ResolveJdkJvmPath>
8985
</Target>

0 commit comments

Comments
 (0)