Skip to content

Commit b68dcc2

Browse files
committed
Merge branch 'main' into throwable-stacktrace
* main: [ci] Remove .NET branches from classic release trigger (dotnet#8218) Bump to dotnet/installer@f8bab721ae 8.0.100-rc.1.23373.1 (dotnet#8202) [Mono.Android] Fix Context.RegisterReceiver() enumification (dotnet#7735) [ci] Add MAUI integration job (dotnet#8200) [vs-workload] Set EnableSideBySideManifests=true (dotnet#8179)
2 parents 92e5db3 + 57eedfb commit b68dcc2

File tree

14 files changed

+216
-24
lines changed

14 files changed

+216
-24
lines changed

build-tools/automation/azure-pipelines-release-trigger.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ resources:
1212
trigger:
1313
stages:
1414
- post_build
15+
branches:
16+
exclude:
17+
- main
18+
- release/*
1519

1620
jobs:
1721
- job: release_trigger

build-tools/automation/azure-pipelines.yaml

Lines changed: 133 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ resources:
3030
name: xamarin/release-scripts
3131
ref: refs/heads/sign-and-notarized
3232
endpoint: xamarin
33+
- repository: maui
34+
type: github
35+
name: dotnet/maui
36+
ref: refs/heads/net8.0
37+
endpoint: xamarin
3338

3439
parameters:
3540
- name: provisionatorChannel
@@ -277,13 +282,139 @@ stages:
277282
artifactName: Test Results - MSBuild Smoke - Linux
278283

279284
- template: yaml-templates/fail-on-issue.yaml
280-
285+
281286
- template: yaml-templates/stage-msbuild-tests.yaml
282-
287+
283288
- template: yaml-templates/stage-msbuild-emulator-tests.yaml
284289
parameters:
285290
usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }}
286291

292+
- stage: maui_tests
293+
displayName: MAUI Tests
294+
dependsOn: mac_build
295+
condition: eq(variables['System.PullRequest.TargetBranch'], 'main')
296+
jobs:
297+
# Check - "Xamarin.Android (MAUI Tests MAUI Integration)"
298+
- job: maui_tests_integration
299+
displayName: MAUI Integration
300+
pool: $(1ESWindowsPool)
301+
timeoutInMinutes: 180
302+
workspace:
303+
clean: all
304+
variables:
305+
BuildVersion: $(Build.BuildId)
306+
steps:
307+
- checkout: maui
308+
clean: true
309+
submodules: recursive
310+
path: s/maui
311+
persistCredentials: true
312+
313+
- template: yaml-templates/setup-test-environment.yaml
314+
parameters:
315+
xaSourcePath: $(Build.SourcesDirectory)/xamarin-android
316+
provisionClassic: false
317+
provisionatorChannel: ${{ parameters.provisionatorChannel }}
318+
installLegacyDotNet: false
319+
restoreNUnitConsole: false
320+
updateMono: false
321+
androidSdkPlatforms: 23,24,25,26,27,28,29,30,31,32,$(DefaultTestSdkPlatforms)
322+
323+
- task: NuGetAuthenticate@0
324+
displayName: authenticate with azure artifacts
325+
inputs:
326+
forceReinstallCredentialProvider: true
327+
328+
- script: |
329+
echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_11_X64%
330+
echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_11_X64%
331+
displayName: set JI_JAVA_HOME, JAVA_HOME
332+
333+
- task: DownloadPipelineArtifact@2
334+
inputs:
335+
artifactName: $(NuGetArtifactName)
336+
downloadPath: $(Build.StagingDirectory)/android-packs
337+
338+
- pwsh: |
339+
$searchPath = Join-Path $(Build.StagingDirectory) android-packs
340+
$wlmanPack = Get-ChildItem $searchPath -Filter *Android*Manifest*.nupkg | Select-Object -First 1
341+
$dest = Join-Path $searchPath "tmp-wlman" "$($wlmanPack.BaseName)"
342+
Expand-Archive -LiteralPath $wlmanPack -DestinationPath $dest
343+
$wlmanJsonPath = Join-Path $dest "data" "WorkloadManifest.json"
344+
$json = Get-Content $wlmanJsonPath | ConvertFrom-Json -AsHashtable
345+
Write-Host "Setting variable ANDROID_PACK_VERSION = $($json["version"])"
346+
Write-Host "##vso[task.setvariable variable=ANDROID_PACK_VERSION;]$($json["version"])"
347+
displayName: Set ANDROID_PACK_VERSION
348+
349+
- pwsh: >-
350+
$(Build.SourcesDirectory)/maui/eng/scripts/update-version-props.ps1
351+
-xmlFileName "$(Build.SourcesDirectory)/maui/eng/Versions.props"
352+
-androidVersion $(ANDROID_PACK_VERSION)
353+
displayName: Update MAUI's Android dependency
354+
355+
- pwsh: ./build.ps1 --target=dotnet --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic
356+
displayName: Install .NET
357+
retryCountOnTaskFailure: 3
358+
workingDirectory: $(Build.SourcesDirectory)/maui
359+
360+
- pwsh: ./build.ps1 --target=dotnet-pack --configuration="$(XA.Build.Configuration)" --nugetsource="$(Build.StagingDirectory)\android-packs" --verbosity=diagnostic
361+
displayName: Pack .NET Maui
362+
workingDirectory: $(Build.SourcesDirectory)/maui
363+
364+
- task: DotNetCoreCLI@2
365+
displayName: Install MAUI workload packs
366+
retryCountOnTaskFailure: 3
367+
inputs:
368+
projects: $(Build.SourcesDirectory)/xamarin-android/Xamarin.Android.sln
369+
arguments: -t:InstallMaui -p:MauiUseLocalPacks=true -p:MauiWorkloadToInstall=maui -c $(XA.Build.Configuration) --no-restore -v:n -bl:$(Build.StagingDirectory)/logs/install-maui.binlog
370+
371+
- template: yaml-templates/run-dotnet-preview.yaml
372+
parameters:
373+
command: new
374+
arguments: maui -o $(Build.StagingDirectory)/MauiTestProj
375+
xaSourcePath: $(Build.SourcesDirectory)/xamarin-android
376+
displayName: Create MAUI template
377+
continueOnError: false
378+
379+
- template: yaml-templates/run-dotnet-preview.yaml
380+
parameters:
381+
project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj
382+
arguments: >-
383+
-f $(DotNetTargetFramework)-android -c Debug
384+
--configfile $(Build.SourcesDirectory)/maui/NuGet.config
385+
-bl:$(Build.StagingDirectory)/logs/MauiTestProj-Debug.binlog
386+
xaSourcePath: $(Build.SourcesDirectory)/xamarin-android
387+
displayName: Build MAUI template - Debug
388+
389+
- template: yaml-templates/run-dotnet-preview.yaml
390+
parameters:
391+
project: $(Build.StagingDirectory)/MauiTestProj/MauiTestProj.csproj
392+
arguments: >-
393+
-f $(DotNetTargetFramework)-android -c Release
394+
--configfile $(Build.SourcesDirectory)/maui/NuGet.config
395+
-bl:$(Build.StagingDirectory)/logs/MauiTestProj-Release.binlog
396+
xaSourcePath: $(Build.SourcesDirectory)/xamarin-android
397+
displayName: Build MAUI template - Release
398+
399+
- task: CopyFiles@2
400+
displayName: copy build logs
401+
condition: always()
402+
inputs:
403+
Contents: |
404+
$(Build.SourcesDirectory)/maui/artifacts/logs/**
405+
TargetFolder: $(Build.StagingDirectory)/logs
406+
flattenFolders: true
407+
408+
- template: yaml-templates/publish-artifact.yaml
409+
parameters:
410+
displayName: upload build and test results
411+
artifactName: Test Results - MAUI Integration
412+
targetPath: $(Build.StagingDirectory)/logs
413+
condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true'))
414+
415+
- template: yaml-templates/fail-on-issue.yaml
416+
417+
287418
- stage: dotnet_prepare_release
288419
displayName: Prepare .NET Release
289420
dependsOn:

build-tools/automation/yaml-templates/run-dotnet-preview.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ parameters:
1313
steps:
1414
- powershell: |
1515
if ([Environment]::OSVersion.Platform -eq "Unix") {
16-
$env:DOTNET_ROOT = "${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet"
17-
$dotnetPath = "$env:DOTNET_ROOT/dotnet"
16+
$DOTNET_ROOT = "${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet"
17+
$env:PATH = "${DOTNET_ROOT}:$env:PATH"
18+
$dotnetPath = "${DOTNET_ROOT}/dotnet"
1819
} else {
19-
$env:DOTNET_ROOT = "${{ parameters.xaSourcePath }}\bin\${{ parameters.configuration }}\dotnet"
20-
$dotnetPath = "$env:DOTNET_ROOT\dotnet.exe"
20+
$DOTNET_ROOT = "${{ parameters.xaSourcePath }}\bin\${{ parameters.configuration }}\dotnet"
21+
$env:PATH = "${DOTNET_ROOT};$env:PATH"
22+
$dotnetPath = "${DOTNET_ROOT}\dotnet.exe"
2123
}
2224
& $dotnetPath ${{ parameters.command }} ${{ parameters.project }} ${{ parameters.arguments }}
2325
if ([System.Convert]::ToBoolean("${{ parameters.useExitCodeForErrors }}") -and $LASTEXITCODE -ne 0) {

build-tools/create-packs/vs-workload.in.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetName>Microsoft.NET.Sdk.Android.Workload.@VSMAN_VERSION@</TargetName>
55
<ManifestBuildVersion>@WORKLOAD_VERSION@</ManifestBuildVersion>
6+
<EnableSideBySideManifests>true</EnableSideBySideManifests>
67
</PropertyGroup>
78
<ItemGroup>
89
<!-- Shorten package names to avoid long path caching issues in Visual Studio -->

build-tools/scripts/DotNet.targets

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
<_Root>$(MSBuildThisFileDirectory)..\..\</_Root>
44
<_BinlogPathPrefix>$(_Root)bin/Build$(Configuration)/msbuild-$([System.DateTime]::Now.ToString("yyyyMMddTHHmmss"))</_BinlogPathPrefix>
55
</PropertyGroup>
6+
67
<Target Name="BuildExternal">
78
<Exec
89
Command="&quot;$(DotNetPreviewTool)&quot; build monodroid.proj -c $(Configuration) -p:DebuggingToolsOutputDirectory=$(MicrosoftAndroidSdkOutDir) -p:CompatTargetsOutputDirectory=$(XAInstallPrefix)xbuild/Novell -bl:$(_BinlogPathPrefix)-build-monodroid.binlog"
910
WorkingDirectory="$(_Root)external\monodroid"
1011
/>
1112
</Target>
13+
1214
<Target Name="PrepareJavaInterop">
1315
<Exec
1416
Command="&quot;$(DotNetPreviewTool)&quot; build -t:Prepare Java.Interop.sln -c $(Configuration) -p:JdksRoot=$(JavaSdkDirectory) -p:DotnetToolPath=$(DotNetPreviewTool) -bl:$(_BinlogPathPrefix)-prepare-java-interop.binlog"
1517
WorkingDirectory="$(_Root)external\Java.Interop"
1618
/>
1719
</Target>
20+
1821
<Target Name="BuildDotNet"
1922
DependsOnTargets="PrepareJavaInterop">
2023
<MSBuild Projects="$(_Root)build-tools\xa-prep-tasks\xa-prep-tasks.csproj" />
2124
<MSBuild Projects="$(_Root)Xamarin.Android.sln" Properties="DisableApiCompatibilityCheck=true" />
2225
<MSBuild Projects="$(_Root)build-tools\create-packs\Microsoft.Android.Sdk.proj" Targets="ConfigureLocalWorkload" />
2326
</Target>
27+
2428
<Target Name="PackDotNet">
2529
<!-- Build extra versions of Mono.Android.dll if necessary -->
2630
<MSBuild
@@ -42,34 +46,59 @@
4246
</ItemGroup>
4347
<RemoveDir Directories="@(_DirectoriesToRemove)" />
4448
</Target>
49+
4550
<Target Name="InstallMaui">
46-
<Error Text="%24(MauiVersion) must be specified." Condition=" '$(MauiVersion)' == '' " />
51+
<Error Text="%24(MauiVersion) must be specified." Condition=" '$(MauiVersion)' == '' and '$(MauiUseLocalPacks)' != 'true' " />
4752
<PropertyGroup>
4853
<_TempDirectory>$(DotNetPreviewPath)..\.xa-workload-temp-$([System.IO.Path]::GetRandomFileName())</_TempDirectory>
4954
<MauiVersionBand Condition=" '$(MauiVersionBand)' == '' ">$(DotNetSdkManifestsFolder)</MauiVersionBand>
55+
<MauiUseLocalPacks Condition=" '$(MauiUseLocalPacks)' == '' ">false</MauiUseLocalPacks>
56+
<MauiSourcePath Condition=" '$(MauiSourcePath)' == '' ">$(XamarinAndroidSourcePath)..\maui</MauiSourcePath>
57+
<MauiPackagePath Condition=" '$(MauiPackagePath)' == '' ">$(MauiSourcePath)\artifacts</MauiPackagePath>
58+
<MauiWorkloadToInstall Condition=" '$(MauiWorkloadToInstall)' == '' ">maui-android</MauiWorkloadToInstall>
5059
</PropertyGroup>
5160
<MakeDir Directories="$(_TempDirectory)" />
61+
62+
<!-- Restore or extract WorkloadManifest.* files-->
5263
<Exec
64+
Condition=" '$(MauiUseLocalPacks)' != 'true' "
5365
Command="&quot;$(DotNetPreviewTool)&quot; restore maui.proj -p:MauiVersion=$(MauiVersion) -p:MauiVersionBand=$(MauiVersionBand)"
5466
WorkingDirectory="$(MSBuildThisFileDirectory)"
5567
EnvironmentVariables="NUGET_PACKAGES=$(_TempDirectory);DOTNET_MULTILEVEL_LOOKUP=0"
5668
/>
69+
<ItemGroup>
70+
<_WLManifestPack Include="$(MauiPackagePath)\Microsoft.NET.Sdk.Maui.Manifest-$(MauiVersionBand.Substring (0,3))*.nupkg" />
71+
</ItemGroup>
72+
<Unzip
73+
Condition=" '$(MauiUseLocalPacks)' == 'true' "
74+
SourceFiles="@(_WLManifestPack)"
75+
DestinationFolder="$(_TempDirectory)"
76+
/>
5777

5878
<!-- Copy WorkloadManifest.* files-->
5979
<ItemGroup>
60-
<_WLManifest Include="$(_TempDirectory)\microsoft.net.sdk.maui.manifest-$(MauiVersionBand)\$(MauiVersion)\data\WorkloadManifest.*" />
80+
<_WLManifest Condition=" '$(MauiUseLocalPacks)' != 'true' " Include="$(_TempDirectory)\microsoft.net.sdk.maui.manifest-$(MauiVersionBand)\$(MauiVersion)\data\WorkloadManifest.*" />
81+
<_WLManifest Condition=" '$(MauiUseLocalPacks)' == 'true' " Include="$(_TempDirectory)\data\*" />
6182
</ItemGroup>
6283
<Copy SourceFiles="@(_WLManifest)" DestinationFolder="$(DotNetPreviewPath)sdk-manifests\$(DotNetSdkManifestsFolder)\microsoft.net.sdk.maui" />
6384

6485
<!-- Parse NuGet.config -->
6586
<XmlPeek
87+
Condition=" '$(MauiUseLocalPacks)' != 'true' "
6688
XmlInputPath="$(XamarinAndroidSourcePath)NuGet.config"
6789
Query="/configuration/packageSources/add/@value">
6890
<Output TaskParameter="Result" ItemName="_NuGetSources" />
6991
</XmlPeek>
92+
<XmlPeek
93+
Condition=" '$(MauiUseLocalPacks)' == 'true' "
94+
XmlInputPath="$(MauiSourcePath)\NuGet.config"
95+
Query="/configuration/packageSources/add/@value">
96+
<Output TaskParameter="Result" ItemName="_NuGetSources" />
97+
</XmlPeek>
7098

7199
<!-- dotnet workload install maui-android -->
72100
<ItemGroup>
101+
<_NuGetSources Condition=" '$(MauiUseLocalPacks)' == 'true' " Include="$(MauiPackagePath.TrimEnd('\'))" />
73102
<_NuGetSources Include="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
74103
<_NuGetSources Include="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
75104
<_InstallArguments Include="--skip-manifest-update" />
@@ -78,7 +107,7 @@
78107
<_InstallArguments Include="--temp-dir &quot;$(_TempDirectory)&quot;" />
79108
</ItemGroup>
80109
<Exec
81-
Command="&quot;$(DotNetPreviewTool)&quot; workload install maui-android @(_InstallArguments, ' ')"
110+
Command="&quot;$(DotNetPreviewTool)&quot; workload install $(MauiWorkloadToInstall) @(_InstallArguments, ' ')"
82111
WorkingDirectory="$(_TempDirectory)"
83112
EnvironmentVariables="DOTNET_MULTILEVEL_LOOKUP=0"
84113
/>

build-tools/scripts/msbuild.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ endef
5252

5353
# $(call DOTNET_BINLOG,name,build=$(DOTNET_VERB),dotnet=$(DOTNET_TOOL))
5454
define DOTNET_BINLOG
55-
$(if $(3),,DOTNET_ROOT='$(DOTNET_ROOT)') $(if $(3),$(3),$(DOTNET_TOOL)) $(if $(2),$(2),$(DOTNET_VERB)) -c $(CONFIGURATION) -v:n $(MSBUILD_ARGS) \
55+
$(if $(3),,PATH="$(DOTNET_ROOT):$(PATH)") $(if $(3),$(3),$(DOTNET_TOOL)) $(if $(2),$(2),$(DOTNET_VERB)) -c $(CONFIGURATION) -v:n $(MSBUILD_ARGS) \
5656
-bl:"$(dir $(realpath $(firstword $(MAKEFILE_LIST))))/bin/Build$(CONFIGURATION)/msbuild-`date +%Y%m%dT%H%M%S`-$(1).binlog"
5757
endef
5858

eng/Version.Details.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<Dependencies>
22
<ProductDependencies>
3-
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-preview.7.23364.32">
3+
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-rc.1.23373.1">
44
<Uri>https://github.com/dotnet/installer</Uri>
5-
<Sha>ca467d68c8f678a671984a46996d3fc37fe7f3de</Sha>
5+
<Sha>f8bab721aec4cce610504674cd08d68048250f19</Sha>
66
</Dependency>
7-
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="8.0.0-preview.7.23364.3" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
7+
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="8.0.0-rc.1.23371.3" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
88
<Uri>https://github.com/dotnet/runtime</Uri>
9-
<Sha>ae99bb2e7a0a5db7c2bff129322965fd3c6e820d</Sha>
9+
<Sha>f016dc4b7cfc306d2d5e29c49e5ccd2d2916d466</Sha>
1010
</Dependency>
11-
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-preview.7.23364.3" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
11+
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-rc.1.23371.3" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
1212
<Uri>https://github.com/dotnet/runtime</Uri>
13-
<Sha>ae99bb2e7a0a5db7c2bff129322965fd3c6e820d</Sha>
13+
<Sha>f016dc4b7cfc306d2d5e29c49e5ccd2d2916d466</Sha>
1414
</Dependency>
15-
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport" Version="8.0.0-preview.7.23361.2" CoherentParentDependency="Microsoft.NETCore.App.Ref">
15+
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport" Version="8.0.0-rc.1.23368.3" CoherentParentDependency="Microsoft.NETCore.App.Ref">
1616
<Uri>https://github.com/dotnet/emsdk</Uri>
17-
<Sha>afbff08914374ed6790324635b9346d1256680fc</Sha>
17+
<Sha>1f68fcee45ca75a2cb780edaff1e695af4d4f787</Sha>
1818
</Dependency>
1919
<Dependency Name="Microsoft.DotNet.Cecil" Version="0.11.4-alpha.23360.2" CoherentParentDependency="Microsoft.NET.ILLink.Tasks">
2020
<Uri>https://github.com/dotnet/cecil</Uri>

eng/Versions.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project>
22
<!--Package versions-->
33
<PropertyGroup>
4-
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-preview.7.23364.32</MicrosoftDotnetSdkInternalPackageVersion>
5-
<MicrosoftNETILLinkTasksPackageVersion>8.0.0-preview.7.23364.3</MicrosoftNETILLinkTasksPackageVersion>
6-
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-preview.7.23364.3</MicrosoftNETCoreAppRefPackageVersion>
4+
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-rc.1.23373.1</MicrosoftDotnetSdkInternalPackageVersion>
5+
<MicrosoftNETILLinkTasksPackageVersion>8.0.0-rc.1.23371.3</MicrosoftNETILLinkTasksPackageVersion>
6+
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-rc.1.23371.3</MicrosoftNETCoreAppRefPackageVersion>
77
<MicrosoftDotNetApiCompatPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetApiCompatPackageVersion>
88
<MicrosoftDotNetBuildTasksFeedPackageVersion>7.0.0-beta.22103.1</MicrosoftDotNetBuildTasksFeedPackageVersion>
9-
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>8.0.0-preview.7.23361.2</MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>
9+
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>8.0.0-rc.1.23368.3</MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>
1010
<MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>
1111
<MicrosoftTemplateEngineTasksPackageVersion>7.0.100-rc.1.22410.7</MicrosoftTemplateEngineTasksPackageVersion>
1212
<MicrosoftDotNetCecilPackageVersion>0.11.4-alpha.23360.2</MicrosoftDotNetCecilPackageVersion>

src/Mono.Android/Android.Content/Context.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using Android.OS;
23
using Android.Runtime;
34

45
namespace Android.Content {
@@ -16,5 +17,14 @@ public void StartActivity (Type type)
1617
[Obsolete ("This constant will be removed in the future version. Use Android.Content.ReceiverFlags enum directly instead of this field.")]
1718
public const int ReceiverVisibleToInstantApps = 1;
1819
#endif
20+
21+
#if ANDROID_34
22+
// Add correctly enumified overloads
23+
public Intent? RegisterReceiver (BroadcastReceiver? receiver, IntentFilter? filter, ReceiverFlags flags)
24+
=> RegisterReceiver (receiver, filter, (ActivityFlags)flags);
25+
26+
public Intent? RegisterReceiver (BroadcastReceiver? receiver, IntentFilter? filter, string? broadcastPermission, Handler? scheduler, ReceiverFlags flags)
27+
=> RegisterReceiver (receiver, filter, broadcastPermission, scheduler, (ActivityFlags)flags);
28+
#endif
1929
}
2030
}

src/Mono.Android/Mono.Android.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
<PropertyGroup>
2828
<DefineConstants Condition=" '$(AndroidApiLevel)' &gt; '$(AndroidLatestStableApiLevel)' ">$(DefineConstants);ANDROID_UNSTABLE</DefineConstants>
2929
<OutputPath>$(_MonoAndroidNETDefaultOutDir)</OutputPath>
30+
31+
<!-- Allow PublicApiAnalyzers to be turned off -->
3032
<RunAnalyzers Condition=" '$(DisableApiCompatibilityCheck)' == 'True' ">false</RunAnalyzers>
33+
34+
<!-- PublicApiAnalyzers warnings should be errors, but building in VS throws incorrect extra warnings -->
35+
<WarningsAsErrors Condition=" '$(BuildingInsideVisualStudio)' != 'True' ">$(WarningsAsErrors);RS0016,RS0017</WarningsAsErrors>
3136
</PropertyGroup>
3237

3338
<PropertyGroup Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">

0 commit comments

Comments
 (0)