From f2d1748cf134bbd365237fb73377a5b39ceea0ce Mon Sep 17 00:00:00 2001 From: Marek Habersack Date: Tue, 29 Oct 2024 10:29:17 +0100 Subject: [PATCH] Cleanup --- .../Mono.Android/InstrumentationAttribute.Partial.cs | 2 +- .../Mono.Android/PermissionAttribute.Partial.cs | 2 +- .../Mono.Android/PermissionGroupAttribute.Partial.cs | 2 +- .../Mono.Android/PermissionTreeAttribute.Partial.cs | 2 +- .../Mono.Android/SupportsGLTextureAttribute.Partial.cs | 3 ++- .../Mono.Android/UsesFeatureAttribute.Partial.cs | 3 ++- src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs | 9 --------- tests/MSBuildDeviceIntegration/Tests/InstallTests.cs | 7 +++---- 8 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs index ef1f5833ff2..0facaf53e23 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/InstrumentationAttribute.Partial.cs @@ -11,7 +11,7 @@ namespace Android.App { partial class InstrumentationAttribute { - + ICollection specified; public static IEnumerable FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache) diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs index 16d32e0bf5b..ebabfbc9562 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionAttribute.Partial.cs @@ -16,7 +16,7 @@ namespace Android.App { partial class PermissionAttribute { - + ICollection specified; public static IEnumerable FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache) diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs index 1cda1eefe1b..99cedace7d6 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionGroupAttribute.Partial.cs @@ -16,7 +16,7 @@ namespace Android.App { partial class PermissionGroupAttribute { - + ICollection specified; public static IEnumerable FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache) diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs index 5447164294c..79ca7af4999 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/PermissionTreeAttribute.Partial.cs @@ -16,7 +16,7 @@ namespace Android.App { partial class PermissionTreeAttribute { - + ICollection specified; public static IEnumerable FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache) diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/SupportsGLTextureAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/SupportsGLTextureAttribute.Partial.cs index 1f5cc0c65ec..45f4df2e91e 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/SupportsGLTextureAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/SupportsGLTextureAttribute.Partial.cs @@ -41,9 +41,10 @@ public static IEnumerable FromCustomAttributeProvide SupportsGLTextureAttribute self = new SupportsGLTextureAttribute((string)attr.ConstructorArguments[0].Value); self.specified = mapping.Load (self, attr, cache); self.specified.Add("Name"); - yield return self; + yield return self; } } } } } + diff --git a/src/Xamarin.Android.Build.Tasks/Mono.Android/UsesFeatureAttribute.Partial.cs b/src/Xamarin.Android.Build.Tasks/Mono.Android/UsesFeatureAttribute.Partial.cs index ca62e532f93..d4d832d34f8 100644 --- a/src/Xamarin.Android.Build.Tasks/Mono.Android/UsesFeatureAttribute.Partial.cs +++ b/src/Xamarin.Android.Build.Tasks/Mono.Android/UsesFeatureAttribute.Partial.cs @@ -46,7 +46,7 @@ public static IEnumerable FromCustomAttributeProvider (ICu UsesFeatureAttribute self = new UsesFeatureAttribute (); - if (attr.HasProperties) { + if (attr.HasProperties) { // handle the case where the user sets additional properties self.specified = mapping.Load (self, attr, cache); if (self.specified.Contains("GLESVersion") && self.GLESVersion==0) { @@ -70,3 +70,4 @@ public static IEnumerable FromCustomAttributeProvider (ICu } } } + diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs index b1e09eff3a3..0e92abe4c0a 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs @@ -408,14 +408,11 @@ static Regex FileGlobToRegEx (string fileGlob, RegexOptions options) void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx apk, bool debug, bool compress, IDictionary> compressedAssembliesInfo, string assemblyStoreApkName) { - Log.LogDebugMessage ("g#: in AddAssemblies"); string sourcePath; AssemblyStoreBuilder? storeBuilder = null; if (UseAssemblyStore) { - Log.LogDebugMessage ("g#: assembly store used"); if (AssemblyStoreEmbeddedInRuntime) { - Log.LogDebugMessage ("g#: assembly store embedded in the runtime"); // We don't need to do anything here, the store is in `libxamarin-app.so` return; } @@ -423,20 +420,16 @@ void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx ap storeBuilder = new AssemblyStoreBuilder (Log); } - Log.LogDebugMessage ("g#: adding user assemblies"); // Add user assemblies AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedUserAssemblies, DoAddAssembliesFromArchCollection); - Log.LogDebugMessage ("g#: adding framework assemblies"); // Add framework assemblies AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedFrameworkAssemblies, DoAddAssembliesFromArchCollection); if (!UseAssemblyStore) { - Log.LogDebugMessage ("g#: assembly store not used, returning"); return; } - Log.LogDebugMessage ("g#: generating assembly stores"); Dictionary assemblyStorePaths = storeBuilder.Generate (AppSharedLibrariesDir); if (assemblyStorePaths.Count == 0) { @@ -447,7 +440,6 @@ void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx ap throw new InvalidOperationException ("Internal error: assembly store did not generate store for each supported ABI"); } - Log.LogDebugMessage ($"g#: {assemblyStorePaths.Count} assembly stores added"); string inArchivePath; foreach (var kvp in assemblyStorePaths) { string abi = MonoAndroidHelper.ArchToAbi (kvp.Key); @@ -465,7 +457,6 @@ void DoAddAssembliesFromArchCollection (TaskLoggingHelper log, AndroidTargetArch // or not we're supposed to compress .so files. sourcePath = CompressAssembly (assembly); if (UseAssemblyStore) { - Log.LogDebugMessage ($"g#: adding '{assembly}' to the store"); storeBuilder.AddAssembly (sourcePath, assembly, includeDebugSymbols: debug); return; } diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs index 2a9af46cabc..2e2960dcd03 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs @@ -201,7 +201,6 @@ public void InstallWithoutSharedRuntime () //Assert.AreEqual (0, RunAdbCommand ("shell pm list packages Mono.Android.DebugRuntime").Trim ().Length, // "The Shared Runtime should not have been installed."); var directorylist = GetContentFromAllOverrideDirectories (proj.PackageName, DeviceAbi); - Console.WriteLine ($"InstallWithoutSharedRuntime: directoryList == '{directorylist}'"); StringAssert.Contains ($"{proj.ProjectName}.dll", directorylist, $"{proj.ProjectName}.dll should exist in the .__override__/{DeviceAbi} directory."); StringAssert.Contains ($"System.Private.CoreLib.dll", directorylist, $"System.Private.CoreLib.dll should exist in the .__override__/{DeviceAbi} directory."); StringAssert.Contains ($"Mono.Android.dll", directorylist, $"Mono.Android.dll should exist in the .__override__/{DeviceAbi} directory."); @@ -547,7 +546,7 @@ public void IncrementalFastDeployment (string packageFormat) } long lib1FirstBuildSize = new FileInfo (Path.Combine (rootPath, lib1.ProjectName, lib1.OutputPath, "Library1.dll")).Length; - + using (var builder = CreateApkBuilder (Path.Combine (rootPath, app.ProjectName))) { builder.Verbosity = LoggerVerbosity.Detailed; builder.ThrowOnBuildFailure = false; @@ -654,7 +653,7 @@ public void AppWithAndroidJavaSource () public class TestJavaClass2 { public String test(){ - + return ""Java is called""; } }", @@ -672,7 +671,7 @@ public String test(){ public class TestJavaClass { public String test(){ - + return ""Java is called""; } }",