Skip to content

Commit

Permalink
Process generated executable package projects
Browse files Browse the repository at this point in the history
  • Loading branch information
kaetemi committed Apr 28, 2022
1 parent 255acb2 commit 59e715e
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 21 deletions.
29 changes: 18 additions & 11 deletions nel/tools/build_gamedata/0_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@
try:
if args.preset:
DummyUnknownName
WindowsExeDllCfgDirectories
ExeDllCfgDirectories
except NameError:
# For legacy exedll bnp only
WindowsExeDllCfgDirectories = [ '', '', '', '', '', '', '' ]
ExeDllCfgDirectories = [ '', '', '', 'R:/code/ryzom/client', '', '', '' ]
try:
if args.preset:
DummyUnknownName
Expand Down Expand Up @@ -388,13 +388,13 @@
LeveldesignDataShardDirectory = askVar(log, "[IN] Leveldesign Data Shard Directory", LeveldesignDataShardDirectory).replace("\\", "/")
LeveldesignDataCommonDirectory = askVar(log, "[IN] Leveldesign Data Common Directory", LeveldesignDataCommonDirectory).replace("\\", "/")
WorldEditorFilesDirectory = askVar(log, "[IN] World Editor Files Directory", WorldEditorFilesDirectory).replace("\\", "/")
WindowsExeDllCfgDirectories[0] = askVar(log, "[IN] Primary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[0]).replace("\\", "/")
WindowsExeDllCfgDirectories[1] = askVar(log, "[IN] Secondary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[1]).replace("\\", "/")
WindowsExeDllCfgDirectories[2] = askVar(log, "[IN] Tertiary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[2]).replace("\\", "/")
WindowsExeDllCfgDirectories[3] = askVar(log, "[IN] Quaternary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[3]).replace("\\", "/")
WindowsExeDllCfgDirectories[4] = askVar(log, "[IN] Quinary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[4]).replace("\\", "/")
WindowsExeDllCfgDirectories[5] = askVar(log, "[IN] Senary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[5]).replace("\\", "/")
WindowsExeDllCfgDirectories[6] = askVar(log, "[IN] Septenary Windows exe/dll/cfg Directory", WindowsExeDllCfgDirectories[6]).replace("\\", "/")
ExeDllCfgDirectories[0] = askVar(log, "[IN] Primary Windows exe/dll/cfg Directory", ExeDllCfgDirectories[0]).replace("\\", "/")
ExeDllCfgDirectories[1] = askVar(log, "[IN] Secondary Windows exe/dll/cfg Directory", ExeDllCfgDirectories[1]).replace("\\", "/")
ExeDllCfgDirectories[2] = askVar(log, "[IN] Tertiary Windows exe/dll/cfg Directory", ExeDllCfgDirectories[2]).replace("\\", "/")
ExeDllCfgDirectories[3] = askVar(log, "[IN] Quaternary Windows exe/dll/cfg Directory", ExeDllCfgDirectories[3]).replace("\\", "/")
ExeDllCfgDirectories[4] = askVar(log, "[IN] Quinary Windows exe/dll/cfg Directory", ExeDllCfgDirectories[4]).replace("\\", "/")
ExeDllCfgDirectories[5] = askVar(log, "[IN] Senary Windows exe/dll/cfg Directory", ExeDllCfgDirectories[5]).replace("\\", "/")
ExeDllCfgDirectories[6] = askVar(log, "[IN] Septenary Windows exe/dll/cfg Directory", ExeDllCfgDirectories[6]).replace("\\", "/")
LinuxServiceExecutableDirectories[0] = askVar(log, "[IN] Linux Service Executable Directory", LinuxServiceExecutableDirectories[0]).replace("\\", "/")
PatchmanDevDirectory = askVar(log, "[IN] Patchman Directory", PatchmanDevDirectory).replace("\\", "/")
PatchmanCfgAdminDirectory = askVar(log, "[IN] Patchman Cfg Admin Directory", PatchmanCfgAdminDirectory).replace("\\", "/")
Expand Down Expand Up @@ -533,7 +533,7 @@
sf.write("GamedevDirectory = \"" + str(GamedevDirectory) + "\"\n")
sf.write("DataCommonDirectory = \"" + str(DataCommonDirectory) + "\"\n")
sf.write("DataShardDirectory = \"" + str(DataShardDirectory) + "\"\n")
sf.write("WindowsExeDllCfgDirectories = " + str(WindowsExeDllCfgDirectories) + "\n")
sf.write("ExeDllCfgDirectories = " + str(ExeDllCfgDirectories) + "\n")
sf.write("LinuxServiceExecutableDirectories = " + str(LinuxServiceExecutableDirectories) + "\n")
sf.write("PatchmanDevDirectory = \"" + str(PatchmanDevDirectory) + "\"\n")
sf.write("PatchmanCfgAdminDirectory = \"" + str(PatchmanCfgAdminDirectory) + "\"\n")
Expand Down Expand Up @@ -573,6 +573,10 @@
sys.path.append(WorkspaceDirectory)
from projects import *

NeLWorkspaceDir = None
if NeLConfigDir:
NeLWorkspaceDir = os.path.join(NeLConfigDir, "workspace")

printLog(log, "")
printLog(log, "-------")
printLog(log, "--- Run the setup projects")
Expand All @@ -583,7 +587,10 @@
for projectName in ProjectsToProcess:
if ((args.includeproject == None or projectName in args.includeproject) and (args.excludeproject == None or not projectName in args.excludeproject)):
printLog(log, "PROJECT " + projectName)
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
if os.path.isfile(os.path.join(os.path.join(NeLWorkspaceDir, projectName), "process.py")):
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(os.path.join(NeLWorkspaceDir, projectName).replace("\\", "/")))
else:
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
os.chdir("processes")
try:
if not args.includeprocess == None:
Expand Down
9 changes: 8 additions & 1 deletion nel/tools/build_gamedata/1_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
sys.path.append(WorkspaceDirectory)
from projects import *

NeLWorkspaceDir = None
if NeLConfigDir:
NeLWorkspaceDir = os.path.join(NeLConfigDir, "workspace")

# Log error
printLog(log, "")
printLog(log, "-------")
Expand All @@ -64,7 +68,10 @@
for projectName in ProjectsToProcess:
if ((args.includeproject == None or projectName in args.includeproject) and (args.excludeproject == None or not projectName in args.excludeproject)):
printLog(log, "PROJECT " + projectName)
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
if os.path.isfile(os.path.join(os.path.join(NeLWorkspaceDir, projectName), "process.py")):
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(os.path.join(NeLWorkspaceDir, projectName).replace("\\", "/")))
else:
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
os.chdir("processes")
try:
if not args.includeprocess == None:
Expand Down
9 changes: 8 additions & 1 deletion nel/tools/build_gamedata/2_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
sys.path.append(WorkspaceDirectory)
from projects import *

NeLWorkspaceDir = None
if NeLConfigDir:
NeLWorkspaceDir = os.path.join(NeLConfigDir, "workspace")

# Log error
printLog(log, "")
printLog(log, "-------")
Expand All @@ -64,7 +68,10 @@
for projectName in ProjectsToProcess:
if ((args.includeproject == None or projectName in args.includeproject) and (args.excludeproject == None or not projectName in args.excludeproject)):
printLog(log, "PROJECT " + projectName)
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
if os.path.isfile(os.path.join(os.path.join(NeLWorkspaceDir, projectName), "process.py")):
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(os.path.join(NeLWorkspaceDir, projectName).replace("\\", "/")))
else:
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
os.chdir("processes")
try:
if not args.includeprocess == None:
Expand Down
9 changes: 8 additions & 1 deletion nel/tools/build_gamedata/3_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
sys.path.append(WorkspaceDirectory)
from projects import *

NeLWorkspaceDir = None
if NeLConfigDir:
NeLWorkspaceDir = os.path.join(NeLConfigDir, "workspace")

# Log error
printLog(log, "")
printLog(log, "-------")
Expand All @@ -64,7 +68,10 @@
for projectName in ProjectsToProcess:
if ((args.includeproject == None or projectName in args.includeproject) and (args.excludeproject == None or not projectName in args.excludeproject)):
printLog(log, "PROJECT " + projectName)
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
if os.path.isfile(os.path.join(os.path.join(NeLWorkspaceDir, projectName), "process.py")):
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(os.path.join(NeLWorkspaceDir, projectName).replace("\\", "/")))
else:
os.putenv("NELBUILDACTIVEPROJECT", os.path.abspath(WorkspaceDirectory + "/" + projectName))
os.chdir("processes")
try:
if not args.includeprocess == None:
Expand Down
2 changes: 1 addition & 1 deletion nel/tools/build_gamedata/9_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

# Find tools
# Not documenting this. Because we can.
Psftp = findFileMultiDir(log, ToolDirectories + WindowsExeDllCfgDirectories, UploadPsftpTool)
Psftp = findFileMultiDir(log, ToolDirectories + ExeDllCfgDirectories, UploadPsftpTool)
printLog(log, "PSFTP " + Psftp)

def downloadVersionTag(server, user, sshkey, dir):
Expand Down
4 changes: 2 additions & 2 deletions nel/tools/build_gamedata/d1_client_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
printLog(log, "")

# Find **** HARDCODED **** WINDOWS **** tools ... TODO: fix patch_gen tool !!!
Lzma = findFileMultiDir(log, ToolDirectories + WindowsExeDllCfgDirectories, "lzma.exe")
Lzma = findFileMultiDir(log, ToolDirectories + ExeDllCfgDirectories, "lzma.exe")
printLog(log, "LZMA " + Lzma)
XDelta = findFileMultiDir(log, ToolDirectories + WindowsExeDllCfgDirectories, "xdelta.exe")
XDelta = findFileMultiDir(log, ToolDirectories + ExeDllCfgDirectories, "xdelta.exe")
printLog(log, "XDELTA " + XDelta)
printLog(log, "")

Expand Down
2 changes: 1 addition & 1 deletion nel/tools/build_gamedata/processes/copy/3_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
except NameError:
CopyExeDllCfgSourceFiles = [ ]
for file in CopyExeDllCfgSourceFiles:
filePath = findFileMultiDir(log, WindowsExeDllCfgDirectories, file)
filePath = findFileMultiDir(log, ExeDllCfgDirectories, file)
if (filePath != ""):
copyFileIfNeeded(log, filePath, installPath + "/" + os.path.basename(file))

Expand Down
4 changes: 2 additions & 2 deletions nel/tools/build_gamedata/processes/sign/1_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@

mkPath(log, ExportBuildDirectory + "/" + UnsignedExeDllDirectory)
for file in ExeDllFiles:
printLog(log, str(WindowsExeDllCfgDirectories))
printLog(log, str(ExeDllCfgDirectories))
printLog(log, file)
filePath = findFileMultiDir(log, WindowsExeDllCfgDirectories, file)
filePath = findFileMultiDir(log, ExeDllCfgDirectories, file)
if (filePath != ""):
copyFileIfNeeded(log, filePath, ExportBuildDirectory + "/" + UnsignedExeDllDirectory + "/" + os.path.basename(file))

Expand Down
81 changes: 81 additions & 0 deletions tool/quick_start/configure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ def isWindows(client):
tc = NeLToolchains[tcn]
return "OS" in tc and tc["OS"].startswith("Win")

def isMSVC(client):
tcn = NeLTargets["Client"][client]["Toolchain"]
tc = NeLToolchains[tcn]
return "Compiler" in tc and tc["Compiler"] == "MSVC"

# Generate the projects file, this is imported after the user's projects.py
fo = open(os.path.join(workspaceDir, "projects_exedll.py"), "w")
fo.write("#!/usr/bin/python\n")
Expand Down Expand Up @@ -42,4 +47,80 @@ def isWindows(client):
fo.write("# end of file\n")
fo.close()

# Generate the individual projects
for client in NeLTargets["Client"]:
clientWindows = isWindows(client)
clientMSVC = isMSVC(client)
projectDir = os.path.join(commonDir, "exedll_" + client)
pathlib.Path(projectDir).mkdir(parents=True, exist_ok=True)
fo = open(os.path.join(projectDir, "process.py"), "w")
fo.write("#!/usr/bin/python\n")
fo.write("\n")
fo.write("ProcessToComplete = [ ]\n")
if clientWindows:
fo.write("ProcessToComplete += [ \"sign\", \"lib\", \"copy\" ]\n")
else:
fo.write("ProcessToComplete += [ \"copy\" ]\n")
fo.write("CommonName = \"exedll_" + client + "\"\n")
fo.write("CommonPath = \"common/\" + CommonName\n")
fo.write("\n")
fo.write("# end of file\n")
fo.close()
fo = open(os.path.join(projectDir, "directories.py"), "w")
fo.write("#!/usr/bin/python\n")
fo.write("\n")
fo.write("# COMMON\n")
fo.write("CommonName = \"exedll_" + client + "\"\n")
fo.write("CommonPath = \"common/\" + CommonName\n")
fo.write("# OVERRIDE\n")
buildDir = NeLTargets["Client"][client]["BuildDir"]
absBuildDir = os.path.join(NeLRootDir, buildDir)
buildDirs = [ os.path.join(absBuildDir, "bin").replace("\\", "/"), os.path.join(NeLCodeDir, "ryzom/client").replace("\\", "/") ]
if clientMSVC:
buildDirs = [ os.path.join(absBuildDir, "bin/Release").replace("\\", "/") ] + buildDirs
fo.write("ExeDllCfgDirectories = " + str(buildDirs) + "\n")
fo.write("# COPY\n")
fo.write("CopyDirectSourceDirectories = [ ]\n")
fo.write("CopyDirectSourceFiles = [ ]\n")
fo.write("CopyLeveldesignSourceDirectories = [ ]\n")
fo.write("CopyLeveldesignSourceFiles = [ ]\n")
fo.write("CopyLeveldesignWorldSourceDirectories = [ ]\n")
fo.write("CopyLeveldesignWorldSourceFiles = [ ]\n")
fo.write("CopyLeveldesignDfnSourceDirectories = [ ]\n")
fo.write("CopyLeveldesignDfnSourceFiles = [ ]\n")
fo.write("CopyDatabaseSourceDirectories = [ ]\n")
fo.write("CopyDatabaseSourceFiles = [ ]\n")
fo.write("CopyExeDllCfgSourceFiles = [ ]\n")
fo.write("CopyExeDllCfgSourceFiles += [ \"client_default.cfg\" ]\n")
if not clientWindows:
fo.write("CopyExeDllCfgSourceFiles += [ \"ryzom_client\" ]\n")
fo.write("CopyExeDllCfgSourceFiles += [ \"ryzom_client_patcher\" ]\n")
if clientWindows:
fo.write("# SIGN, LIB\n")
fo.write("ExeDllFiles = [ ]\n")
fo.write("ExeDllFiles += [ \"nel_drv_direct3d_win_r.dll\" ]\n")
fo.write("ExeDllFiles += [ \"nel_drv_dsound_win_r.dll\" ]\n")
fo.write("ExeDllFiles += [ \"nel_drv_fmod_win_r.dll\" ]\n")
fo.write("ExeDllFiles += [ \"nel_drv_openal_win_r.dll\" ]\n")
fo.write("ExeDllFiles += [ \"nel_drv_opengl_win_r.dll\" ]\n")
fo.write("ExeDllFiles += [ \"nel_drv_opengl3_win_r.dll\" ]\n")
fo.write("ExeDllFiles += [ \"nel_drv_xaudio2_win_r.dll\" ]\n")
fo.write("ExeDllFiles += [ \"ryzom_client_r.exe\" ]\n")
fo.write("ExeDllFiles += [ \"ryzom_client_patcher.exe\" ]\n")
fo.write("ExeDllFiles += [ \"ryzom_configuration_qt_r.exe\" ]\n")
fo.write("ExeDllFiles += [ \"crash_report.exe\" ]\n")
fo.write("# EXPORT\n")
fo.write("UnsignedExeDllDirectory = CommonPath + \"/unsigned_exe_dll\"\n")
fo.write("LibExeDllDirectory = CommonPath + \"/lib_exe_dll\"\n")
fo.write("# BUILD\n")
fo.write("SignedExeDllDirectory = CommonPath + \"/signed_exe_dll\"\n")
fo.write("# INSTALL\n")
fo.write("CopyInstallDirectory = CommonName\n")
if clientWindows:
fo.write("LibInstallDirectory = CommonName + \"_lib\"\n")
fo.write("SignInstallDirectory = CommonName\n")
fo.write("\n")
fo.write("# end of file\n")
fo.close()

# end of file
2 changes: 1 addition & 1 deletion tool/quick_start/win32/configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if %errorlevel% neq 0 pause
cd /d %RC_ROOT%
echo(
title Ryzom Core Configuration: Ready
echo To rebuild the client, server and tools from source with the current configuration, run the code_configure_rebuild_all script.
echo To rebuild the client, server and tools from source with the current configuration, run the `code_configure_rebuild_all` script.
echo(
echo Ready
pause

0 comments on commit 59e715e

Please sign in to comment.