4 # \brief Run all export processes
5 # \date 2009-02-18 09:22GMT
6 # \author Jan Boon (Kaetemi)
7 # Python port of game data build pipeline.
8 # Run all export processes
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
, argparse
28 sys
.path
.append("configuration")
30 parser
= argparse
.ArgumentParser(description
='Ryzom Core - Build Gamedata - Export')
31 # parser.add_argument('--haltonerror', '-eh', action='store_true')
32 parser
.add_argument('--includeproject', '-ipj', nargs
='+')
33 parser
.add_argument('--excludeproject', '-epj', nargs
='+')
34 parser
.add_argument('--includeprocess', '-ipc', nargs
='+')
35 parser
.add_argument('--excludeprocess', '-epc', nargs
='+')
36 args
= parser
.parse_args()
38 if not args
.includeproject
== None and not args
.excludeproject
== None:
39 print "ERROR --includeproject cannot be combined with --excludeproject, exit."
42 if not args
.includeprocess
== None and not args
.excludeprocess
== None:
43 print "ERROR --includeprocess cannot be combined with --excludeprocess, exit."
46 if os
.path
.isfile("log.log"):
48 log
= open("log.log", "w")
50 from buildsite_local
import *
53 sys
.path
.append(WorkspaceDirectory
)
54 from projects
import *
58 printLog(log
, "-------")
59 printLog(log
, "--- Run the export processes")
60 printLog(log
, "-------")
61 printLog(log
, time
.strftime("%Y-%m-%d %H:%MGMT", time
.gmtime(time
.time())))
64 for projectName
in ProjectsToProcess
:
65 if ((args
.includeproject
== None or projectName
in args
.includeproject
) and (args
.excludeproject
== None or not projectName
in args
.excludeproject
)):
66 printLog(log
, "PROJECT " + projectName
)
67 os
.putenv("NELBUILDACTIVEPROJECT", os
.path
.abspath(WorkspaceDirectory
+ "/" + projectName
))
70 if not args
.includeprocess
== None:
71 subprocess
.call([ "python", "1_export.py", "--includeprocess" ] + args
.includeprocess
)
72 elif not args
.excludeprocess
== None:
73 subprocess
.call([ "python", "1_export.py", "--excludeprocess" ] + args
.excludeprocess
)
75 subprocess
.call([ "python", "1_export.py" ])
77 printLog(log
, "<" + projectName
+ "> " + str(e
))
80 projectLog
= open("processes/log.log", "r")
81 projectLogData
= projectLog
.read()
83 log
.write(projectLogData
)
85 printLog(log
, "<" + projectName
+ "> " + str(e
))
87 printLog(log
, "IGNORE PROJECT " + projectName
)
91 if os
.path
.isfile("1_export.log"):
92 os
.remove("1_export.log")
93 shutil
.copy("log.log", time
.strftime("%Y-%m-%d-%H-%M-GMT", time
.gmtime(time
.time())) + "_export.log")
94 shutil
.move("log.log", "1_export.log")