From 78f6aa1ce9c32807f86e4e5fb0dd8d491ad83c47 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 19 Feb 2014 23:51:55 +0100 Subject: [PATCH] Add build process script for shard sheets --- .../build_gamedata/configuration/tools.py | 1 + .../tools/build_gamedata/leveldesign_dev.bat | 6 +- .../processes/sheet_id/2_build.py | 2 +- .../processes/sheets_shard/0_setup.py | 67 +++++++++++++++++++ .../processes/sheets_shard/1_export.py | 49 ++++++++++++++ .../processes/sheets_shard/2_build.py | 67 +++++++++++++++++++ .../processes/sheets_shard/3_install.py | 57 ++++++++++++++++ 7 files changed, 245 insertions(+), 4 deletions(-) create mode 100644 code/nel/tools/build_gamedata/processes/sheets_shard/0_setup.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets_shard/1_export.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets_shard/2_build.py create mode 100644 code/nel/tools/build_gamedata/processes/sheets_shard/3_install.py diff --git a/code/nel/tools/build_gamedata/configuration/tools.py b/code/nel/tools/build_gamedata/configuration/tools.py index ae205db43..f9cc54964 100644 --- a/code/nel/tools/build_gamedata/configuration/tools.py +++ b/code/nel/tools/build_gamedata/configuration/tools.py @@ -85,6 +85,7 @@ IgElevationTool = "ig_elevation" IgAddTool = "ig_add" BuildClodBankTool = "build_clod_bank" SheetsPackerTool = "sheets_packer" +SheetsPackerShardTool = "sheets_packer_shard" BnpMakeTool = "bnp_make" AiBuildWmapTool = "ai_build_wmap" TgaCutTool = "tga_cut" diff --git a/code/nel/tools/build_gamedata/leveldesign_dev.bat b/code/nel/tools/build_gamedata/leveldesign_dev.bat index 930ff2339..22e6c7fe6 100644 --- a/code/nel/tools/build_gamedata/leveldesign_dev.bat +++ b/code/nel/tools/build_gamedata/leveldesign_dev.bat @@ -1,5 +1,5 @@ -1_export.py -ipj common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg -2_build.py -ipj common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg -3_install.py -ipj common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg +1_export.py -ipj common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg shard/data_shard shard/data_language +2_build.py -ipj common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg shard/data_shard shard/data_language +3_install.py -ipj common/gamedev common/data_common common/data_shard common/leveldesign common/exedll common/cfg shard/data_shard shard/data_language 5_client_dev.py 8_shard_data.py diff --git a/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py index a2932ccb1..b29914913 100644 --- a/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py +++ b/code/nel/tools/build_gamedata/processes/sheet_id/2_build.py @@ -54,7 +54,7 @@ if MakeSheetId == "": else: mkPath(log, LeveldesignDirectory) mkPath(log, LeveldesignWorldDirectory) - subprocess.call([ MakeSheetId, "-o" + LeveldesignDirectory + "/game_elem/sheet_id.bin", LeveldesignDirectory + "/game_elem", LeveldesignDirectory + "/game_element", LeveldesignWorldDirectory, DataShardDirectory + "mirror_sheets" ]) + subprocess.call([ MakeSheetId, "-o" + LeveldesignDirectory + "/game_elem/sheet_id.bin", LeveldesignDirectory + "/game_elem", LeveldesignDirectory + "/game_element", LeveldesignWorldDirectory, DataShardDirectory + "/mirror_sheets" ]) # FIXME: Hardcoded path mirror_sheets printLog(log, "") log.close() diff --git a/code/nel/tools/build_gamedata/processes/sheets_shard/0_setup.py b/code/nel/tools/build_gamedata/processes/sheets_shard/0_setup.py new file mode 100644 index 000000000..bc3024f3b --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets_shard/0_setup.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 0_setup.py +# \brief Setup sheets +# \date 2014-02-19 22:39GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Setup shard sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010-2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Setup shard sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Setup source directories +printLog(log, ">>> Setup source directories <<<") +mkPath(log, LeveldesignDirectory) +mkPath(log, LeveldesignDfnDirectory) +mkPath(log, ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory) +mkPath(log, DataShardDirectory + "/mirror_sheets") # FIXME: Hardcoded path mirror_sheets + +# Setup export directories +printLog(log, ">>> Setup export directories <<<") + +# Setup build directories +printLog(log, ">>> Setup build directories <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetsShardBuildDirectory) + +# Setup client directories +printLog(log, ">>> Setup client directories <<<") +mkPath(log, InstallDirectory + "/" + SheetsShardInstallDirectory) + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets_shard/1_export.py b/code/nel/tools/build_gamedata/processes/sheets_shard/1_export.py new file mode 100644 index 000000000..650e0307d --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets_shard/1_export.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# \file 1_export.py +# \brief Export sheets +# \date 2014-02-19 22:39GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Export shard sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010-2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Export shard sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets_shard/2_build.py b/code/nel/tools/build_gamedata/processes/sheets_shard/2_build.py new file mode 100644 index 000000000..c66de2b28 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets_shard/2_build.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# +# \file 2_build.py +# \brief Build sheets +# \date 2014-02-19 22:39GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Build shard sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010-2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Build sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +# Find tools +SheetsPackerShard = findTool(log, ToolDirectories, SheetsPackerShardTool, ToolSuffix) +printLog(log, "") + +# For each sheets directory +printLog(log, ">>> Build shard sheets <<<") +if SheetsPackerShard == "": + toolLogFail(log, SheetsPackerShardTool, ToolSuffix) +else: + mkPath(log, LeveldesignDirectory) + mkPath(log, LeveldesignDfnDirectory) + mkPath(log, ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory) + mkPath(log, DataShardDirectory + "/mirror_sheets") # FIXME: Hardcoded path mirror_sheets + mkPath(log, ExportBuildDirectory + "/" + SheetsShardBuildDirectory) + # sheets_packer_shard + subprocess.call([ SheetsPackerShard, LeveldesignDirectory, LeveldesignDfnDirectory, DataShardDirectory + "/mirror_sheets", ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory, ExportBuildDirectory + "/" + SheetsShardBuildDirectory ]) +printLog(log, "") + +log.close() + + +# end of file diff --git a/code/nel/tools/build_gamedata/processes/sheets_shard/3_install.py b/code/nel/tools/build_gamedata/processes/sheets_shard/3_install.py new file mode 100644 index 000000000..ba7e1a8a8 --- /dev/null +++ b/code/nel/tools/build_gamedata/processes/sheets_shard/3_install.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# +# \file 3_install.py +# \brief Install sheets +# \date 2014-02-19 22:39GMT +# \author Jan Boon (Kaetemi) +# Python port of game data build pipeline. +# Install shard sheets +# +# NeL - MMORPG Framework +# Copyright (C) 2010-2014 by authors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import time, sys, os, shutil, subprocess, distutils.dir_util +sys.path.append("../../configuration") + +if os.path.isfile("log.log"): + os.remove("log.log") +log = open("log.log", "w") +from scripts import * +from buildsite import * +from process import * +from tools import * +from directories import * + +printLog(log, "") +printLog(log, "-------") +printLog(log, "--- Install shard sheets") +printLog(log, "-------") +printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time()))) +printLog(log, "") + +installPath = InstallDirectory + "/" + SheetsShardInstallDirectory +mkPath(log, installPath) + +printLog(log, ">>> Install sheets <<<") +mkPath(log, ExportBuildDirectory + "/" + SheetsShardBuildDirectory) +copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + SheetsShardBuildDirectory, installPath, ".packed_sheets") + +printLog(log, "") +log.close() + + +# end of file