Skip to content

Commit b5a211d

Browse files
authored
Merge branch 'main' into dev/jpobst/link-step-typemaps
2 parents ba85244 + f2eea99 commit b5a211d

File tree

63 files changed

+1270
-755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1270
-755
lines changed

.github/dependabot.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ updates:
1515
interval: "daily"
1616
ignore:
1717
- dependency-name: "external/constexpr-xxh3"
18-
- dependency-name: "external/debugger-libs"
1918
- dependency-name: "external/lz4"
2019
- dependency-name: "external/robin-map"
2120
- dependency-name: "external/xxHash"

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ Novell
3131
*.patch
3232
*.keystore
3333
/omnisharp.json
34+
src/native/CMakePresets.json
35+
src/native/clr/host/generate-pinvoke-tables
36+
src/native/clr/host/pinvoke-tables.include.generated
37+
src/native/mono/pinvoke-override/generate-pinvoke-tables
38+
src/native/mono/pinvoke-override/pinvoke-tables.include.generated
39+
dotnet-install.ps1

Configuration.props

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
<TestsFlavor>$(_TestsProfiledAotName)$(_TestsAotName)</TestsFlavor>
133133
</PropertyGroup>
134134
<PropertyGroup>
135+
<!-- Default to Java 17 for desktop, projects targeting Android should use 1.8 -->
135136
<JavacSourceVersion>17</JavacSourceVersion>
136137
<JavacTargetVersion>17</JavacTargetVersion>
137138
</PropertyGroup>

Directory.Build.props

-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
6565
This can be opted into locally with $(_AndroidTreatWarningsAsErrors) = true.
6666
-->
67-
<_AllowProjectWarnings Condition=" '$(MSBuildProjectFile)' == 'assembly-store-reader.csproj' ">true</_AllowProjectWarnings>
68-
<_AllowProjectWarnings Condition=" '$(MSBuildProjectFile)' == 'decompress-assemblies.csproj' ">true</_AllowProjectWarnings>
6967
<_AllowProjectWarnings Condition=" '$(MSBuildProjectFile)' == 'jnienv-gen.csproj' ">true</_AllowProjectWarnings>
7068
<_AllowProjectWarnings Condition=" '$(MSBuildProjectFile)' == 'Microsoft.Android.Sdk.ILLink.csproj' ">true</_AllowProjectWarnings>
7169
<_AllowProjectWarnings Condition=" '$(MSBuildProjectFile)' == 'Microsoft.Android.Templates.csproj' ">true</_AllowProjectWarnings>

NuGet.config

+5-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
<!-- This is needed (currently) for the Xamarin.Android.Deploy.Installer dependency, getting the installer -->
1919
<!-- Android binary, to support delta APK install -->
2020
<add key="xamarin.android util" value="https://pkgs.dev.azure.com/xamarin/public/_packaging/Xamarin.Android/nuget/v3/index.json" />
21-
<!-- Added manually for dotnet/runtime 8.0.11 -->
22-
<add key="darc-pub-dotnet-emsdk-91b783e" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-91b783ed/nuget/v3/index.json" />
23-
<add key="darc-pub-dotnet-runtime-ef07c4f" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-ef07c4f2/nuget/v3/index.json" />
21+
<!-- Added manually for dotnet/runtime 9.0.5 -->
22+
<add key="darc-pub-dotnet-emsdk-3cddc1f" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3cddc1fe/nuget/v3/index.json" />
23+
<add key="darc-pub-dotnet-runtime-207cda3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-207cda34/nuget/v3/index.json" />
24+
<!-- Added manually for dotnet/runtime 8.0.16 -->
25+
<add key="darc-pub-dotnet-runtime-6cd8ef8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-6cd8ef87/nuget/v3/index.json" />
2426
</packageSources>
2527
<disabledPackageSources />
2628
</configuration>

build-tools/automation/yaml-templates/fail-on-dirty-tree.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ steps:
99
# Run this to log the output for the user
1010
git status
1111
12-
# Run this to error the build if untracked files
13-
$process= git status --porcelain --untracked-files=no
12+
# Run this to error the build if modified/untracked files exist
13+
$process= git status --porcelain
1414
1515
if ($process)
1616
{
17-
Write-Host "##vso[task.logissue type=error]git tree has modified tracked files."
17+
Write-Host "##vso[task.logissue type=error]git tree has modified or untracked files."
1818
Write-Host "##vso[task.complete result=Failed;]"
1919
}
20-
displayName: Ensure no modified committed files
20+
displayName: Ensure no modified/untracked files
2121
workingDirectory: ${{ parameters.xaSourcePath }}
2222
condition: ${{ parameters.condition }}

build-tools/automation/yaml-templates/stage-package-tests.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ stages:
198198
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
199199
artifactFolder: $(DotNetTargetFramework)-AotLlvm
200200

201+
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
202+
parameters:
203+
configuration: $(XA.Build.Configuration)
204+
testName: Mono.Android.NET_Tests-CoreCLR
205+
project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj
206+
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)CoreCLR.xml
207+
extraBuildArgs: -p:TestsFlavor=CoreCLR -p:UseMonoRuntime=false -p:AndroidEnableMarshalMethods=false
208+
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
209+
artifactFolder: $(DotNetTargetFramework)-CoreCLR
210+
201211
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml
202212
parameters:
203213
configuration: $(XA.Build.Configuration)

build-tools/create-packs/ConfigureLocalWorkload.targets

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616
<_RuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.%(AndroidAbiAndRuntimeFlavor.AndroidRuntime).$(AndroidDefaultTargetDotnetApiLevel).%(AndroidAbiAndRuntimeFlavor.AndroidRID)\$(AndroidPackVersion)\data\RuntimeList.xml" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" />
1717
<_RuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.%(AndroidAbiAndRuntimeFlavor.AndroidRuntime).$(AndroidLatestStableApiLevel).%(AndroidAbiAndRuntimeFlavor.AndroidRID)\$(AndroidPackVersion)\data\RuntimeList.xml" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" />
1818
<_RuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.%(AndroidAbiAndRuntimeFlavor.AndroidRuntime).$(AndroidLatestUnstableApiLevel).%(AndroidAbiAndRuntimeFlavor.AndroidRID)\$(AndroidPackVersion)\data\RuntimeList.xml" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" />
19+
<_ManagedRuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.$(AndroidApiLevel).android\$(AndroidPackVersion)\data\RuntimeList.xml" />
1920
</ItemGroup>
2021
</Target>
2122

2223
<Target Name="CreateLocalRuntimeLists"
2324
DependsOnTargets="_CreateLocalRuntimeListsInputs"
2425
Inputs="$(MSBuildAllProjects);@(_RuntimeListInputs)"
25-
Outputs="@(_RuntimeListOutputs)">
26+
Outputs="@(_RuntimeListOutputs);@(_ManagedRuntimeListOutputs)">
2627
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build -t:_GenerateFrameworkList -p:IntermediateOutputPath=%(_RuntimeListOutputs.RelativeDir) -p:AndroidRID=%(_RuntimeListOutputs.AndroidRID) -p:AndroidRuntime=%(_RuntimeListOutputs.AndroidRuntime) -p:Configuration=$(Configuration) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
28+
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build -t:_GenerateFrameworkList -p:IntermediateOutputPath=%(_ManagedRuntimeListOutputs.RelativeDir) -p:Configuration=$(Configuration) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.Managed.proj&quot;" />
2729
</Target>
2830

2931
<Target Name="CreateLocalFrameworkLists"

build-tools/create-packs/Directory.Build.targets

+3
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@
4545
DependsOnTargets="_CreateItemGroups"
4646
Condition=" '$(AndroidLatestStableApiLevel)' != '$(AndroidLatestUnstableApiLevel)' and Exists('$(_MonoAndroidNETOutputRoot)$(AndroidLatestUnstableApiLevel)\Mono.Android.dll') ">
4747
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Runtime.%(_AndroidRIDs.Runtime).$(AndroidLatestUnstableApiLevel).%(_AndroidRIDs.Identity).binlog&quot; -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) -p:AndroidRID=%(_AndroidRIDs.Identity) -p:AndroidRuntime=%(_AndroidRIDs.Runtime) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
48+
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Runtime.Managed.$(AndroidLatestUnstableApiLevel).binlog&quot; -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.Managed.proj&quot;" />
4849
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Ref.$(AndroidLatestUnstableApiLevel).binlog&quot; -p:AndroidApiLevel=$(AndroidLatestUnstableApiLevel) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Ref.proj&quot;" />
50+
4951
</Target>
5052

5153
<Target Name="CreateAllPacks"
5254
DependsOnTargets="DeleteExtractedWorkloadPacks;_SetGlobalProperties;GetXAVersionInfo;_CleanNuGetDirectory;_CreateItemGroups;_CreatePreviewPacks;_CreateDefaultRefPack">
5355
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Runtime.%(_AndroidRIDs.Runtime).$(AndroidLatestStableApiLevel).%(_AndroidRIDs.Identity).binlog&quot; -p:AndroidRID=%(_AndroidRIDs.Identity) -p:AndroidRuntime=%(_AndroidRIDs.Runtime) &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.proj&quot;" />
56+
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Runtime.Managed.$(AndroidLatestUnstableApiLevel).binlog&quot; &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Runtime.Managed.proj&quot;" />
5457
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Ref.$(AndroidLatestStableApiLevel).binlog&quot; &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Ref.proj&quot;" />
5558
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Sdk.Linux.binlog&quot; -p:HostOS=Linux &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Sdk.proj&quot;" Condition=" '$(HostOS)' == 'Linux' " />
5659
<Exec Command="&quot;$(DotNetPreviewTool)&quot; build @(_GlobalProperties, ' ') &quot;$(_BinlogPrefix)Microsoft.Android.Sdk.Darwin.binlog&quot; -p:HostOS=Darwin &quot;$(MSBuildThisFileDirectory)Microsoft.Android.Sdk.proj&quot;" Condition=" '$(HostOS)' == 'Darwin' " />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<!--
2+
***********************************************************************************************
3+
Microsoft.Android.Runtime.Managed.proj
4+
5+
This project file is used to create Microsoft.Android.Runtime.[API].android NuGets, which are
6+
runtime packs that contain RID agnostic assets required for a self-contained publish of
7+
projects that use the Microsoft.Android framework in .NET 6+.
8+
***********************************************************************************************
9+
-->
10+
<Project Sdk="Microsoft.Build.NoTargets">
11+
12+
<Sdk Name="Microsoft.DotNet.SharedFramework.Sdk" Version="$(MicrosoftDotNetBuildTasksFeedPackageVersion)" />
13+
14+
<PropertyGroup>
15+
<TargetFramework>netstandard2.0</TargetFramework>
16+
<AndroidRID>android</AndroidRID>
17+
<RuntimeIdentifier>$(AndroidRID)</RuntimeIdentifier>
18+
<PackageId>Microsoft.Android.Runtime.$(AndroidApiLevel).$(AndroidRID)</PackageId>
19+
<OverridePackageId>$(PackageId)</OverridePackageId>
20+
<PlatformPackageType>RuntimePack</PlatformPackageType>
21+
<Description>Microsoft.Android managed runtime components for API $(AndroidApiLevel). Please do not reference directly.</Description>
22+
<_AndroidRuntimePackAssemblyPath>runtimes/$(AndroidRID)/lib/$(DotNetTargetFramework)</_AndroidRuntimePackAssemblyPath>
23+
<_AndroidRuntimePackNativePath>runtimes/$(AndroidRID)/native</_AndroidRuntimePackNativePath>
24+
</PropertyGroup>
25+
26+
<PropertyGroup>
27+
<BeforePack>
28+
_GetDefaultPackageVersion;
29+
$(BeforePack);
30+
</BeforePack>
31+
</PropertyGroup>
32+
33+
<!-- Reset the TargetFramework after ProcessFrameworkReferences runs to avoid issues resolving non-existant linux-bionic runtime packs -->
34+
<Target Name="_RemoveLinuxFrameworkReferences"
35+
AfterTargets="ProcessFrameworkReferences">
36+
<PropertyGroup>
37+
<TargetFramework>$(DotNetTargetFramework)</TargetFramework>
38+
</PropertyGroup>
39+
</Target>
40+
41+
<Target Name="_GetRuntimePackItems"
42+
DependsOnTargets="_GetLicense;_GetDefaultPackageVersion"
43+
BeforeTargets="GetFilesToPackage" >
44+
<ItemGroup>
45+
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Java.Interop.dll" />
46+
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.dll" />
47+
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.Runtime.dll" />
48+
<!-- Always include stable versions of the following assemblies -->
49+
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Mono.Android.Export.dll" />
50+
<_AndroidRuntimePackAssemblies
51+
Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\System.IO.Hashing.dll"
52+
NoSymbols="true"
53+
/>
54+
</ItemGroup>
55+
56+
<ItemGroup>
57+
<FrameworkListFileClass Include="@(_AndroidRuntimePackAssemblies->'%(Filename)%(Extension)')" Profile="Android" />
58+
<FilesToPackage Include="@(_AndroidRuntimePackAssemblies)" />
59+
<FilesToPackage Include="@(_AndroidRuntimePackAssemblies->'%(RelativeDir)%(Filename).pdb')" IsSymbolFile="true" Condition=" '%(_AndroidRuntimePackAssemblies.NoSymbols)' != 'true' " />
60+
</ItemGroup>
61+
</Target>
62+
63+
</Project>

build-tools/create-packs/Microsoft.Android.Runtime.proj

+7-17
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Microsoft.Android.Runtime.proj
44
55
This project file is used to create Microsoft.Android.Runtime.[Mono|NativeAOT|etc.].[API].[RID] NuGets, which are
66
runtime packs that contain the assets required for a self-contained publish of
7-
projects that use the Microsoft.Android framework in .NET 6+.
7+
projects that use the Microsoft.Android.Runtimes framework in .NET 6+.
88
***********************************************************************************************
99
-->
1010
<Project Sdk="Microsoft.Build.NoTargets">
@@ -19,6 +19,8 @@ projects that use the Microsoft.Android framework in .NET 6+.
1919
<PackageId>Microsoft.Android.Runtime.$(AndroidRuntime).$(AndroidApiLevel).$(AndroidRID)</PackageId>
2020
<OverridePackageId>$(PackageId)</OverridePackageId>
2121
<PlatformPackageType>RuntimePack</PlatformPackageType>
22+
<SharedFrameworkName>Microsoft.Android.Runtimes</SharedFrameworkName>
23+
<SharedFrameworkFriendlyName>.NET $(DotNetTargetFrameworkVersion) - $(SharedFrameworkName)</SharedFrameworkFriendlyName>
2224
<Description>Microsoft.Android runtime components for API $(AndroidApiLevel). Please do not reference directly.</Description>
2325
<_AndroidRuntimePackAssemblyPath>runtimes/$(AndroidRID)/lib/$(DotNetTargetFramework)</_AndroidRuntimePackAssemblyPath>
2426
<_AndroidRuntimePackNativePath>runtimes/$(AndroidRID)/native</_AndroidRuntimePackNativePath>
@@ -47,22 +49,6 @@ projects that use the Microsoft.Android framework in .NET 6+.
4749
<_RuntimeFlavorDirName Condition=" '$(AndroidRuntime)' == 'Mono' Or '$(AndroidRuntime)' == '' ">mono</_RuntimeFlavorDirName>
4850
</PropertyGroup>
4951

50-
<ItemGroup>
51-
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Java.Interop.dll" />
52-
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.dll" />
53-
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.Runtime.dll" />
54-
<!-- Always include stable versions of the following assemblies -->
55-
<_AndroidRuntimePackAssemblies
56-
Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Microsoft.Android.Runtime.NativeAOT.dll"
57-
Condition=" '$(AndroidRuntime)' == 'NativeAOT' "
58-
/>
59-
<_AndroidRuntimePackAssemblies
60-
Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\System.IO.Hashing.dll"
61-
NoSymbols="true"
62-
/>
63-
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Mono.Android.Export.dll" />
64-
</ItemGroup>
65-
6652
<ItemGroup Condition=" '$(AndroidRuntime)' == 'CoreCLR' ">
6753
<NativeRuntimeAsset Condition=" Exists('$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnet-android.debug.so') " Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnet-android.debug.so" />
6854
<NativeRuntimeAsset Condition=" Exists('$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnet-android.release.so') " Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libnet-android.release.so" />
@@ -86,6 +72,10 @@ projects that use the Microsoft.Android framework in .NET 6+.
8672
<NativeRuntimeAsset Condition=" Exists('$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libarchive-dso-stub.so') " Include="$(NativeRuntimeOutputRootDir)$(_RuntimeFlavorDirName)\$(AndroidRID)\libarchive-dso-stub.so" />
8773
</ItemGroup>
8874

75+
<ItemGroup Condition=" '$(AndroidRuntime)' == 'NativeAOT' ">
76+
<_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Microsoft.Android.Runtime.NativeAOT.dll" />
77+
</ItemGroup>
78+
8979
<ItemGroup>
9080
<FrameworkListFileClass Include="@(_AndroidRuntimePackAssemblies->'%(Filename)%(Extension)')" Profile="Android" />
9181
<FrameworkListFileClass Include="@(NativeRuntimeAsset->'%(Filename)%(Extension)')" Profile="Android" />

0 commit comments

Comments
 (0)