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:
wipe_bin() if not skip_build:
build_windows() wipe_bin()
build_windows(skip_build)
if PLATFORM_LINUX in platforms: if PLATFORM_LINUX in platforms:
wipe_bin() if not skip_build:
build_linux() wipe_bin()
build_linux(skip_build)
if PLATFORM_MACOS in platforms: if PLATFORM_MACOS in platforms:
wipe_bin() if not skip_build:
build_macos() wipe_bin()
build_macos(skip_build)
def wipe_bin(): def wipe_bin():
@@ -122,23 +131,24 @@ 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)
subprocess.run([ if not skip_build:
"dotnet", subprocess.run([
"build", "dotnet",
"SpaceStation14.sln", "build",
"-c", "Release", "SpaceStation14.sln",
"--nologo", "-c", "Release",
"/v:m", "--nologo",
"/p:TargetOS=Windows", "/v:m",
"/t:Rebuild", "/p:TargetOS=Windows",
"/p:FullRelease=True" "/t:Rebuild",
], check=True) "/p:FullRelease=True"
], check=True)
publish_client_server("win-x64", "Windows") publish_client_server("win-x64", "Windows")
print(Fore.GREEN + "Packaging Windows x64 client..." + Style.RESET_ALL) print(Fore.GREEN + "Packaging Windows x64 client..." + Style.RESET_ALL)
@@ -161,22 +171,23 @@ 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)
subprocess.run([ if not skip_build:
"dotnet", subprocess.run([
"build", "dotnet",
"SpaceStation14.sln", "build",
"-c", "Release", "SpaceStation14.sln",
"--nologo", "-c", "Release",
"/v:m", "--nologo",
"/p:TargetOS=MacOS", "/v:m",
"/t:Rebuild", "/p:TargetOS=MacOS",
"/p:FullRelease=True" "/t:Rebuild",
], check=True) "/p:FullRelease=True"
], check=True)
publish_client_server("osx-x64", "MacOS") publish_client_server("osx-x64", "MacOS")
print(Fore.GREEN + "Packaging macOS x64 client..." + Style.RESET_ALL) print(Fore.GREEN + "Packaging macOS x64 client..." + Style.RESET_ALL)
# Client has to go in an app bundle. # Client has to go in an app bundle.
@@ -200,23 +211,24 @@ 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)
subprocess.run([ if not skip_build:
"dotnet", subprocess.run([
"build", "dotnet",
"SpaceStation14.sln", "build",
"-c", "Release", "SpaceStation14.sln",
"--nologo", "-c", "Release",
"/v:m", "--nologo",
"/p:TargetOS=Linux", "/v:m",
"/t:Rebuild", "/p:TargetOS=Linux",
"/p:FullRelease=True" "/t:Rebuild",
], check=True) "/p:FullRelease=True"
], check=True)
publish_client_server("linux-x64", "Linux") publish_client_server("linux-x64", "Linux")
print(Fore.GREEN + "Packaging Linux x64 client..." + Style.RESET_ALL) print(Fore.GREEN + "Packaging Linux x64 client..." + Style.RESET_ALL)
@@ -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"]