Skip to content

Commit

Permalink
Ensure marshal-ilgen is included. (dotnet#89564)
Browse files Browse the repository at this point in the history
  • Loading branch information
jandupej authored Jul 28, 2023
1 parent 512d657 commit 862cf1a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mono/msbuild/android/build/AndroidBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@
<_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'">
Expand Down
10 changes: 10 additions & 0 deletions src/mono/sample/Android/AndroidSampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
<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>
Expand Down

0 comments on commit 862cf1a

Please sign in to comment.