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 = [
"Dapper.dll"
"Content.Server.Database.dll"
]
def main() -> None:
@@ -87,8 +87,14 @@ def main() -> None:
nargs="*",
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()
platforms = args.platform
skip_build = args.skip_build
if not platforms:
platforms = [PLATFORM_WINDOWS, PLATFORM_MACOS, PLATFORM_LINUX]
@@ -100,16 +106,19 @@ def main() -> None:
os.mkdir("release")
if PLATFORM_WINDOWS in platforms:
if not skip_build:
wipe_bin()
build_windows()
build_windows(skip_build)
if PLATFORM_LINUX in platforms:
if not skip_build:
wipe_bin()
build_linux()
build_linux(skip_build)
if PLATFORM_MACOS in platforms:
if not skip_build:
wipe_bin()
build_macos()
build_macos(skip_build)
def wipe_bin():
@@ -122,10 +131,11 @@ def wipe_bin():
shutil.rmtree("bin")
def build_windows(): # type: () -> None
def build_windows(skip_build: bool) -> None:
# Run a full build.
print(Fore.GREEN + "Building project for Windows x64..." + Style.RESET_ALL)
if not skip_build:
subprocess.run([
"dotnet",
"build",
@@ -161,9 +171,10 @@ def build_windows(): # type: () -> None
copy_content_assemblies(p("Resources", "Assemblies"), server_zip, server=True)
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)
if not skip_build:
subprocess.run([
"dotnet",
"build",
@@ -200,10 +211,11 @@ def build_macos() -> None:
server_zip.close()
def build_linux() -> None:
def build_linux(skip_build: bool) -> None:
# Run a full build.
print(Fore.GREEN + "Building project for Linux x64..." + Style.RESET_ALL)
if not skip_build:
subprocess.run([
"dotnet",
"build",
@@ -324,6 +336,10 @@ def copy_content_assemblies(target, zipf, server):
if server:
source_dir = p("bin", "Content.Server")
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:
source_dir = p("bin", "Content.Client")
files = ["Content.Shared.dll", "Content.Client.dll"]