Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tasks] Add $(_BindingsToolsLocation) to allow …
Browse files Browse the repository at this point in the history
…overriding binding tool binaries.
  • Loading branch information
jpobst committed May 25, 2023
1 parent fb7fdd9 commit bc5edf2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ This file is only used by binding projects.
Inputs="@(EmbeddedJar);@(EmbeddedReferenceJar);@(InputJar);@(ReferenceJar);@(_AndroidMSBuildAllProjects)"
Outputs="$(ApiOutputFile)">

<PropertyGroup>
<!-- Allow $(_BindingsToolsLocation) to override where to find class-parse/generator -->
<_BindingsToolsLocation Condition=" '$(_BindingsToolsLocation)' == '' ">$(MonoAndroidToolsDirectory)</_BindingsToolsLocation>
<_BindingsToolsLocation Condition=" '$(UsingAndroidNETSdk)' != 'true' ">$(MonoAndroidToolsDirectory)</_BindingsToolsLocation>
</PropertyGroup>

<ItemGroup>
<_AndroidDocumentationPath Include="@(_JavaSourceJavadocXml)" />
<_AndroidDocumentationPath Include="@(JavaDocIndex->'%(RootDir)\%(Directory)')" />
Expand All @@ -32,7 +38,7 @@ This file is only used by binding projects.
SourceJars="@(EmbeddedJar);@(InputJar)"
DocumentationPaths="@(_AndroidDocumentationPath)"
NetCoreRoot="$(NetCoreRoot)"
ToolPath="$(MonoAndroidToolsDirectory)"
ToolPath="$(_BindingsToolsLocation)"
ToolExe="$(ClassParseToolExe)"
/>
<BindingsGenerator
Expand All @@ -44,7 +50,7 @@ This file is only used by binding projects.
ReferencedManagedLibraries="@(ReferencePath);@(ReferenceDependencyPaths)"
MonoAndroidFrameworkDirectories="$(_XATargetFrameworkDirectories)"
NetCoreRoot="$(NetCoreRoot)"
ToolPath="$(MonoAndroidToolsDirectory)"
ToolPath="$(_BindingsToolsLocation)"
ToolExe="$(BindingsGeneratorToolExe)"
Nullable="$(Nullable)"
UseJavaLegacyResolver="$(_AndroidUseJavaLegacyResolver)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ It is shared between "legacy" binding projects and .NET 5 projects.
Inputs="$(ApiOutputFile);@(TransformFile);@(ReferencePath);@(ReferenceDependencyPaths);@(_AndroidMSBuildAllProjects)"
Outputs="$(_GeneratorStampFile)">

<PropertyGroup>
<!-- Allow $(_BindingsToolsLocation) to override where to find class-parse/generator -->
<_BindingsToolsLocation Condition=" '$(_BindingsToolsLocation)' == '' ">$(MonoAndroidToolsDirectory)</_BindingsToolsLocation>
<_BindingsToolsLocation Condition=" '$(UsingAndroidNETSdk)' != 'true' ">$(MonoAndroidToolsDirectory)</_BindingsToolsLocation>
</PropertyGroup>

<!-- Delete previous generated files if they still exist -->
<RemoveDirFixed Directories="$(GeneratedOutputPath)" Condition="Exists ('$(GeneratedOutputPath)')" />

Expand Down Expand Up @@ -87,7 +93,7 @@ It is shared between "legacy" binding projects and .NET 5 projects.
MonoAndroidFrameworkDirectories="$(_XATargetFrameworkDirectories)"
TypeMappingReportFile="$(GeneratedOutputPath)type-mapping.txt"
NetCoreRoot="$(NetCoreRoot)"
ToolPath="$(MonoAndroidToolsDirectory)"
ToolPath="$(_BindingsToolsLocation)"
ToolExe="$(BindingsGeneratorToolExe)"
LangVersion="$(LangVersion)"
EnableBindingStaticAndDefaultInterfaceMethods="$(AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods)"
Expand Down

0 comments on commit bc5edf2

Please sign in to comment.