Make package_release_build.py include PDBs if available.

This commit is contained in:
Pieter-Jan Briers
2020-08-15 00:30:02 +02:00
parent b2709733a5
commit f598c6e8c6

View File

@@ -84,8 +84,23 @@ MAC_NATIVES = {
"libfreetype.6.dylib"
}
SERVER_EXTRA_CONTENT_ASSEMBLIES = [
"Content.Server.Database.dll"
# Assembly names to copy from content.
# PDBs are included if available, .dll/.pdb appended automatically.
SERVER_CONTENT_ASSEMBLIES = [
"Content.Server.Database",
"Content.Server",
"Content.Shared"
]
CLIENT_CONTENT_ASSEMBLIES = [
"Content.Client",
"Content.Shared"
]
# Extra assemblies to copy on the server, with a startswith
SERVER_EXTRA_ASSEMBLIES = [
"Npgsql.",
"Microsoft",
]
def main() -> None:
@@ -381,16 +396,29 @@ def copy_dir_into_zip(directory, basepath, zipf):
def copy_content_assemblies(target, zipf, server):
files = []
if server:
source_dir = p("bin", "Content.Server")
files = ["Content.Shared.dll", "Content.Server.dll"] + SERVER_EXTRA_CONTENT_ASSEMBLIES
base_assemblies = SERVER_CONTENT_ASSEMBLIES
# Additional assemblies that need to be copied such as EFCore.
for filename in os.listdir(source_dir):
if filename.startswith("Microsoft.") or filename.startswith("Npgsql."):
files.append(filename)
for extra_assembly_start in SERVER_EXTRA_ASSEMBLIES:
if filename.startswith(extra_assembly_start):
files.append(filename)
break
else:
source_dir = p("bin", "Content.Client")
files = ["Content.Shared.dll", "Content.Client.dll"]
base_assemblies = CLIENT_CONTENT_ASSEMBLIES
# Include content assemblies.
for asm in base_assemblies:
files.append(asm + ".dll")
# If PDB available, include it aswell.
pdb_path = asm + ".pdb"
if os.path.exists(p(source_dir, pdb_path)):
files.append(pdb_path)
# Write assemblies dir if necessary.
if not zip_entry_exists(zipf, target):