Fixed shared Csharp src files not being included if there weren't also architecture-specific files.

This commit is contained in:
MapleWheels
2026-04-07 16:07:55 -04:00
parent df0a4e62f5
commit 232f7203e2

View File

@@ -320,6 +320,7 @@ public sealed class ModConfigService : IModConfigService
foreach (var searchPathways in srcSearchInd)
{
// we have architecture dependent files as well
if (_storageService.FindFilesInPackage(srcPackage, searchPathways.SubFolder, "*.cs",
true) is { IsSuccess: true, Value.IsDefaultOrEmpty: false } result)
{
@@ -342,6 +343,25 @@ public sealed class ModConfigService : IModConfigService
IsReferenceModeOnly = false
});
}
// add the shared files by themselves
else if (!sharedFiles.IsDefaultOrEmpty)
{
builder.Add(new AssemblyResourceInfo()
{
OwnerPackage = srcPackage,
InternalName = searchPathways.SubFolder,
SupportedPlatforms = searchPathways.Platforms,
SupportedTargets = searchPathways.Targets,
LoadPriority = 0,
FilePaths = sharedFiles,
FriendlyName = IAssemblyLoaderService.InternalsAwareAssemblyName,
IncompatiblePackages = ImmutableArray<Identifier>.Empty,
RequiredPackages = ImmutableArray<Identifier>.Empty,
UseInternalAccessName = true,
IsScript = true,
IsReferenceModeOnly = false
});
}
}
return builder.ToImmutable();