Skip to content

[Xamarin.Android.Build.Tasks] introduce $(_AndroidJcwCodegenTarget) #9858

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

Merged
merged 2 commits into from
Feb 28, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
<!-- Bindings properties -->
<!-- jar2xml is not supported -->
<AndroidClassParser>class-parse</AndroidClassParser>
<AndroidCodegenTarget Condition=" '$(AndroidCodegenTarget)' == '' and '$(_AndroidRuntime)' != 'NativeAOT' ">XAJavaInterop1</AndroidCodegenTarget>
<AndroidCodegenTarget Condition=" '$(AndroidCodegenTarget)' == '' ">XAJavaInterop1</AndroidCodegenTarget>
<_AndroidJcwCodegenTarget Condition=" '$(_AndroidJcwCodegenTarget)' == '' and '$(_AndroidRuntime)' != 'NativeAOT' ">XAJavaInterop1</_AndroidJcwCodegenTarget>
<AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods Condition=" '$(AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods)' == '' ">true</AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods>
<AndroidBoundInterfacesContainTypes Condition=" '$(AndroidBoundInterfacesContainTypes)' == '' ">true</AndroidBoundInterfacesContainTypes>
<AndroidBoundInterfacesContainConstants Condition=" '$(AndroidBoundInterfacesContainConstants)' == '' ">true</AndroidBoundInterfacesContainConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android.
<!-- Default property values for NativeAOT -->
<PropertyGroup>
<_AndroidRuntimePackRuntime>NativeAOT</_AndroidRuntimePackRuntime>
<AndroidCodegenTarget Condition=" '$(AndroidCodegenTarget)' == '' ">JavaInterop1</AndroidCodegenTarget>
<_AndroidJcwCodegenTarget Condition=" '$(_AndroidJcwCodegenTarget)' == '' ">JavaInterop1</_AndroidJcwCodegenTarget>
<!-- .NET SDK gives: error NETSDK1191: A runtime identifier for the property 'PublishAot' couldn't be inferred. Specify a rid explicitly. -->
<AllowPublishAotWithoutRuntimeIdentifier Condition=" '$(AllowPublishAotWithoutRuntimeIdentifier)' == '' ">true</AllowPublishAotWithoutRuntimeIdentifier>
<!-- NativeAOT's targets currently gives an error about cross-compilation -->
Expand Down
12 changes: 6 additions & 6 deletions src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ because xbuild doesn't support framework reference assemblies.
<_AndroidJarAndDexDirectory>$(_XATargetFrameworkDirectories)</_AndroidJarAndDexDirectory>
</PropertyGroup>
<GetMonoPlatformJar
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(AndroidCodegenTarget)' == 'XAJavaInterop1' "
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(_AndroidJcwCodegenTarget)' == 'XAJavaInterop1' "
TargetFrameworkDirectory="$(_AndroidJarAndDexDirectory)">
<Output TaskParameter="MonoPlatformJarPath" PropertyName="MonoPlatformJarPath" />
<Output TaskParameter="MonoPlatformDexPath" PropertyName="MonoPlatformDexPath" />
Expand Down Expand Up @@ -1404,12 +1404,12 @@ because xbuild doesn't support framework reference assemblies.
/>

<Copy
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(AndroidCodegenTarget)' == 'XAJavaInterop1' "
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(_AndroidJcwCodegenTarget)' == 'XAJavaInterop1' "
SourceFiles="$(MonoPlatformJarPath)"
DestinationFiles="$(IntermediateOutputPath)android\bin\mono.android.jar"
SkipUnchangedFiles="true" />
<Touch
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(AndroidCodegenTarget)' == 'XAJavaInterop1' "
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(_AndroidJcwCodegenTarget)' == 'XAJavaInterop1' "
Files="$(IntermediateOutputPath)android\bin\mono.android.jar" />

<Touch Files="$(_AndroidStaticResourcesFlag)" AlwaysCreate="true" />
Expand All @@ -1419,7 +1419,7 @@ because xbuild doesn't support framework reference assemblies.
<FileWrites Include="$(_AndroidIntermediateJavaSourceDirectory)mono\JavaInteropTypeManager.java" />
<FileWrites Include="$(MonoAndroidIntermediateAssemblyDir)machine.config" />
<FileWrites
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(AndroidCodegenTarget)' == 'XAJavaInterop1' "
Condition=" '$(_AndroidUseMarshalMethods)' != 'True' and '$(_AndroidJcwCodegenTarget)' == 'XAJavaInterop1' "
Include="$(IntermediateOutputPath)android\bin\mono.android.jar"
/>
<FileWrites Include="$(_AndroidStaticResourcesFlag)" />
Expand Down Expand Up @@ -1516,7 +1516,7 @@ because xbuild doesn't support framework reference assemblies.

<GenerateJavaStubs
AndroidRuntime="$(_AndroidRuntime)"
CodeGenerationTarget="$(AndroidCodegenTarget)"
CodeGenerationTarget="$(_AndroidJcwCodegenTarget)"
ResolvedAssemblies="@(_ResolvedAssemblies)"
ResolvedUserAssemblies="@(_ResolvedUserMonoAndroidAssemblies)"
ErrorOnCustomJavaObject="$(AndroidErrorOnCustomJavaObject)"
Expand Down Expand Up @@ -1551,7 +1551,7 @@ because xbuild doesn't support framework reference assemblies.
ApplicationLabel="$(_ApplicationLabel)"
BundledWearApplicationName="$(BundledWearApplicationPackageName)"
CheckedBuild="$(_AndroidCheckedBuild)"
CodeGenerationTarget="$(AndroidCodegenTarget)"
CodeGenerationTarget="$(_AndroidJcwCodegenTarget)"
Debug="$(AndroidIncludeDebugSymbols)"
EmbedAssemblies="$(EmbedAssembliesIntoApk)"
EnableMarshalMethods="$(_AndroidUseMarshalMethods)"
Expand Down
Loading