Skip to content

Commit

Permalink
Merge branch 'main' into throwable-stacktrace
Browse files Browse the repository at this point in the history
* main:
  [ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189)
  Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188)
  [Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171)
  [Xamarin.Android.Build.Tasks] per-RID assemblies & typemaps (dotnet#8164)
  [AndroidDependenciesTests] Test both manifest types (dotnet#8186)
  [AndroidDependenciesTests] Use platform-tools 34.0.4 (dotnet#8184)
  • Loading branch information
grendello committed Jul 14, 2023
2 parents 78839fb + a016b31 commit b2b38b1
Show file tree
Hide file tree
Showing 29 changed files with 125,477 additions and 385 deletions.
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
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
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 b2b38b1

Please sign in to comment.