Skip to content

Commit d21a42c

Browse files
authored
[build] Fix Microsoft.DotNet.ApiCompat references (#5822)
Commit 4c47cbe missed a few places where the ApiCompat and GenApi package versions were declared, which caused a build break on machines that did not have the previous versions of these packages cached: C:\a\1\s\src\Mono.Android\Mono.Android.targets(247,5): error MSB4018: The "CheckApiCompatibility" task failed unexpectedly. [C:\a\1\s\src\Mono.Android\Mono.Android.csproj] C:\a\1\s\src\Mono.Android\Mono.Android.targets(247,5): error MSB4018: System.ComponentModel.Win32Exception (2): The system cannot find the file specified. [C:\a\1\s\src\Mono.Android\Mono.Android.csproj] C:\a\1\s\src\Mono.Android\Mono.Android.targets(247,5): error MSB4018: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) [C:\a\1\s\src\Mono.Android\Mono.Android.csproj] C:\a\1\s\src\Mono.Android\Mono.Android.targets(247,5): error MSB4018: at Xamarin.Android.Tools.BootstrapTasks.CheckApiCompatibility.ValidateApiCompat(String contractPath, Boolean validateAgainstReference) in C:\a\1\s\build-tools\Xamarin.Android.Tools.BootstrapTasks\Xamarin.Android.Tools.BootstrapTasks\CheckApiCompatibility.cs:line 205 [C:\a\1\s\src\Mono.Android\Mono.Android.csproj] C:\a\1\s\src\Mono.Android\Mono.Android.targets(247,5): error MSB4018: at Xamarin.Android.Tools.BootstrapTasks.CheckApiCompatibility.Execute() in C:\a\1\s\build-tools\Xamarin.Android.Tools.BootstrapTasks\Xamarin.Android.Tools.BootstrapTasks\CheckApiCompatibility.cs:line 120 [C:\a\1\s\src\Mono.Android\Mono.Android.csproj] C:\a\1\s\src\Mono.Android\Mono.Android.targets(247,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\a\1\s\src\Mono.Android\Mono.Android.csproj] C:\a\1\s\src\Mono.Android\Mono.Android.targets(247,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\a\1\s\src\Mono.Android\Mono.Android.csproj] Once these missed package version declarations were fixed to use the $(MicrosoftDotNetApiCompatPackageVersion) property, new "breakages" were reported: CheckApiCompatibility found nonacceptable Api breakages for ApiLevel: v11.0. *** Invalid/Unused baseline differences *** CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ActivityAttribute.Icon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ActivityAttribute.Label' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ActivityAttribute.RoundIcon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ActivityAttribute.Theme' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ApplicationAttribute.Description' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ApplicationAttribute.Icon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ApplicationAttribute.Label' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ApplicationAttribute.Logo' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ApplicationAttribute.RoundIcon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ApplicationAttribute.Theme' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.InstrumentationAttribute.Icon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.InstrumentationAttribute.Label' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.InstrumentationAttribute.RoundIcon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ServiceAttribute.Icon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ServiceAttribute.Label' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.App.ServiceAttribute.RoundIcon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.Content.BroadcastReceiverAttribute.Description' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.Content.BroadcastReceiverAttribute.Icon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.Content.BroadcastReceiverAttribute.Label' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.Content.BroadcastReceiverAttribute.RoundIcon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.Content.ContentProviderAttribute.Icon' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.Content.ContentProviderAttribute.Label' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.CategoryAttribute' exists on 'Android.Content.ContentProviderAttribute.RoundIcon' in the contract but not the implementation. Total Issues: 23 We should revert the ApiCompat package version to `5.0.0-beta.20181.7` to fix the build, and investigate the behavior changes in version 6.0.0 in a future PR.
1 parent cee53ef commit d21a42c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
</Dependency>
1111
</ProductDependencies>
1212
<ToolsetDependencies>
13-
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.21179.7">
13+
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="5.0.0-beta.20181.7">
1414
<Uri>https://github.com/dotnet/arcade</Uri>
15-
<Sha>fd5f55c64d48b7894516cc841fba1253b2e79ffd</Sha>
15+
<Sha>6ee69696ea00da39f35066c22c21a00ceab93d00</Sha>
1616
</Dependency>
1717
</ToolsetDependencies>
1818
</Dependencies>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<MicrosoftDotnetSdkInternalPackageVersion>6.0.100-preview.4.21179.4</MicrosoftDotnetSdkInternalPackageVersion>
55
<MicrosoftNETILLinkPackageVersion>6.0.100-preview.2.21205.2</MicrosoftNETILLinkPackageVersion>
6-
<MicrosoftDotNetApiCompatPackageVersion>6.0.0-beta.21179.7</MicrosoftDotNetApiCompatPackageVersion>
6+
<MicrosoftDotNetApiCompatPackageVersion>5.0.0-beta.20181.7</MicrosoftDotNetApiCompatPackageVersion>
77
</PropertyGroup>
88
<PropertyGroup>
99
<!-- Trim all characters after first `-` or `+` is encountered. -->

src/Mono.Android/Mono.Android.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@
245245
Inputs="$(TargetPath);@(ApiCompatibilityFiles)"
246246
Outputs="$(IntermediateOutputPath)CheckApiCompatibility.stamp">
247247
<CheckApiCompatibility
248-
ApiCompatPath="$(XAPackagesDir)\microsoft.dotnet.apicompat\5.0.0-beta.20181.7\tools\net472\"
249-
CodeGenPath="$(XAPackagesDir)\microsoft.dotnet.genapi\5.0.0-beta.20181.7\tools\net472\"
248+
ApiCompatPath="$(XAPackagesDir)\microsoft.dotnet.apicompat\$(MicrosoftDotNetApiCompatPackageVersion)\tools\net472\"
249+
CodeGenPath="$(XAPackagesDir)\microsoft.dotnet.genapi\$(MicrosoftDotNetApiCompatPackageVersion)\tools\net472\"
250250
ApiLevel="$(AndroidFrameworkVersion)"
251251
LastStableApiLevel="$(AndroidLatestStableFrameworkVersion)"
252252
TargetImplementationPath="$(OutputPath)"

tests/api-compatibility/api-compatibility.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Text="Please set the %24(ContractAssembly) property!"
99
/>
1010
<PropertyGroup>
11-
<_GenAPI>"$(XAPackagesDir)\microsoft.dotnet.genapi\5.0.0-beta.20181.7\tools\net472\Microsoft.DotNet.GenAPI.exe"</_GenAPI>
11+
<_GenAPI>"$(XAPackagesDir)\microsoft.dotnet.genapi\$(MicrosoftDotNetApiCompatPackageVersion)\tools\net472\Microsoft.DotNet.GenAPI.exe"</_GenAPI>
1212
<_CilStrip>"$(XAInstallPrefix)\xbuild\Xamarin\Android\cil-strip.exe"</_CilStrip>
1313
<_ContractRefDll>$(MSBuildThisFileDirectory)\reference\Mono.Android.dll</_ContractRefDll>
1414
<_ContractRefSrc>$(MSBuildThisFileDirectory)\reference\Mono.Android.dll.cs</_ContractRefSrc>

0 commit comments

Comments
 (0)