Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
grendello committed Oct 30, 2024
1 parent dc93adc commit 04b4ab8
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Android.App {

partial class InstrumentationAttribute {

ICollection<string> specified;

public static IEnumerable<InstrumentationAttribute> FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace Android.App {

partial class PermissionAttribute {

ICollection<string> specified;

public static IEnumerable<PermissionAttribute> FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace Android.App {

partial class PermissionGroupAttribute {

ICollection<string> specified;

public static IEnumerable<PermissionGroupAttribute> FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace Android.App {

partial class PermissionTreeAttribute {

ICollection<string> specified;

public static IEnumerable<PermissionTreeAttribute> FromCustomAttributeProvider (ICustomAttributeProvider provider, TypeDefinitionCache cache)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ public static IEnumerable<SupportsGLTextureAttribute> 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;
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static IEnumerable<UsesFeatureAttribute> 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) {
Expand All @@ -70,3 +70,4 @@ public static IEnumerable<UsesFeatureAttribute> FromCustomAttributeProvider (ICu
}
}
}

9 changes: 0 additions & 9 deletions src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,35 +408,28 @@ static Regex FileGlobToRegEx (string fileGlob, RegexOptions options)

void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx apk, bool debug, bool compress, IDictionary<AndroidTargetArch, Dictionary<string, CompressedAssemblyInfo>> 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;
}

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<AndroidTargetArch, string> assemblyStorePaths = storeBuilder.Generate (AppSharedLibrariesDir);

if (assemblyStorePaths.Count == 0) {
Expand All @@ -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);
Expand All @@ -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;
}
Expand Down
7 changes: 3 additions & 4 deletions tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -654,7 +653,7 @@ public void AppWithAndroidJavaSource ()
public class TestJavaClass2 {
public String test(){
return ""Java is called"";
}
}",
Expand All @@ -672,7 +671,7 @@ public String test(){
public class TestJavaClass {
public String test(){
return ""Java is called"";
}
}",
Expand Down

0 comments on commit 04b4ab8

Please sign in to comment.