Fix package_release_build.py to work with the new EFCore databases.

This commit is contained in:
Pieter-Jan Briers
2020-01-18 02:48:08 +01:00
parent a4e369e629
commit 47f33e002d

View File

@@ -74,7 +74,7 @@ MAC_NATIVES = {
} }
SERVER_EXTRA_CONTENT_ASSEMBLIES = [ SERVER_EXTRA_CONTENT_ASSEMBLIES = [
"Dapper.dll" "Content.Server.Database.dll"
] ]
def main() -> None: def main() -> None:
@@ -87,8 +87,14 @@ def main() -> None:
nargs="*", nargs="*",
help="Which platform to build for. If not provided, all platforms will be built") help="Which platform to build for. If not provided, all platforms will be built")
parser.add_argument("--skip-build",
action="store_true",
help=argparse.SUPPRESS)
args = parser.parse_args() args = parser.parse_args()
platforms = args.platform platforms = args.platform
skip_build = args.skip_build
if not platforms: if not platforms:
platforms = [PLATFORM_WINDOWS, PLATFORM_MACOS, PLATFORM_LINUX] platforms = [PLATFORM_WINDOWS, PLATFORM_MACOS, PLATFORM_LINUX]
@@ -100,16 +106,19 @@ def main() -> None:
os.mkdir("release") os.mkdir("release")
if PLATFORM_WINDOWS in platforms: if PLATFORM_WINDOWS in platforms:
if not skip_build:
wipe_bin() wipe_bin()
build_windows() build_windows(skip_build)
if PLATFORM_LINUX in platforms: if PLATFORM_LINUX in platforms:
if not skip_build:
wipe_bin() wipe_bin()
build_linux() build_linux(skip_build)
if PLATFORM_MACOS in platforms: if PLATFORM_MACOS in platforms:
if not skip_build:
wipe_bin() wipe_bin()
build_macos() build_macos(skip_build)
def wipe_bin(): def wipe_bin():
@@ -122,10 +131,11 @@ def wipe_bin():
shutil.rmtree("bin") shutil.rmtree("bin")
def build_windows(): # type: () -> None def build_windows(skip_build: bool) -> None:
# Run a full build. # Run a full build.
print(Fore.GREEN + "Building project for Windows x64..." + Style.RESET_ALL) print(Fore.GREEN + "Building project for Windows x64..." + Style.RESET_ALL)
if not skip_build:
subprocess.run([ subprocess.run([
"dotnet", "dotnet",
"build", "build",
@@ -161,9 +171,10 @@ def build_windows(): # type: () -> None
copy_content_assemblies(p("Resources", "Assemblies"), server_zip, server=True) copy_content_assemblies(p("Resources", "Assemblies"), server_zip, server=True)
server_zip.close() server_zip.close()
def build_macos() -> None: def build_macos(skip_build: bool) -> None:
print(Fore.GREEN + "Building project for macOS x64..." + Style.RESET_ALL) print(Fore.GREEN + "Building project for macOS x64..." + Style.RESET_ALL)
if not skip_build:
subprocess.run([ subprocess.run([
"dotnet", "dotnet",
"build", "build",
@@ -200,10 +211,11 @@ def build_macos() -> None:
server_zip.close() server_zip.close()
def build_linux() -> None: def build_linux(skip_build: bool) -> None:
# Run a full build. # Run a full build.
print(Fore.GREEN + "Building project for Linux x64..." + Style.RESET_ALL) print(Fore.GREEN + "Building project for Linux x64..." + Style.RESET_ALL)
if not skip_build:
subprocess.run([ subprocess.run([
"dotnet", "dotnet",
"build", "build",
@@ -324,6 +336,10 @@ def copy_content_assemblies(target, zipf, server):
if server: if server:
source_dir = p("bin", "Content.Server") source_dir = p("bin", "Content.Server")
files = ["Content.Shared.dll", "Content.Server.dll"] + SERVER_EXTRA_CONTENT_ASSEMBLIES files = ["Content.Shared.dll", "Content.Server.dll"] + SERVER_EXTRA_CONTENT_ASSEMBLIES
for filename in os.listdir(source_dir):
if filename.startswith("Microsoft."):
files.append(filename)
else: else:
source_dir = p("bin", "Content.Client") source_dir = p("bin", "Content.Client")
files = ["Content.Shared.dll", "Content.Client.dll"] files = ["Content.Shared.dll", "Content.Client.dll"]