Separate build per hostname in case of multiboot

feature/quick-start-py
kaetemi 3 years ago
parent 8d92b18e08
commit da648d8fc2
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -3,32 +3,21 @@ from common_config import *
import os
NeLCodeDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Code"])
if not os.path.isdir(NeLCodeDir):
exit("NeL Code directory (" + NeLCodeDir + ") does not exist.")
NeLLeveldesignDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Leveldesign"])
if not os.path.isdir(NeLLeveldesignDir):
exit("NeL Leveldesign directory (" + NeLLeveldesignDir + ") does not exist.")
NeLGraphicsDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Graphics"])
if not os.path.isdir(NeLGraphicsDir):
exit("NeL Graphics directory (" + NeLGraphicsDir + ") does not exist.")
NeLSoundDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Sound"])
if not os.path.isdir(NeLSoundDir):
exit("NeL Sound directory (" + NeLSoundDir + ") does not exist.")
NeLBuildDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Build"])
if not os.path.isdir(NeLBuildDir):
exit("NeL Build directory (" + NeLBuildDir + ") does not exist.")
NeLPipelineDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Pipeline"])
if not os.path.isdir(NeLPipelineDir):
exit("NeL Pipeline directory (" + NeLPipelineDir + ") does not exist.")
NeLCodeDir = os.path.join(NeLRootDir, "code")
NeLLeveldesignDir = os.path.join(NeLRootDir, "leveldesign")
NeLGraphicsDir = os.path.join(NeLRootDir, "graphics")
NeLSoundDir = os.path.join(NeLRootDir, "sound")
NeLBuildDir = os.path.join(NeLRootDir, "build_" + NeLHostId)
NeLPipelineDir = os.path.join(NeLRootDir, "pipeline")
NeLPython27Dir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["Python27"])
NeLRRDtoolDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["RRDtool"])
NeLMariaDBDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["MariaDB"])
NeLNginxDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["Nginx"])
NeLPHPDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["PHP"])
NeLphpMyAdminDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["phpMyAdmin"])
NeL3dsMaxDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["3dsMax"])
# TODO: OS
NeLPython27Dir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Win64"]["Python27"])
NeLRRDtoolDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Win64"]["RRDtool"])
NeLMariaDBDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Win64"]["MariaDB"])
NeLNginxDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Win64"]["Nginx"])
NeLPHPDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Win64"]["PHP"])
NeLphpMyAdminDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Win64"]["phpMyAdmin"])
NeL3dsMaxDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Win64"]["3dsMax"])
#print(NeLRootDir)
#print(NeLConfigDir)
@ -36,3 +25,5 @@ NeL3dsMaxDir = os.path.join(NeLRootDir, NeLConfig["Paths"]["Tools"]["3dsMax"])
#print(NeLConfig["Paths"]["Code"])
#print(NeLExternalDir)
print(NeLBuildDir)

@ -1,7 +1,7 @@
from common_root import *
import os, json
import os, json, socket
fi = open(os.path.join(NeLQuickStartDir, "config_default.json"), "r")
NeLConfig = json.load(fi)
@ -11,12 +11,12 @@ fi = open(os.path.join(NeLConfigDir, "config.json"), "r")
NeLUserConfig = json.load(fi)
if not "Paths" in NeLUserConfig:
NeLUserConfig["Paths"] = {}
if not "Tools" in NeLUserConfig["Paths"]:
NeLUserConfig["Paths"]["Tools"] = {}
if not "Win64" in NeLUserConfig["Paths"]:
NeLUserConfig["Paths"]["Win64"] = {}
if not "Toolchain" in NeLUserConfig:
NeLUserConfig["Toolchain"] = {}
NeLConfig["Paths"]["Tools"].update(NeLUserConfig["Paths"]["Tools"])
NeLUserConfig["Paths"]["Tools"] = NeLConfig["Paths"]["Tools"]
NeLConfig["Paths"]["Win64"].update(NeLUserConfig["Paths"]["Win64"])
NeLUserConfig["Paths"]["Win64"] = NeLConfig["Paths"]["Win64"]
NeLConfig["Paths"].update(NeLUserConfig["Paths"])
NeLUserConfig["Paths"] = NeLConfig["Paths"]
NeLConfig["Toolchain"].update(NeLUserConfig["Toolchain"])
@ -24,15 +24,25 @@ NeLUserConfig["Toolchain"] = NeLConfig["Toolchain"]
NeLConfig.update(NeLUserConfig)
fi.close()
if os.path.isfile(os.path.join(NeLConfigDir, "toolchains_default.json")):
fi = open(os.path.join(NeLConfigDir, "toolchains_default.json"), "r")
NeLHostName = socket.gethostname()
# Path-safe ID from hostname
# Used for separating build directories in multiboot development scenario
# Release builds should always be done from the same box, ideally
NeLHostId = NeLHostName.lower()
if "HostId" in NeLConfig:
# Override if specified
NeLHostId = NeLConfig["HostId"]
if os.path.isfile(os.path.join(NeLConfigDir, "toolchains_" + NeLHostId + "_default.json")):
fi = open(os.path.join(NeLConfigDir, "toolchains_" + NeLHostId + "_default.json"), "r")
NeLToolchains = json.load(fi)
fi.close()
else:
NeLToolchains = {}
if os.path.isfile(os.path.join(NeLConfigDir, "toolchains.json")):
fi = open(os.path.join(NeLConfigDir, "toolchains.json"), "r")
if os.path.isfile(os.path.join(NeLConfigDir, "toolchains_" + NeLHostId + ".json")):
fi = open(os.path.join(NeLConfigDir, "toolchains_" + NeLHostId + ".json"), "r")
NeLToolchains.update(json.load(fi))
fi.close()

@ -1,23 +1,16 @@
{
"Domain": "default",
"Domains": [ "default" ],
"Paths": {
"Code": "code",
"Leveldesign": "leveldesign",
"Graphics": "graphics",
"Sound": "sound",
"Build": "build",
"Pipeline": "pipeline",
"Tools": {
"Win64": {
"Python27": "external/python27",
"RRDtool": "external/rrdtool",
"MariaDB": "external/mariadb",
"Nginx": "external/nginx",
"PHP": "external/php",
"phpMyAdmin": "external/phpmyadmin"
},
"3dsMax": "",
"3dsMaxLocal": "",
"WinePrefix": ""
"phpMyAdmin": "external/phpmyadmin",
"3dsMax": "",
"3dsMaxLocal": ""
}
},
"Toolchain": {
"Preference": [

@ -70,7 +70,11 @@ for ts in SortedToolsets:
if toolchain["VCVars"] and (len(toolchain["Prefix"]) or "Hunter" in toolchain):
Toolchains[toolchain["OS"] + "/VS/" + ts + "/" + platform] = toolchain
with open(os.path.join(NeLConfigDir, "toolchains_default.json"), 'w') as fo:
with open(os.path.join(NeLConfigDir, "toolchains_" + socket.gethostname().lower() + "_default.json"), 'w') as fo:
json.dump(Toolchains, fo, indent=2)
if not os.path.isfile("toolchains_" + socket.gethostname().lower() + ".json"):
with open(os.path.join(NeLConfigDir, "toolchains_" + socket.gethostname().lower() + ".json"), 'w') as fo:
json.dump({}, fo, indent=2)
# end of file

Loading…
Cancel
Save