Skip to content

Commit 474a1af

Browse files
authored
[android][tests] Do not package unused CoreCLR libs when building test apks (#113209)
1 parent 1110cfb commit 474a1af

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/tasks/AndroidAppBuilder/ApkBuilder.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,20 @@ public ApkBuilder(TaskLoggingHelper logger)
448448
}
449449
else
450450
{
451-
dynamicLibs.AddRange(Directory.GetFiles(AppDir, "*.so").Where(file => Path.GetFileName(file) != "libmonodroid.so"));
451+
var excludedLibs = new HashSet<string> { "libmonodroid.so" };
452+
if (IsCoreCLR)
453+
{
454+
// exclude standalone GC libs
455+
excludedLibs.Add("libclrgc.so");
456+
excludedLibs.Add("libclrgcexp.so");
457+
if (StripDebugSymbols)
458+
{
459+
// exclude debugger support libs
460+
excludedLibs.Add("libmscordbi.so");
461+
excludedLibs.Add("libmscordaccore.so");
462+
}
463+
}
464+
dynamicLibs.AddRange(Directory.GetFiles(AppDir, "*.so").Where(file => !excludedLibs.Contains(Path.GetFileName(file))));
452465
}
453466

454467
// add all *.so files to lib/%abi%/

0 commit comments

Comments
 (0)