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

@ -1,7 +1,7 @@
from common_root import * from common_root import *
import os, json import os, json, socket
fi = open(os.path.join(NeLQuickStartDir, "config_default.json"), "r") fi = open(os.path.join(NeLQuickStartDir, "config_default.json"), "r")
NeLConfig = json.load(fi) NeLConfig = json.load(fi)
@ -11,12 +11,12 @@ fi = open(os.path.join(NeLConfigDir, "config.json"), "r")
NeLUserConfig = json.load(fi) NeLUserConfig = json.load(fi)
if not "Paths" in NeLUserConfig: if not "Paths" in NeLUserConfig:
NeLUserConfig["Paths"] = {} NeLUserConfig["Paths"] = {}
if not "Tools" in NeLUserConfig["Paths"]: if not "Win64" in NeLUserConfig["Paths"]:
NeLUserConfig["Paths"]["Tools"] = {} NeLUserConfig["Paths"]["Win64"] = {}
if not "Toolchain" in NeLUserConfig: if not "Toolchain" in NeLUserConfig:
NeLUserConfig["Toolchain"] = {} NeLUserConfig["Toolchain"] = {}
NeLConfig["Paths"]["Tools"].update(NeLUserConfig["Paths"]["Tools"]) NeLConfig["Paths"]["Win64"].update(NeLUserConfig["Paths"]["Win64"])
NeLUserConfig["Paths"]["Tools"] = NeLConfig["Paths"]["Tools"] NeLUserConfig["Paths"]["Win64"] = NeLConfig["Paths"]["Win64"]
NeLConfig["Paths"].update(NeLUserConfig["Paths"]) NeLConfig["Paths"].update(NeLUserConfig["Paths"])
NeLUserConfig["Paths"] = NeLConfig["Paths"] NeLUserConfig["Paths"] = NeLConfig["Paths"]
NeLConfig["Toolchain"].update(NeLUserConfig["Toolchain"]) NeLConfig["Toolchain"].update(NeLUserConfig["Toolchain"])
@ -24,15 +24,25 @@ NeLUserConfig["Toolchain"] = NeLConfig["Toolchain"]
NeLConfig.update(NeLUserConfig) NeLConfig.update(NeLUserConfig)
fi.close() fi.close()
if os.path.isfile(os.path.join(NeLConfigDir, "toolchains_default.json")): NeLHostName = socket.gethostname()
fi = open(os.path.join(NeLConfigDir, "toolchains_default.json"), "r")
# 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) NeLToolchains = json.load(fi)
fi.close() fi.close()
else: else:
NeLToolchains = {} NeLToolchains = {}
if os.path.isfile(os.path.join(NeLConfigDir, "toolchains.json")): if os.path.isfile(os.path.join(NeLConfigDir, "toolchains_" + NeLHostId + ".json")):
fi = open(os.path.join(NeLConfigDir, "toolchains.json"), "r") fi = open(os.path.join(NeLConfigDir, "toolchains_" + NeLHostId + ".json"), "r")
NeLToolchains.update(json.load(fi)) NeLToolchains.update(json.load(fi))
fi.close() fi.close()

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

@ -70,7 +70,11 @@ for ts in SortedToolsets:
if toolchain["VCVars"] and (len(toolchain["Prefix"]) or "Hunter" in toolchain): if toolchain["VCVars"] and (len(toolchain["Prefix"]) or "Hunter" in toolchain):
Toolchains[toolchain["OS"] + "/VS/" + ts + "/" + platform] = 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) 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 # end of file

Loading…
Cancel
Save