Ensure marshal-ilgen is included. (#89564)
authorJan Dupej <109523496+jandupej@users.noreply.github.com>
Fri, 28 Jul 2023 09:09:42 +0000 (11:09 +0200)
committerGitHub <noreply@github.com>
Fri, 28 Jul 2023 09:09:42 +0000 (11:09 +0200)
src/mono/msbuild/android/build/AndroidBuild.targets
src/mono/sample/Android/AndroidSampleApp.csproj

index 9c14539..92e8c87 100644 (file)
       <_MonoHeaderPath>$([MSBuild]::NormalizeDirectory($(MicrosoftNetCoreAppRuntimePackRidNativeDir), 'include', 'mono-2.0'))</_MonoHeaderPath>
     </PropertyGroup>
 
-    <PropertyGroup>
-      <RuntimeComponents Condition="'$(RuntimeComponents)' == ''" >marshal-ilgen</RuntimeComponents>
+    <!-- Make sure marshal-ilgen is included in the components list. -->
+    <ItemGroup Condition="'$(RuntimeComponents)' != '*'">
+      <_RuntimeComponentList Include="$(RuntimeComponents)" />
+      <_RuntimeComponentList Include="marshal-ilgen" KeepDuplicates="false"/>
+    </ItemGroup>
+
+    <PropertyGroup Condition="'$(RuntimeComponents)' != '*'">
+      <RuntimeComponents>@(_RuntimeComponentList)</RuntimeComponents>
     </PropertyGroup>
 
     <ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
index 90dbe89..c531605 100644 (file)
     <Message Importance="High" Text="Path: $(PublishDir)" />
     <Message Importance="High" Text="SourceDir: $(OutputPath)" />
 
+    <!-- Make sure marshal-ilgen is included in the components list. -->
+    <ItemGroup>
+      <_RuntimeComponentList Include="$(RuntimeComponents)" />
+      <_RuntimeComponentList Include="marshal-ilgen" KeepDuplicates="false"/>
+    </ItemGroup>
+
+    <PropertyGroup>
+      <RuntimeComponents>@(_RuntimeComponentList)</RuntimeComponents>
+    </PropertyGroup>
+
     <PropertyGroup Condition="'$(ForceAOT)' == 'true' and '$(AOTWithLibraryFiles)' == 'true'">
       <_AotOutputType>Library</_AotOutputType>
       <_AotLibraryFormat>So</_AotLibraryFormat>