Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / build_gamedata / processes / interface / 2_build.py
blobaf25b919ea2a743e8264518a7068e97f8ce4d06f
1 #!/usr/bin/python
2 #
3 # \file 2_build.py
4 # \brief Build interface
5 # \date 2009-03-10 13:13GMT
6 # \author Jan Boon (Kaetemi)
7 # Python port of game data build pipeline.
8 # Build interface
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 interface")
42 printLog(log, "-------")
43 printLog(log, time.strftime("%Y-%m-%d %H:%MGMT", time.gmtime(time.time())))
44 printLog(log, "")
46 # Find tools
47 BuildInterface = findTool(log, ToolDirectories, BuildInterfaceTool, ToolSuffix)
48 printLog(log, "")
50 # For each interface directory
51 printLog(log, ">>> Build interface <<<")
52 if BuildInterface == "":
53 toolLogFail(log, BuildInterfaceTool, ToolSuffix)
54 else:
55 mkPath(log, ExportBuildDirectory + "/" + InterfaceBuildDirectory)
56 for dir in os.listdir(ExportBuildDirectory + "/" + InterfaceExportDirectory):
57 dirPath = ExportBuildDirectory + "/" + InterfaceExportDirectory + "/" + dir
58 if (os.path.isdir(dirPath)) and dir != ".svn" and dir != "*.*":
59 texturePath = ExportBuildDirectory + "/" + InterfaceBuildDirectory + "/texture_" + dir + ".tga"
60 if needUpdateDirNoSubdirFile(log, dirPath, texturePath):
61 subprocess.call([ BuildInterface, texturePath, dirPath ])
62 else:
63 printLog(log, "SKIP " + texturePath)
64 printLog(log, "")
66 # For each interface directory to compress in one DXTC
67 printLog(log, ">>> Build interface dxtc <<<")
68 if BuildInterface == "":
69 toolLogFail(log, BuildInterfaceTool, ToolSuffix)
70 else:
71 mkPath(log, ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory)
72 dirPath = ExportBuildDirectory + "/" + InterfaceDxtcExportDirectory
73 texturePath = ExportBuildDirectory + "/" + InterfaceDxtcBuildDirectory + "/texture_interfaces_dxtc.tga"
74 if needUpdateDirNoSubdirFile(log, dirPath, texturePath):
75 subprocess.call([ BuildInterface, texturePath, dirPath ])
76 else:
77 printLog(log, "SKIP " + texturePath)
78 printLog(log, "")
80 log.close()
83 # end of file