Skip to content

Commit 85e4344

Browse files
authored
Merge branch 'dotnet:main' into main
2 parents fd7b3c5 + e98d20f commit 85e4344

478 files changed

Lines changed: 144625 additions & 8727 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public
215215
# Code files
216216
[*.{cs,vb}]
217217

218+
dotnet_diagnostic.CA2022.severity = error # Avoid inexact read with 'System.IO.FileStream.Read(byte[], int, int)'
218219
dotnet_diagnostic.CA2153.severity = error # Do Not Catch Corrupted State Exceptions
219220
dotnet_diagnostic.CA2301.severity = error # Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder
220221
dotnet_diagnostic.CA2302.severity = error # Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize

.external

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
xamarin/monodroid:main@e68da1e817cb5ce1b31195c3745cc1fe5c12a53c
1+
DevDiv/android-platform-support:main@52dd010acff1fa00d172609c231b7ee7b56b94a3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ apk-sizes-*.txt
2121
*.binlog
2222
*.ProjectImports.zip
2323
*~
24+
external/android-platform-support/
2425
external/monodroid/
2526
external/mono/
2627
tests/api-compatibility/reference/*/*.dll

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"bin/Test*/**/net472/*.dll",
44
],
55
"cmake.configureOnOpen": false,
6-
"dotnetCoreExplorer.searchpatterns": "bin/Test{Debug,Release}/**/net6.0/{Xamarin.Android.Build.Tests,MSBuildDeviceIntegration}.dll",
6+
"dotnetCoreExplorer.searchpatterns": "bin/Test{Debug}/**/net?.0/{Xamarin.Android.Build.Tests,MSBuildDeviceIntegration,Microsoft.Android.Sdk.Analysis.Tests}.dll",
77
}

.vscode/tasks.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,20 @@
9797
"$msCompile"
9898
]
9999
},
100+
{
101+
"label": "Build Microsoft.Android.Sdk.Analysis Tests",
102+
"type": "shell",
103+
"windows": { "command": "dotnet-local.cmd build src/Microsoft.Android.Sdk.Analysis/Tests/Microsoft.Android.Sdk.Analysis.Tests.csproj -c ${input:configuration}", },
104+
"linux": { "command": "./dotnet-local.sh build src/Microsoft.Android.Sdk.Analysis/Tests/Microsoft.Android.Sdk.Analysis.Tests.csproj -c ${input:configuration}",},
105+
"osx": { "command": "./dotnet-local.sh build src/Microsoft.Android.Sdk.Analysis/Tests/Microsoft.Android.Sdk.Analysis.Tests.csproj -c ${input:configuration}",},
106+
"group": {
107+
"kind": "build",
108+
"isDefault": true
109+
},
110+
"problemMatcher": [
111+
"$msCompile"
112+
]
113+
},
100114
{
101115
"label": "build-emulator-checkboottimes",
102116
"type": "shell",

Configuration.props

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
<DebugType Condition=" '$(DebugType)' == '' ">portable</DebugType>
4444
<Deterministic Condition=" '$(Deterministic)' == '' ">True</Deterministic>
4545
<LangVersion Condition=" '$(LangVersion)' == '' ">latest</LangVersion>
46-
<AndroidNetPreviousVersion Condition=" '$(AndroidNetPreviousVersion)' == '' ">34.0.113</AndroidNetPreviousVersion>
4746
</PropertyGroup>
4847
<PropertyGroup Condition=" '$(HostOS)' == '' ">
4948
<HostOS Condition="$([MSBuild]::IsOSPlatform('windows'))">Windows</HostOS>
@@ -64,12 +63,13 @@
6463
<_MonoAndroidNETOutputRoot>$(XAInstallPrefix)xbuild-frameworks\Microsoft.Android\</_MonoAndroidNETOutputRoot>
6564
<_MonoAndroidNETDefaultOutDir>$(_MonoAndroidNETOutputRoot)$(AndroidApiLevel)\</_MonoAndroidNETDefaultOutDir>
6665
<MicrosoftAndroidRefPackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Ref.$(AndroidApiLevel)\$(AndroidPackVersion)\ref\$(DotNetTargetFramework)\</MicrosoftAndroidRefPackDir>
67-
<MicrosoftAndroidArmPackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.$(AndroidApiLevel).android-arm\$(AndroidPackVersion)\runtimes\android-arm\</MicrosoftAndroidArmPackDir>
68-
<MicrosoftAndroidArm64PackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.$(AndroidApiLevel).android-arm64\$(AndroidPackVersion)\runtimes\android-arm64\</MicrosoftAndroidArm64PackDir>
69-
<MicrosoftAndroidx86PackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.$(AndroidApiLevel).android-x86\$(AndroidPackVersion)\runtimes\android-x86\</MicrosoftAndroidx86PackDir>
70-
<MicrosoftAndroidx64PackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.$(AndroidApiLevel).android-x64\$(AndroidPackVersion)\runtimes\android-x64\</MicrosoftAndroidx64PackDir>
66+
<MicrosoftAndroidArmPackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.Mono.$(AndroidApiLevel).android-arm\$(AndroidPackVersion)\runtimes\android-arm\</MicrosoftAndroidArmPackDir>
67+
<MicrosoftAndroidArm64PackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.Mono.$(AndroidApiLevel).android-arm64\$(AndroidPackVersion)\runtimes\android-arm64\</MicrosoftAndroidArm64PackDir>
68+
<MicrosoftAndroidx86PackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.Mono.$(AndroidApiLevel).android-x86\$(AndroidPackVersion)\runtimes\android-x86\</MicrosoftAndroidx86PackDir>
69+
<MicrosoftAndroidx64PackDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.Mono.$(AndroidApiLevel).android-x64\$(AndroidPackVersion)\runtimes\android-x64\</MicrosoftAndroidx64PackDir>
7170
<MicrosoftAndroidSdkPackDir>$(BuildOutputDirectory)lib\packs\$(MicrosoftAndroidSdkPackName)\$(AndroidPackVersion)\</MicrosoftAndroidSdkPackDir>
7271
<MicrosoftAndroidSdkOutDir>$(MicrosoftAndroidSdkPackDir)\tools\</MicrosoftAndroidSdkOutDir>
72+
<MicrosoftAndroidSdkAnalysisOutDir>$(BuildOutputDirectory)lib\packs\Microsoft.Android.Ref.$(AndroidApiLevel)\$(AndroidPackVersion)\analyzers\dotnet\cs\</MicrosoftAndroidSdkAnalysisOutDir>
7373
<MakeConcurrency Condition=" '$(MakeConcurrency)' == '' And '$(HostCpuCount)' != '' ">-j$(HostCpuCount)</MakeConcurrency>
7474
<ManagedRuntime Condition=" '$(ManagedRuntime)' == '' And '$(OS)' != 'Windows_NT' ">mono</ManagedRuntime>
7575
<ManagedRuntimeArgs Condition=" '$(ManagedRuntimeArgs)' == '' And '$(ManagedRuntime)' == 'mono' ">--debug=casts</ManagedRuntimeArgs>
@@ -81,7 +81,7 @@
8181
<AndroidSdkDirectory Condition=" '$(AndroidSdkDirectory)' == '' ">$(AndroidToolchainDirectory)\sdk</AndroidSdkDirectory>
8282
<AndroidNdkDirectory Condition=" '$(AndroidNdkDirectory)' == '' And Exists($(ANDROID_NDK_LATEST_HOME)) ">$(ANDROID_NDK_LATEST_HOME)</AndroidNdkDirectory>
8383
<AndroidNdkDirectory Condition=" '$(AndroidNdkDirectory)' == '' ">$(AndroidToolchainDirectory)\ndk</AndroidNdkDirectory>
84-
<AndroidCmakeVersion Condition=" '$(AndroidCmakeVersion)' == '' ">3.22.1</AndroidCmakeVersion>
84+
<AndroidCmakeVersion Condition=" '$(AndroidCmakeVersion)' == '' ">3.30.3</AndroidCmakeVersion>
8585
<AndroidCmakeUrlPrefix Condition=" '$(HostOS)' == 'Windows' And '$(AndroidCmakeUrlPrefix)' == '' "></AndroidCmakeUrlPrefix>
8686
<AndroidCmakeUrlPrefix Condition=" '$(HostOS)' == 'Darwin' And '$(AndroidCmakeUrlPrefix)' == '' "></AndroidCmakeUrlPrefix>
8787
<AndroidCmakeUrlPrefix Condition=" '$(HostOS)' == 'Linux' And '$(AndroidCmakeUrlPrefix)' == '' "></AndroidCmakeUrlPrefix>
@@ -135,8 +135,8 @@
135135
<TestsFlavor>$(_TestsProfiledAotName)$(_TestsAotName)</TestsFlavor>
136136
</PropertyGroup>
137137
<PropertyGroup>
138-
<JavacSourceVersion>1.8</JavacSourceVersion>
139-
<JavacTargetVersion>1.8</JavacTargetVersion>
138+
<JavacSourceVersion>17</JavacSourceVersion>
139+
<JavacTargetVersion>17</JavacTargetVersion>
140140
</PropertyGroup>
141141
<PropertyGroup>
142142
<AndroidNdkFullPath>$([System.IO.Path]::GetFullPath ('$(AndroidNdkDirectory)'))</AndroidNdkFullPath>
@@ -159,8 +159,8 @@
159159
<AvdManagerToolExe Condition=" '$(AvdManagerToolExe)' == '' and '$(HostOS)' == 'Windows' ">avdmanager.bat</AvdManagerToolExe>
160160
<AndroidToolPath Condition=" '$(AndroidToolPath)' == '' ">$(AndroidSdkFullPath)\tools</AndroidToolPath>
161161
<AndroidToolsBinPath Condition=" '$(AndroidToolsBinPath)' == '' ">$(AndroidToolPath)\bin</AndroidToolsBinPath>
162-
<CommandLineToolsFolder Condition=" '$(CommandLineToolsFolder)' == '' ">11.0</CommandLineToolsFolder>
163-
<CommandLineToolsVersion Condition=" '$(CommandLineToolsVersion)' == '' ">10406996_latest</CommandLineToolsVersion>
162+
<CommandLineToolsFolder Condition=" '$(CommandLineToolsFolder)' == '' ">12.0</CommandLineToolsFolder>
163+
<CommandLineToolsVersion Condition=" '$(CommandLineToolsVersion)' == '' ">11076708_latest</CommandLineToolsVersion>
164164
<CommandLineToolsBinPath Condition=" '$(CommandLineToolsBinPath)' == '' ">$(AndroidSdkFullPath)\cmdline-tools\$(CommandLineToolsFolder)\bin</CommandLineToolsBinPath>
165165
<!-- Version numbers and PkgVersion are found in https://dl-ssl.google.com/android/repository/repository2-3.xml -->
166166
<EmulatorVersion Condition=" '$(EmulatorVersion)' == '' ">9364964</EmulatorVersion>

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<DotNetTargetFramework>net$(DotNetTargetFrameworkVersion)</DotNetTargetFramework>
77
<DotNetAndroidTargetFramework>$(DotNetTargetFramework)-android</DotNetAndroidTargetFramework>
88
<!-- Used for bootstrap, command-line tooling, and desktop NUnit projects -->
9-
<DotNetStableTargetFramework>net8.0</DotNetStableTargetFramework>
9+
<DotNetStableTargetFramework>net9.0</DotNetStableTargetFramework>
1010
<TargetFrameworkNETStandard>netstandard2.0</TargetFrameworkNETStandard>
1111
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
1212
<BuildOutputDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\</BuildOutputDirectory>
@@ -35,10 +35,10 @@
3535
* Major/Minor match Android stable API level, such as 30.0 for API 30.
3636
* Bump first digit of the patch version for feature releases (and reset the first two digits to 0)
3737
-->
38-
<AndroidPackVersion>35.0.0</AndroidPackVersion>
39-
<AndroidPackVersionSuffix>rc.1</AndroidPackVersionSuffix>
38+
<AndroidPackVersion>35.99.0</AndroidPackVersion>
39+
<AndroidPackVersionSuffix>preview.1</AndroidPackVersionSuffix>
40+
<!-- Final value set by GetXAVersionInfo target -->
4041
<IsStableBuild>false</IsStableBuild>
41-
<IsStableBuild Condition=" '$(AndroidPackVersionSuffix)' == 'rtm' ">true</IsStableBuild>
4242
</PropertyGroup>
4343

4444
<!-- Common <PackageReference/> versions -->

Documentation/docs-mobile/TOC.yml

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
- name: .NET for Android
22
items:
3-
- name: Getting Started
3+
- name: Get started
44
items:
55
- name: Installation
66
items:
@@ -10,7 +10,7 @@
1010
href: getting-started/installation/net-android.md
1111
- name: Install dependencies
1212
href: getting-started/installation/dependencies.md
13-
- name: Building apps
13+
- name: Build apps
1414
items:
1515
- name: Build process
1616
href: building-apps/build-process.md
@@ -20,18 +20,50 @@
2020
href: building-apps/build-properties.md
2121
- name: Build items
2222
href: building-apps/build-items.md
23-
- name: Features
23+
- name: Fundamentals
2424
items:
2525
- name: Layout code behind
2626
href: features/layout-code-behind/index.md
27-
- name: Maven
27+
- name: Bind Java libraries
28+
items:
29+
- name: Overview
30+
href: binding-libs/binding-java-libs/index.md
31+
- name: Bind a Java library
32+
href: binding-libs/binding-java-libs/binding-java-library.md
33+
- name: Bind a Java library from Maven
34+
href: binding-libs/binding-java-libs/binding-java-maven-library.md
35+
- name: Migrate a Xamarin.Android bindings project
36+
href: /dotnet/maui/migration/android-binding-projects?toc=/dotnet/android/toc.json&bc=/dotnet/breadcrumb/android/toc.json
37+
- name: Customize bindings
38+
items:
39+
- name: Overview
40+
href: binding-libs/customizing-bindings/index.md
41+
- name: Customize namespaces
42+
href: binding-libs/customizing-bindings/namespace-customization.md
43+
- name: Java bindings metadata
44+
href: binding-libs/customizing-bindings/java-bindings-metadata.md
45+
- name: Create enumerations
46+
href: binding-libs/customizing-bindings/creating-enums.md
47+
- name: MSBuild reference
48+
items:
49+
- name: MSBuild bindings project properties
50+
href: binding-libs/msbuild-reference/build-properties.md
51+
- name: MSBuild bindings project items
52+
href: binding-libs/msbuild-reference/build-items.md
53+
- name: Advanced concepts
2854
items:
29-
- name: "@(AndroidMavenLibrary) build item"
30-
href: features/maven/android-maven-library.md
31-
- name: Resolving Java ependencies
32-
href: features/maven/resolving-java-dependencies.md
55+
- name: AndroidMavenLibrary reference
56+
href: binding-libs/advanced-concepts/android-maven-library.md
3357
- name: Java dependency verification
34-
href: features/maven/java-dependency-verification.md
58+
href: binding-libs/advanced-concepts/java-dependency-verification.md
59+
- name: Resolve Java dependencies
60+
href: binding-libs/advanced-concepts/resolving-java-dependencies.md
61+
- name: Distribute bindings libraries
62+
href: binding-libs/advanced-concepts/distributing.md
63+
- name: Native library interop
64+
href: binding-libs/advanced-concepts/native-library-interop.md
65+
- name: Troubleshoot bindings
66+
href: binding-libs/customizing-bindings/troubleshooting-bindings.md
3567
- name: Message reference
3668
items:
3769
- name: Overview
@@ -184,6 +216,10 @@
184216
href: messages/xa0139.md
185217
- name: XA0140
186218
href: messages/xa0140.md
219+
- name: XA0141
220+
href: messages/xa0141.md
221+
- name: XA0142
222+
href: messages/xa0142.md
187223
- name: "XA1xxx: Project related"
188224
items:
189225
- name: "XA1xxx: Project related"
@@ -236,6 +272,8 @@
236272
href: messages/xa1036.md
237273
- name: XA1037
238274
href: messages/xa1037.md
275+
- name: XA1038
276+
href: messages/xa1038.md
239277
- name: "XA2xxx: Linker"
240278
items:
241279
- name: "XA2xxx: Linker"
@@ -290,6 +328,8 @@
290328
href: messages/xa4247.md
291329
- name: XA4248
292330
href: messages/xa4248.md
331+
- name: XA4249
332+
href: messages/xa4249.md
293333
- name: XA4301
294334
href: messages/xa4301.md
295335
- name: XA4302
@@ -316,6 +356,8 @@
316356
href: messages/xa4313.md
317357
- name: XA4314
318358
href: messages/xa4314.md
359+
- name: XA4315
360+
href: messages/xa4315.md
319361
- name: "XA5xxx: GCC and toolchain"
320362
items:
321363
- name: "XA5xxx: GCC and toolchain"

Documentation/docs-mobile/features/maven/android-maven-library.md renamed to Documentation/docs-mobile/binding-libs/advanced-concepts/android-maven-library.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: AndroidMavenLibrary Build Action .NET for Android
33
description: AndroidMavenLibrary Build Action .NET for Android
4-
ms.date: 04/11/2024
4+
ms.author: jopobst
5+
ms.date: 05/11/2024
56
---
67
# AndroidMavenLibrary
78

8-
Note: This feature is only available in .NET 9+.
9-
10-
## Description
9+
> [!NOTE]
10+
> This feature is only available in .NET 9+.
1111
1212
`<AndroidMavenLibrary>` allows a Maven artifact to be specified which will automatically be downloaded and added to a .NET for Android binding project. This can be useful to simplify maintenance of .NET for Android bindings for artifacts hosted in Maven.
1313

@@ -24,7 +24,7 @@ Note: This feature is only available in .NET 9+.
2424

2525
This will do several things at build time:
2626
- Download the Java [artifact](https://central.sonatype.com/artifact/com.squareup.okhttp3/okhttp/4.9.3) with group id `com.squareup.okhttp3`, artifact id `okhttp`, and version `4.9.3` from [Maven Central](https://central.sonatype.com/) to a local cache (if not already cached).
27-
- Add the cached package to the .NET for Android bindings build as an [`<AndroidLibrary>`](../../building-apps/build-items.md#androidlibrary).
27+
- Add the cached package to the .NET for Android bindings build as an [`<AndroidLibrary>`](../msbuild-reference/build-items.md#androidlibrary).
2828
- Download the Java artifact's POM file (and any needed parent/imported POM files) to enable [Java Dependency Verification](java-dependency-verification.md). To opt out of this feature, add `VerifyDependencies="false"` to the `<AndroidMavenLibrary>` item.
2929

3030
Note that only the requested Java artifact is added to the .NET for Android bindings build. Any artifact dependencies are not added. If the requested artifact has dependencies, they must be fulfilled individually.
@@ -53,7 +53,7 @@ Supported values are `Central` (default), `Google`, or a URL to another Maven re
5353
</ItemGroup>
5454
```
5555

56-
Additionally, any attributes applied to the `<AndroidMavenLibrary>` element will be copied to the `<AndroidLibrary>` it creates internally. Thus, [attributes](https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNetEmbeddedResources.md#msbuild-item-groups) like `Bind` and `Pack` can be used to control the binding process. (Both default to `true`.)
56+
Additionally, any attributes applied to the `<AndroidMavenLibrary>` element will be copied to the `<AndroidLibrary>` it creates internally. Thus, [attributes](../msbuild-reference/build-items.md#androidlibrary) like `Bind` and `Pack` can be used to control the binding process. (Both default to `true`.)
5757

5858
```xml
5959
<ItemGroup>
12.2 KB
Loading

0 commit comments

Comments
 (0)