From eb39590dc9413014c8abc584840d9b319ec837fa Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Thu, 25 Jul 2024 22:34:06 +0200 Subject: [PATCH] Fix `LogCodedWarning` usage Also update `src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs` --- .../Properties/Resources.Designer.cs | 314 +++++++++++------- .../Utilities/ELFHelper.cs | 2 +- 2 files changed, 186 insertions(+), 130 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index 435a1deedc8..d49e95f5b39 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -108,20 +108,29 @@ public static string APT0004 { } /// - /// Looks up a localized string similar to Directory '{0}' is from '{1}'.. + /// Looks up a localized string similar to This could be caused by the project exceeding the Windows maximum path length limitation. See https://learn.microsoft.com/dotnet/android/messages/apt2264 for details.. /// - public static string XA_Directory_Is_From { + public static string APT2264 { get { - return ResourceManager.GetString("XA_Directory_Is_From", resourceCulture); + return ResourceManager.GetString("APT2264", resourceCulture); } } /// - /// Looks up a localized string similar to Could not find an 'AndroidResource' for 'anim'. + /// Looks up a localized string similar to This could be caused by the project having non-ASCII characters in its filename or path. See https://learn.microsoft.com/dotnet/android/messages/apt2265 for details.. /// - public static string XA8000 { + public static string APT2265 { get { - return ResourceManager.GetString("XA8000", resourceCulture); + return ResourceManager.GetString("APT2265", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Directory '{0}' is from '{1}'.. + /// + public static string XA_Directory_Is_From { + get { + return ResourceManager.GetString("XA_Directory_Is_From", resourceCulture); } } @@ -485,6 +494,42 @@ public static string XA0125 { } } + /// + /// Looks up a localized string similar to %(AndroidAsset.AssetPack) and %(AndroidAsset.AssetPack) item metadata are only supported when `$(AndroidApplication)` is `true`.. + /// + public static string XA0138 { + get { + return ResourceManager.GetString("XA0138", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `@(AndroidAsset)` `{0}` has an invalid `DeliveryType` metadata of `{1}`. Supported values are `installtime`, `ondemand` or `fastfollow`.. + /// + public static string XA0139 { + get { + return ResourceManager.GetString("XA0139", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The AssetPack value defined for `{0}` has invalid characters. `{1}` should only contain A-z, a-z, 0-9 or an underscore.. + /// + public static string XA0140 { + get { + return ResourceManager.GetString("XA0140", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NuGet package '{0}' version '{1}' contains a shared library '{2}' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details. + /// + public static string XA0141 { + get { + return ResourceManager.GetString("XA0141", resourceCulture); + } + } + /// /// Looks up a localized string similar to There was a problem parsing {0}. This is likely due to incomplete or invalid XML. Exception: {1}. /// @@ -684,7 +729,7 @@ public static string XA1023 { } /// - /// Looks up a localized string similar to Ignoring configuration file '{0}'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher. + /// Looks up a localized string similar to Ignoring configuration file '{0}'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher.. /// public static string XA1024 { get { @@ -711,7 +756,7 @@ public static string XA1026 { } /// - /// Looks up a localized string similar to Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.. + /// Looks up a localized string similar to Using AAPT is not supported in .NET for Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.. /// public static string XA1026_dotnet { get { @@ -737,6 +782,90 @@ public static string XA1028 { } } + /// + /// Looks up a localized string similar to The 'AotAssemblies' MSBuild property is deprecated. Edit the project file in a text editor to remove this property, and use the 'RunAOTCompilation' MSBuild property instead.. + /// + public static string XA1029 { + get { + return ResourceManager.GetString("XA1029", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set 'PublishTrimmed' to 'true' for this build configuration.. + /// + public static string XA1030 { + get { + return ResourceManager.GetString("XA1030", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'AndroidHttpClientHandlerType' property value '{0}' must derive from '{1}'. + ///Please change the value to an assembly-qualifed type name which inherits from '{1}' or remove the property completely.. + /// + public static string XA1031 { + get { + return ResourceManager.GetString("XA1031", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'AndroidHttpClientHandlerType' property value '{0}' must not derive from 'System.Net.Htt.HttpClientHandler'. + ///Please change the value to an assembly-qualifed type name which inherits from 'System.Net.Http.HttpMessageHandler' or remove the property completely.. + /// + public static string XA1031_HCH { + get { + return ResourceManager.GetString("XA1031_HCH", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to resolve '{0}' from '{1}'. Please check your `AndroidHttpClientHandlerType` setting.. + /// + public static string XA1032 { + get { + return ResourceManager.GetString("XA1032", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not resolve '{0}'. Please check your `AndroidHttpClientHandlerType` setting.. + /// + public static string XA1033 { + get { + return ResourceManager.GetString("XA1033", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your project references '{0}' which uses the `_Microsoft.Android.Resource.Designer` assembly, but you do not have this feature enabled. Please set the `AndroidUseDesignerAssembly` MSBuild property to `true` in your project file.. + /// + public static string XA1034 { + get { + return ResourceManager.GetString("XA1034", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'BundleAssemblies' property is deprecated and it has no effect on the application build. Equivalent functionality is implemented by the 'AndroidUseAssemblyStore' and 'AndroidEnableAssemblyCompression' properties.. + /// + public static string XA1035 { + get { + return ResourceManager.GetString("XA1035", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AndroidManifest.xml //uses-sdk/@android:minSdkVersion '{0}' does not match the $(SupportedOSPlatformVersion) value '{1}' in the project file (if there is no $(SupportedOSPlatformVersion) value in the project file, then a default value has been assumed). + ///Either change the value in the AndroidManifest.xml to match the $(SupportedOSPlatformVersion) value, or remove the value in the AndroidManifest.xml (and add a $(SupportedOSPlatformVersion) value to the project file if it doesn't already exist).. + /// + public static string XA1036 { + get { + return ResourceManager.GetString("XA1036", resourceCulture); + } + } + /// /// Looks up a localized string similar to The '{0}' MSBuild property is deprecated and will be removed in .NET {1}. See https://aka.ms/net-android-deprecations for more details.. /// @@ -745,9 +874,18 @@ public static string XA1037 { return ResourceManager.GetString("XA1037", resourceCulture); } } - + + /// + /// Looks up a localized string similar to The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/net-android/androidx for more details.. + /// + public static string XA1039 { + get { + return ResourceManager.GetString("XA1039", resourceCulture); + } + } + /// - /// Looks up a localized string similar to Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 6 and higher will only support a single AppDomain, so this API will no longer be available in .NET for Android once .NET 6 is released. + /// Looks up a localized string similar to Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 6 and higher will only support a single AppDomain, so this API will no longer be available in .NET for Android once .NET 6 is released.. /// public static string XA2000 { get { @@ -818,24 +956,6 @@ public static string XA2008 { } } - /// - /// Looks up a localized string similar to This is probably caused by the project exceeding the Max Path length. Please move your entire project closer to the Root of the drive.. - /// - public static string APT2264 { - get { - return ResourceManager.GetString("APT2264", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This could be caused by the project having non-ASCII characters in it path. - /// - public static string APT2265 { - get { - return ResourceManager.GetString("APT2265", resourceCulture); - } - } - /// /// Looks up a localized string similar to Could not AOT the assembly: {0}. /// @@ -882,7 +1002,7 @@ public static string XA3005 { } /// - /// Looks up a localized string similar to Could not compile native assembly file: {0}. + /// Looks up a localized string similar to Could not compile native assembly file: {0}{1}. /// public static string XA3006 { get { @@ -891,7 +1011,7 @@ public static string XA3006 { } /// - /// Looks up a localized string similar to Could not link native shared library: {0}. + /// Looks up a localized string similar to Could not link native shared library: {0}{1}. /// public static string XA3007 { get { @@ -972,7 +1092,7 @@ public static string XA4215_Details { } /// - /// Looks up a localized string similar to The deployment target '{1}' is not supported (the minimum is '{2}'). Please increase (or remove) the //uses-sdk/@android:minSdkVersion value in your AndroidManifest.xml.. + /// Looks up a localized string similar to The deployment target '{0}' is not supported (the minimum is '{1}'). Please increase (or remove) the //uses-sdk/@android:minSdkVersion value in your AndroidManifest.xml.. /// public static string XA4216_MinSdkVersion { get { @@ -981,7 +1101,7 @@ public static string XA4216_MinSdkVersion { } /// - /// Looks up a localized string similar to The deployment target '{1}' is not supported (the minimum is '{2}'). Please increase the $(SupportedOSPlatformVersion) property value in your project file.. + /// Looks up a localized string similar to The deployment target '{0}' is not supported (the minimum is '{1}'). Please increase the $(SupportedOSPlatformVersion) property value in your project file.. /// public static string XA4216_SupportedOSPlatformVersion { get { @@ -1132,16 +1252,16 @@ public static string XA4233 { return ResourceManager.GetString("XA4233", resourceCulture); } } - + /// - /// Looks up a localized string similar to '<{0}>' item '{1}' is missing required metadata '{2}'. + /// Looks up a localized string similar to '<{0}>' item '{1}' is missing required attribute '{2}'.. /// public static string XA4234 { get { return ResourceManager.GetString("XA4234", resourceCulture); } } - + /// /// Looks up a localized string similar to Maven artifact specification '{0}' is invalid. The correct format is 'group_id:artifact_id'.. /// @@ -1150,7 +1270,7 @@ public static string XA4235 { return ResourceManager.GetString("XA4235", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot download Maven artifact '{0}:{1}'. ///- {2}: {3} @@ -1161,27 +1281,17 @@ public static string XA4236 { return ResourceManager.GetString("XA4236", resourceCulture); } } - + /// - /// Looks up a localized string similar to Cannot download POM file for Maven artifact '{0}:{1}'. - ///- {2}: {3}. + /// Looks up a localized string similar to Cannot download POM file for Maven artifact '{0}'. + ///- {1}. /// public static string XA4237 { get { return ResourceManager.GetString("XA4237", resourceCulture); } } - - /// - /// Looks up a localized string similar to Cannot download parent POM file for Maven artifact '{0}:{1}'. - ///- {2}: {3}. - /// - public static string XA4238 { - get { - return ResourceManager.GetString("XA4238", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Unknown Maven repository: '{0}'.. /// @@ -1190,7 +1300,7 @@ public static string XA4239 { return ResourceManager.GetString("XA4239", resourceCulture); } } - + /// /// Looks up a localized string similar to Java dependency '{0}' is not satisfied.. /// @@ -1199,7 +1309,7 @@ public static string XA4241 { return ResourceManager.GetString("XA4241", resourceCulture); } } - + /// /// Looks up a localized string similar to Java dependency '{0}' is not satisfied. Microsoft maintains the NuGet package '{1}' that could fulfill this dependency.. /// @@ -1208,7 +1318,7 @@ public static string XA4242 { return ResourceManager.GetString("XA4242", resourceCulture); } } - + /// /// Looks up a localized string similar to Attribute '{0}' is required when using '{1}' for '{2}' item '{3}'.. /// @@ -1217,7 +1327,7 @@ public static string XA4243 { return ResourceManager.GetString("XA4243", resourceCulture); } } - + /// /// Looks up a localized string similar to Attribute '{0}' cannot be empty for '{1}' item '{2}'.. /// @@ -1226,7 +1336,7 @@ public static string XA4244 { return ResourceManager.GetString("XA4244", resourceCulture); } } - + /// /// Looks up a localized string similar to Specified POM file '{0}' does not exist.. /// @@ -1235,7 +1345,7 @@ public static string XA4245 { return ResourceManager.GetString("XA4245", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not parse POM file '{0}'. ///- {1}. @@ -1245,7 +1355,7 @@ public static string XA4246 { return ResourceManager.GetString("XA4246", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not resolve POM file for artifact '{0}'.. /// @@ -1254,7 +1364,7 @@ public static string XA4247 { return ResourceManager.GetString("XA4247", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not find NuGet package '{0}' version '{1}' in lock file. Ensure NuGet Restore has run since this <PackageReference> was added.. /// @@ -1263,7 +1373,7 @@ public static string XA4248 { return ResourceManager.GetString("XA4248", resourceCulture); } } - + /// /// Looks up a localized string similar to Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.. /// @@ -1528,7 +1638,9 @@ public static string XA5205_Lint { } /// - /// Looks up a localized string similar to Could not find android.jar for API level {0}. This means the Android SDK platform for API level {0} is not installed. {2} See https://aka.ms/xa5207 for more details. + /// Looks up a localized string similar to Could not find android.jar for API level {0}. This means the Android SDK platform for API level {0} is not installed; it was expected to be in `{1}`. + ///{2} + ///See https://aka.ms/xa5207 for more details.. /// public static string XA5207 { get { @@ -1537,20 +1649,20 @@ public static string XA5207 { } /// - /// Looks up a localized string similar to Tools > Android > Android SDK Manager.... + /// Looks up a localized string similar to You can install the missing API level by running `dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"`, or change the project to target an API version that is installed.. /// - public static string XA5207_SDK_Manager_Windows { + public static string XA5207_SDK_Manager_CLI { get { - return ResourceManager.GetString("XA5207_SDK_Manager_Windows", resourceCulture); + return ResourceManager.GetString("XA5207_SDK_Manager_CLI", resourceCulture); } } /// - /// Looks up a localized string similar to Tools > Open Android SDK Manager.... + /// Looks up a localized string similar to Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the .NET for Android project to target an API version that is installed.. /// - public static string XA5207_SDK_Manager_CLI { + public static string XA5207_SDK_Manager_Windows { get { - return ResourceManager.GetString("XA5207_SDK_Manager_CLI", resourceCulture); + return ResourceManager.GetString("XA5207_SDK_Manager_Windows", resourceCulture); } } @@ -1582,7 +1694,8 @@ public static string XA5300_Android_Platforms { } /// - /// Looks up a localized string similar to The Android SDK directory could not be found. Check that the Android SDK Manager in Visual Studio shows a valid installation. To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path.. + /// Looks up a localized string similar to The Android SDK directory could not be found. Install the Android SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk + ///To use a custom SDK path for a command line build, set the 'AndroidSdkDirectory' MSBuild property to the custom path.. /// public static string XA5300_Android_SDK { get { @@ -1591,7 +1704,8 @@ public static string XA5300_Android_SDK { } /// - /// Looks up a localized string similar to The Java SDK directory could not be found. Ensure that the Android section of the Visual Studio options has a valid Java SDK directory configured. To use a custom SDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.. + /// Looks up a localized string similar to The Java SDK directory could not be found. Install the Java SDK by following the instructions at: https://aka.ms/dotnet-android-install-sdk + ///To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MSBuild property to the custom path.. /// public static string XA5300_Java_SDK { get { @@ -1618,69 +1732,11 @@ public static string XA5302 { } /// - /// Looks up a localized string similar to The 'AndroidHttpClientHandlerType' property value '{0}' must derive from '{1}'. - ///Please change the value to an assembly-qualifed type name which inherits from '{1}' or remove the property completely. + /// Looks up a localized string similar to Could not find Android Resource '{0}'. Please update @(AndroidResource) to add the missing resource.. /// - public static string XA1031 { - get { - return ResourceManager.GetString("XA1031", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The 'AndroidHttpClientHandlerType' property value '{0}' must not derive from 'System.Net.Htt.HttpClientHandler'. - ///Please change the value to an assembly-qualifed type name which inherits from 'System.Net.Http.HttpMessageHandler' or remove the property completely. - /// - public static string XA1031_HCH { - get { - return ResourceManager.GetString("XA1031_HCH", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Two processes may be building this project at once. Lock file exists at path: {0}. - /// - public static string XA1032 { - get { - return ResourceManager.GetString("XA1032", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Two processes may be building this project at once. Lock file exists at path: {0}. - /// - public static string XA1033 { - get { - return ResourceManager.GetString("XA1033", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Your project references '{0}' which uses the `_Microsoft.Android.Resource.Designer` assembly, but you do not have this feature enabled. Please set the `AndroidUseDesignerAssembly` MSBuild property to `true` in your project file. - /// - public static string XA1034 { - get { - return ResourceManager.GetString("XA1034", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to AndroidManifest.xml //uses-sdk/@android:minSdkVersion '{0}' does not match the $(SupportedOSPlatformVersion) value '{1}' in the project file (if there is no $(SupportedOSPlatformVersion) value in the project file, then a default value has been assumed). - ///Either change the value in the AndroidManifest.xml to match the $(SupportedOSPlatformVersion) value, or remove the value in the AndroidManifest.xml (and add a $(SupportedOSPlatformVersion) value to the project file if it doesn't already exist).. - /// - public static string XA1036 { - get { - return ResourceManager.GetString("XA1036", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to AndroidManifest.xml //uses-sdk/@android:minSdkVersion '{0}' does not match the $(SupportedOSPlatformVersion) value '{1}' in the project file (if there is no $(SupportedOSPlatformVersion) value in the project file, then a default value has been assumed). - ///Either change the value in the AndroidManifest.xml to match the $(SupportedOSPlatformVersion) value, or remove the value in the AndroidManifest.xml (and add a $(SupportedOSPlatformVersion) value to the project file if it doesn't already exist).. - /// - public static string XA1039 { + public static string XA8000 { get { - return ResourceManager.GetString("XA1039", resourceCulture); + return ResourceManager.GetString("XA8000", resourceCulture); } } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/ELFHelper.cs b/src/Xamarin.Android.Build.Tasks/Utilities/ELFHelper.cs index 1f1e3abbc24..9bee404bb7c 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/ELFHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/ELFHelper.cs @@ -66,7 +66,7 @@ static void AssertValidLibraryAlignment (TaskLoggingHelper log, uint pageSize, s log.LogDebugMessage ($" expected segment alignment of 0x{pageSize:x}, found 0x{segment64.Alignment:x}"); (string packageId, string packageVersion) = GetNugetPackageInfo (); - log.LogCodedWarning ("XA0141", packageId, packageVersion, Path.GetFileName (path)); + log.LogCodedWarning ("XA0141", Properties.Resources.XA0141, packageId, packageVersion, Path.GetFileName (path)); break; }