Skip to content

Commit

Permalink
Merge branch 'main' into release/8.0.1xx
Browse files Browse the repository at this point in the history
Conflicts:
	eng/Version.Details.xml
	eng/Versions.props
  • Loading branch information
jonathanpeppers committed Jul 20, 2023
2 parents 6aa0477 + 7bf4edd commit c7591f8
Show file tree
Hide file tree
Showing 105 changed files with 131,753 additions and 4,482 deletions.
2 changes: 1 addition & 1 deletion Documentation/guides/building-apps/build-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ In a Xamarin.Android binding project, the **JavaDocJar** build action
is used on `.jar` files that contain *Javadoc HTML*. The Javadoc HTML
is parsed in order to extract parameter names.

Only certain "Javadoc HTML dialects" are supported, including:
Only certain "Javadoc HTML variations" are supported, including:

* JDK 1.7 `javadoc` output.
* JDK 1.8 `javadoc` output.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/workflow/commit-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ message is where to put that information.

# English

Commit message should be properly spelled in some English dialect; it doesn't
need to be American English vs. British English, but for whichever dialect
Commit message should be properly spelled in some English regional language; it doesn't
need to be American English vs. British English, but for whichever regional language
*is* used, words should be spelled correctly. Proper grammar should be used.

Present tense should be used for work done within the current commit.
Expand Down
73 changes: 67 additions & 6 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,73 @@ stages:
- dotnet_prepare_release
condition: and(eq(variables['MicroBuildSignType'], 'Real'), eq(dependencies.dotnet_prepare_release.result, 'Succeeded'))
jobs:
- template: compliance/sbom/job.v1.yml@yaml-templates
parameters:
artifactNames: [ nuget-signed, nuget-linux-signed, vs-msi-nugets, vsdrop-signed ]
packageName: xamarin-android
packageFilter: '*.nupkg;*.msi'
GitHub.Token: $(GitHub.Token)
- job: sbom
displayName: Generate SBOM
timeoutInMinutes: 60
pool:
name: AzurePipelines-EO
demands:
- ImageOverride -equals AzurePipelinesWindows2022compliant
variables:
Packaging.EnableSBOMSigning: true
workspace:
clean: all
steps:
- checkout: self
submodules: recursive

- task: DownloadPipelineArtifact@2
inputs:
artifactName: nuget-signed
downloadPath: $(Build.StagingDirectory)\packages
patterns: '*.nupkg'

- task: DownloadPipelineArtifact@2
inputs:
artifactName: nuget-linux-signed
downloadPath: $(Build.StagingDirectory)\packages
patterns: '*.nupkg'

- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(WindowsToolchainPdbArtifactName)
downloadPath: $(Build.StagingDirectory)\packages

- task: DownloadPipelineArtifact@2
inputs:
artifactName: vs-msi-nugets
downloadPath: $(Build.StagingDirectory)\packages
patterns: '*.nupkg'

- task: DownloadPipelineArtifact@2
inputs:
artifactName: vsdrop-signed
downloadPath: $(Build.StagingDirectory)\packages
patterns: '*.msi'

- task: DownloadPipelineArtifact@2
inputs:
artifactName: vsdrop-multitarget-signed
downloadPath: $(Build.StagingDirectory)\packages
patterns: '*.msi'

- task: DownloadPipelineArtifact@2
inputs:
artifactName: sbom-components-macos
downloadPath: $(Build.StagingDirectory)\sbom\components-macos

- task: DownloadPipelineArtifact@2
inputs:
artifactName: sbom-components-linux
downloadPath: $(Build.StagingDirectory)\sbom\components-linux

- template: compliance/sbom/scan.v1.yml@yaml-templates
parameters:
dropDirectory: $(Build.StagingDirectory)\packages
componentsDirectory: $(Build.StagingDirectory)\sbom
manifestDirectory: $(Build.StagingDirectory)\sbom
packageName: .NET Android
packageVersionRegex: '(?i)^Microsoft.*\.(?<version>\d+\.\d+\.\d+(-.*)?\.\d+).nupkg$'

# Check - "Xamarin.Android (Compliance)"
- template: security/full/v0.yml@yaml-templates
Expand Down
4 changes: 2 additions & 2 deletions build-tools/automation/guardian/PoliCheck.Exclusions.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<PoliCheckExclusions>
<!-- Reminder: you are only allowed one exclusion element of each type, to have multiple values you must pipe separate them in a single element -->
<!-- Each of these exclusions is a folder name - if \[name]\ exists in the file path, it will be skipped -->
<Exclusion Type="FolderPathFull">LICENSE-DATA|NREFACTORY|LOCALIZE</Exclusion>
<Exclusion Type="FolderPathStart">src\Mono.Android\Profiles</Exclusion>
<!-- Each of these exclusions is a folder name - if any folder or file starts with "\[name]", it will be skipped -->
<!--<Exclusion Type="FolderPathStart">ABC|XYZ</Exclusion>-->
<Exclusion Type="FolderPathStart">src\Mono.Android\Profiles|src\Mono.Android\PublicAPI</Exclusion>
<!-- Each of these file types will be completely skipped for the entire scan -->
<!--<Exclusion Type="FileType">.ABC|.XYZ</Exclusion>-->
<!-- The specified file names will be skipped during the scan regardless which folder they are in -->
Expand Down
23 changes: 23 additions & 0 deletions build-tools/automation/yaml-templates/build-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,29 @@ stages:
artifactName: ${{ parameters.nugetArtifactName }}
targetPath: $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/nuget-linux

- powershell: |
[IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/empty")
[IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/sbom-components")
displayName: create SBOM directories
condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real'))
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: generate components SBOM
condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real'))
inputs:
BuildDropPath: $(Build.StagingDirectory)/empty
BuildComponentPath: $(System.DefaultWorkingDirectory)/xamarin-android
ManifestDirPath: $(Build.StagingDirectory)/sbom-components
PackageName: .NET Android
Verbosity: Verbose

- task: PublishBuildArtifacts@1
displayName: publish components SBOM
condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real'))
inputs:
artifactName: sbom-components-linux
pathToPublish: $(Build.StagingDirectory)/sbom-components

- template: upload-results.yaml
parameters:
xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android
Expand Down
23 changes: 23 additions & 0 deletions build-tools/automation/yaml-templates/build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,29 @@ stages:
parameters:
condition: and(succeededOrFailed(), eq(variables['MicroBuildSignType'], 'Real'))

- powershell: |
[IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/empty")
[IO.Directory]::CreateDirectory("$(Build.StagingDirectory)/sbom-components")
displayName: create SBOM directories
condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real'))
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: generate components SBOM
condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real'))
inputs:
BuildDropPath: $(Build.StagingDirectory)/empty
BuildComponentPath: $(System.DefaultWorkingDirectory)/xamarin-android
ManifestDirPath: $(Build.StagingDirectory)/sbom-components
PackageName: .NET Android
Verbosity: Verbose

- task: PublishBuildArtifacts@1
displayName: publish components SBOM
condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real'))
inputs:
artifactName: sbom-components-macos
pathToPublish: $(Build.StagingDirectory)/sbom-components

- script: >
mkdir -p $(System.DefaultWorkingDirectory)/xamarin-android/bin/Build$(XA.Build.Configuration)/windows-toolchain-pdb &&
cd $(System.DefaultWorkingDirectory)/xamarin-android/bin/$(XA.Build.Configuration)/lib/packs/Microsoft.Android.Sdk.Darwin/*/tools/binutils/windows-toolchain-pdb &&
Expand Down
6 changes: 4 additions & 2 deletions build-tools/automation/yaml-templates/run-dotnet-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ parameters:
steps:
- powershell: |
if ([Environment]::OSVersion.Platform -eq "Unix") {
$dotnetPath = "${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet/dotnet"
$env:DOTNET_ROOT = "${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet"
$dotnetPath = "$env:DOTNET_ROOT/dotnet"
} else {
$dotnetPath = "${{ parameters.xaSourcePath }}\bin\${{ parameters.configuration }}\dotnet\dotnet.exe"
$env:DOTNET_ROOT = "${{ parameters.xaSourcePath }}\bin\${{ parameters.configuration }}\dotnet"
$dotnetPath = "$env:DOTNET_ROOT\dotnet.exe"
}
& $dotnetPath ${{ parameters.command }} ${{ parameters.project }} ${{ parameters.arguments }}
if ([System.Convert]::ToBoolean("${{ parameters.useExitCodeForErrors }}") -and $LASTEXITCODE -ne 0) {
Expand Down
2 changes: 1 addition & 1 deletion build-tools/automation/yaml-templates/upload-results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parameters:
configuration: $(XA.Build.Configuration)
artifactName: results
includeBuildResults: false
condition: ne(variables['Agent.JobStatus'], 'Succeeded')
condition: or(ne(variables['Agent.JobStatus'], 'Succeeded'), eq(variables['XA.PublishAllLogs'], 'true'))

steps:
- template: run-xaprepare.yaml
Expand Down
5 changes: 3 additions & 2 deletions build-tools/scripts/msbuild.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
# $(MSBUILD_FLAGS): Additional MSBuild flags; contains $(CONFIGURATION), $(V), $(MSBUILD_ARGS).

MSBUILD = msbuild
DOTNET_TOOL = $(topdir)/bin/$(CONFIGURATION)/dotnet/dotnet
DOTNET_ROOT = $(topdir)/bin/$(CONFIGURATION)/dotnet/
DOTNET_TOOL = $(DOTNET_ROOT)dotnet
DOTNET_VERB = build
MSBUILD_FLAGS = /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS)

Expand Down Expand Up @@ -51,7 +52,7 @@ endef

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

Expand Down
2 changes: 1 addition & 1 deletion external/Java.Interop
2 changes: 2 additions & 0 deletions src/Mono.Android/Android.Runtime/JNIEnv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,9 @@ static unsafe void _GetDoubleArrayRegion (IntPtr array, int start, int length, d
JniEnvironment.Arrays.GetDoubleArrayRegion (new JniObjectReference (array), start, length, p);
}

#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
public static void CopyArray (IntPtr src, Array dest, Type? elementType = null)
#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads
{
if (dest == null)
throw new ArgumentNullException ("dest");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Android {
[Obsolete ("This attribute is no longer supported.", error: true)]
public class IncludeAndroidResourcesFromAttribute : ReferenceFilesAttribute
{
#pragma warning disable RS0022 // Constructor make noninheritable base class inheritable
public IncludeAndroidResourcesFromAttribute (string path)
#pragma warning restore RS0022 // Constructor make noninheritable base class inheritable
{
ResourceDirectory = path;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ namespace Java.Interop {
[Obsolete ("This attribute is no longer supported.", error: true)]
public class JavaLibraryReferenceAttribute : Android.ReferenceFilesAttribute
{
#pragma warning disable RS0022 // Constructor make noninheritable base class inheritable
public JavaLibraryReferenceAttribute (string filename)
#pragma warning restore RS0022 // Constructor make noninheritable base class inheritable
{
LibraryFileName = filename;
}
Expand Down
3 changes: 3 additions & 0 deletions src/Mono.Android/Java.Interop/JavaTypeParametersAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
#if NET
using System.Runtime.CompilerServices;

// PublicApiAnalyzers doesn't like TypeForwards
#pragma warning disable RS0016 // Symbol is not part of the declared API
[assembly: TypeForwardedTo (typeof (Java.Interop.JavaTypeParametersAttribute))]
#pragma warning restore RS0016 // Symbol is not part of the declared API

#else // !NET

Expand Down
15 changes: 14 additions & 1 deletion src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<RootNamespace>Android</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<NoWarn>0618;0809;0108;0114;0465;8609;8610;8614;8617;8613;8764;8765;8766;8767</NoWarn>
<NoWarn>0618;0809;0108;0114;0465;8609;8610;8614;8617;8613;8764;8765;8766;8767;RS0041</NoWarn>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);JAVA_INTEROP</DefineConstants>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\android-$(AndroidPlatformId)\</IntermediateOutputPath>
Expand All @@ -27,6 +27,7 @@
<PropertyGroup>
<DefineConstants Condition=" '$(AndroidApiLevel)' &gt; '$(AndroidLatestStableApiLevel)' ">$(DefineConstants);ANDROID_UNSTABLE</DefineConstants>
<OutputPath>$(_MonoAndroidNETDefaultOutDir)</OutputPath>
<RunAnalyzers Condition=" '$(DisableApiCompatibilityCheck)' == 'True' ">false</RunAnalyzers>
</PropertyGroup>

<PropertyGroup Condition=" '$(IncludeAndroidJavadoc)' == 'True' ">
Expand All @@ -39,6 +40,11 @@
<NoWarn>$(NoWarn);CA1422;CA1416</NoWarn>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="PublicAPI\API-$(AndroidApiLevel)\PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI\API-$(AndroidApiLevel)\PublicAPI.Unshipped.txt" />
</ItemGroup>

<PropertyGroup>
<JavaCallableWrapperAbsAssembly>$([System.IO.Path]::GetFullPath ('$(OutputPath)$(AssemblyName).dll'))</JavaCallableWrapperAbsAssembly>
</PropertyGroup>
Expand Down Expand Up @@ -338,6 +344,13 @@
<Compile Include="Xamarin.Android.Net\NegotiateAuthenticationHelper.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\build-tools\create-android-api\create-android-api.csproj" ReferenceOutputAssembly="false" />
<!-- Explicitly pass the target framework of the project so we don't have conflicts with the multiple targets in this file. -->
Expand Down
7 changes: 7 additions & 0 deletions src/Mono.Android/Properties/AssemblyInfo.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Copyright 2014 Xamarin, Inc.
// Copyright 2016 Microsoft Corporation.

using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
Expand All @@ -26,6 +27,8 @@ using System.Runtime.Versioning;
[assembly: SupportedOSPlatform("Android@[email protected]")]
#endif

// PublicApiAnalyzers doesn't like TypeForwards
#pragma warning disable RS0016 // Symbol is not part of the declared API
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Color))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.ColorConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.KnownColor))]
Expand All @@ -36,9 +39,13 @@ using System.Runtime.Versioning;
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.Size))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SizeF))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Drawing.SystemColors))]
#pragma warning restore RS0016 // Symbol is not part of the declared API

[assembly: InternalsVisibleTo("Mono.Android.Export, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
[assembly: InternalsVisibleTo("Mono.Android-Tests, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
[assembly: InternalsVisibleTo("Java.Interop-Tests, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
[assembly: InternalsVisibleTo("Mono.Android-TestsMultiDex, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
[assembly: InternalsVisibleTo("Mono.Android-TestsAppBundle, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
[assembly: InternalsVisibleTo("Mono.Android.NET-Tests, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]

[assembly: SuppressMessage ("ApiDesign", "RS0016:Add public types and members to the declared API", Justification = "Analyzer fails due to extended characters.", Scope = "member", Target = "~F:Android.Util.Patterns.GoodIriChar")]
1 change: 1 addition & 0 deletions src/Mono.Android/PublicAPI/API-34/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#nullable enable
Loading

0 comments on commit c7591f8

Please sign in to comment.