Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / build_gamedata / processes / sheets / 2_build.py
blobea8f899d2e9984211765eeff0a75f4a4b6f4df66
1 #!/usr/bin/python
2 #
3 # \file 2_build.py
4 # \brief Build sheets
5 # \date 2009-06-03 10:47GMT
6 # \author Jan Boon (Kaetemi)
7 # Python port of game data build pipeline.
8 # Build sheets
9 #
10 # NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
11 # Copyright (C) 2009-2014 by authors
13 # This program is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU Affero General Public License as
15 # published by the Free Software Foundation, either version 3 of the
16 # License, or (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU Affero General Public License for more details.
23 # You should have received a copy of the GNU Affero General Public License
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 import time, sys, os, shutil, subprocess, distutils.dir_util
28 sys.path.append("../../configuration")
30 if os.path.isfile("log.log"):
31 os.remove("log.log")
32 log = open("log.log", "w")
33 from scripts import *
34 from buildsite import *
35 from process import *
36 from tools import *
37 from directories import *
39 printLog(log, "")
40 printLog(log, "-------")
41 printLog(log, "--- Build sheets")
42 printLog(log, "-------")
43 printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
44 printLog(log, "")
46 # Find tools
47 SheetsPacker = findTool(log, ToolDirectories, SheetsPackerTool, ToolSuffix)
48 printLog(log, "")
50 # For each sheets directory
51 printLog(log, ">>> Build sheets <<<")
52 if SheetsPacker == "":
53 toolLogFail(log, SheetsPackerTool, ToolSuffix)
54 else:
55 mkPath(log, LeveldesignDirectory)
56 mkPath(log, LeveldesignDfnDirectory)
57 mkPath(log, DataCommonDirectory)
58 mkPath(log, GamedevDirectory)
59 mkPath(log, PrimitivesDirectory)
60 mkPath(log, ExportBuildDirectory + "/" + SheetsBuildDirectory)
61 cf = open("sheets_packer.cfg", "w")
62 cf.write("\n")
63 cf.write("// SHEETS PACKER CONFIG FILE\n")
64 cf.write("\n")
65 cf.write("DataPath = \n")
66 cf.write("{\n")
67 cf.write("\t\"" + LeveldesignDirectory + "\", \n")
68 cf.write("\t\"" + LeveldesignDfnDirectory + "\", \n")
69 cf.write("\t\"" + DataCommonDirectory + "\", \n")
70 cf.write("\t\"" + GamedevDirectory + "\", \n")
71 cf.write("\t\"" + PrimitivesDirectory + "\", \n")
72 cf.write("};\n")
73 cf.write("WorldSheet = \"" + WorldSheet + "\";\n")
74 cf.write("PrimitivesPath = \"" + PrimitivesDirectory + "\";\n")
75 cf.write("OutputDataPath = \"" + ExportBuildDirectory + "/" + SheetsBuildDirectory + "\";\n")
76 cf.write("LigoPrimitiveClass = \"" + LigoPrimitiveClass + "\";\n")
77 cf.write("\n")
78 cf.close()
79 subprocess.call([ SheetsPacker ])
80 mkPath(log, ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory)
81 copyFileIfNeeded(log, "visual_slot.tab", ExportBuildDirectory + "/" + VisualSlotTabBuildDirectory + "/visual_slot.tab")
82 os.remove("visual_slot.tab")
83 printLog(log, "")
85 log.close()
88 # end of file