mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Implement skip for zone dependency process
This commit is contained in:
parent
a5282ccb7e
commit
8dc1a89440
2 changed files with 87 additions and 17 deletions
|
@ -82,6 +82,13 @@ def copyFileList(log, dir_source, dir_target, files):
|
||||||
if needUpdateLogRemoveDest(log, dir_source + "/" + fileName, dir_target + "/" + fileName):
|
if needUpdateLogRemoveDest(log, dir_source + "/" + fileName, dir_target + "/" + fileName):
|
||||||
shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName)
|
shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName)
|
||||||
|
|
||||||
|
def copyFileListLogless(log, dir_source, dir_target, files):
|
||||||
|
for fileName in files:
|
||||||
|
if fileName != ".svn" and fileName != ".." and fileName != "." and fileName != "*.*":
|
||||||
|
if (os.path.isfile(dir_source + "/" + fileName)):
|
||||||
|
if needUpdateRemoveDest(log, dir_source + "/" + fileName, dir_target + "/" + fileName):
|
||||||
|
shutil.copy(dir_source + "/" + fileName, dir_target + "/" + fileName)
|
||||||
|
|
||||||
def copyFileListNoTree(log, dir_source, dir_target, files):
|
def copyFileListNoTree(log, dir_source, dir_target, files):
|
||||||
for fileName in files:
|
for fileName in files:
|
||||||
if fileName != ".svn" and fileName != ".." and fileName != "." and fileName != "*.*":
|
if fileName != ".svn" and fileName != ".." and fileName != "." and fileName != "*.*":
|
||||||
|
@ -145,6 +152,9 @@ def copyFilesRecursive(log, dir_source, dir_target):
|
||||||
def copyFiles(log, dir_source, dir_target):
|
def copyFiles(log, dir_source, dir_target):
|
||||||
copyFileList(log, dir_source, dir_target, os.listdir(dir_source))
|
copyFileList(log, dir_source, dir_target, os.listdir(dir_source))
|
||||||
|
|
||||||
|
def copyFilesLogless(log, dir_source, dir_target):
|
||||||
|
copyFileListLogless(log, dir_source, dir_target, os.listdir(dir_source))
|
||||||
|
|
||||||
def copyFilesExt(log, dir_source, dir_target, file_ext):
|
def copyFilesExt(log, dir_source, dir_target, file_ext):
|
||||||
files = os.listdir(dir_source)
|
files = os.listdir(dir_source)
|
||||||
len_file_ext = len(file_ext)
|
len_file_ext = len(file_ext)
|
||||||
|
@ -288,6 +298,31 @@ def findFile(log, dir_where, file_name):
|
||||||
printLog(log, "findFile: file not dir or file?! " + filePath)
|
printLog(log, "findFile: file not dir or file?! " + filePath)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
def needUpdateDirByLowercaseTagLog(log, dir_source, ext_source, dir_dest, ext_dest):
|
||||||
|
updateCount = 0
|
||||||
|
skipCount = 0
|
||||||
|
lenSrcExt = len(ext_source)
|
||||||
|
sourceFiles = findFilesNoSubdir(log, dir_source, ext_source)
|
||||||
|
destFiles = findFilesNoSubdir(log, dir_dest, ext_dest)
|
||||||
|
for file in sourceFiles:
|
||||||
|
sourceFile = dir_source + "/" + file
|
||||||
|
tagFile = dir_dest + "/" + file[0:-lenSrcExt].lower() + ext_dest
|
||||||
|
if os.path.isfile(tagFile):
|
||||||
|
sourceTime = os.stat(sourceFile).st_mtime
|
||||||
|
tagTime = os.stat(tagFile).st_mtime
|
||||||
|
if (sourceTime > tagTime):
|
||||||
|
updateCount = updateCount + 1
|
||||||
|
else:
|
||||||
|
skipCount = skipCount + 1
|
||||||
|
else:
|
||||||
|
updateCount = updateCount + 1
|
||||||
|
if updateCount > 0:
|
||||||
|
printLog(log, "UPDATE " + str(updateCount) + " / " + str(len(sourceFiles)) + "; SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles)))
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles)))
|
||||||
|
return 0
|
||||||
|
|
||||||
def needUpdateDirByTagLog(log, dir_source, ext_source, dir_dest, ext_dest):
|
def needUpdateDirByTagLog(log, dir_source, ext_source, dir_dest, ext_dest):
|
||||||
updateCount = 0
|
updateCount = 0
|
||||||
skipCount = 0
|
skipCount = 0
|
||||||
|
@ -327,6 +362,21 @@ def needUpdateDirNoSubdirFile(log, dir_source, file_dest):
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def needUpdateFileDirNoSubdir(log, file_source, dir_dest):
|
||||||
|
if not os.path.isfile(file_source):
|
||||||
|
printLog(log, "WARNING MISSING " + file_source)
|
||||||
|
return 0
|
||||||
|
sourceTime = os.stat(file_source).st_mtime
|
||||||
|
destFiles = os.listdir(dir_dest)
|
||||||
|
for file in destFiles:
|
||||||
|
filePath = dir_dest + "/" + file
|
||||||
|
if os.path.isfile(filePath):
|
||||||
|
fileTime = os.stat(filePath).st_mtime
|
||||||
|
if sourceTime > fileTime:
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
def needUpdateDirNoSubdirMultiFile(log, dir_source, root_file, files_dest):
|
def needUpdateDirNoSubdirMultiFile(log, dir_source, root_file, files_dest):
|
||||||
for file_dest in files_dest:
|
for file_dest in files_dest:
|
||||||
if needUpdateDirNoSubdirFile(log, dir_source, root_file + "/" + file_dest):
|
if needUpdateDirNoSubdirFile(log, dir_source, root_file + "/" + file_dest):
|
||||||
|
|
|
@ -59,23 +59,43 @@ if BuildQuality == 1:
|
||||||
else:
|
else:
|
||||||
mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory)
|
mkPath(log, ExportBuildDirectory + "/" + ZoneExportDirectory)
|
||||||
mkPath(log, ExportBuildDirectory + "/" + ZoneDependBuildDirectory)
|
mkPath(log, ExportBuildDirectory + "/" + ZoneDependBuildDirectory)
|
||||||
mkPath(log, ActiveProjectDirectory + "/generated")
|
needUpdateZoneDepend = needUpdateDirByLowercaseTagLog(log, ExportBuildDirectory + "/" + ZoneExportDirectory, ".zone", ExportBuildDirectory + "/" + ZoneDependBuildDirectory, ".depend")
|
||||||
configFile = ActiveProjectDirectory + "/generated/zone_dependencies.cfg"
|
if needUpdateZoneDepend:
|
||||||
templateCf = open(ActiveProjectDirectory + "/generated/properties.cfg", "r")
|
printLog(log, "DETECT UPDATE Zone->Depend")
|
||||||
cf = open(configFile, "w")
|
else:
|
||||||
for line in templateCf:
|
printLog(log, "DETECT SKIP Zone->Depend")
|
||||||
cf.write(line)
|
needUpdateContinentDepend = needUpdateFileDirNoSubdir(log, LeveldesignWorldDirectory + "/" + ContinentFile, ExportBuildDirectory + "/" + ZoneDependBuildDirectory)
|
||||||
cf.write("\n");
|
if needUpdateContinentDepend:
|
||||||
cf.write("level_design_directory = \"" + LeveldesignDirectory + "\";\n");
|
printLog(log, "DETECT UPDATE Continent->Depend")
|
||||||
cf.write("level_design_world_directory = \"" + LeveldesignWorldDirectory + "\";\n");
|
else:
|
||||||
cf.write("level_design_dfn_directory = \"" + LeveldesignDfnDirectory + "\";\n");
|
printLog(log, "DETECT SKIP Continent->Depend")
|
||||||
cf.write("continent_name = \"" + ContinentName + "\";\n");
|
needUpdateSearchPaths = needUpdateMultiDirNoSubdir(log, ExportBuildDirectory, PropertiesExportBuildSearchPaths, ExportBuildDirectory + "/" + ZoneDependBuildDirectory)
|
||||||
cf.write("\n");
|
if needUpdateSearchPaths:
|
||||||
cf.close()
|
printLog(log, "DETECT UPDATE SearchPaths->Depend")
|
||||||
|
else:
|
||||||
for zoneRegion in ZoneRegions:
|
printLog(log, "DETECT SKIP SearchPaths->Depend")
|
||||||
subprocess.call([ ExecTimeout, str(ZoneBuildDependTimeout), ZoneDependencies, configFile, ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + zoneRegion[0] + ".zone", ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + zoneRegion[1] + ".zone", ExportBuildDirectory + "/" + ZoneDependBuildDirectory + "/doomy.depend" ])
|
if needUpdateZoneDepend or needUpdateContinentDepend or needUpdateSearchPaths:
|
||||||
|
printLog(log, "DETECT DECIDE UPDATE")
|
||||||
|
mkPath(log, ActiveProjectDirectory + "/generated")
|
||||||
|
configFile = ActiveProjectDirectory + "/generated/zone_dependencies.cfg"
|
||||||
|
templateCf = open(ActiveProjectDirectory + "/generated/properties.cfg", "r")
|
||||||
|
cf = open(configFile, "w")
|
||||||
|
for line in templateCf:
|
||||||
|
cf.write(line)
|
||||||
|
cf.write("\n");
|
||||||
|
cf.write("level_design_directory = \"" + LeveldesignDirectory + "\";\n");
|
||||||
|
cf.write("level_design_world_directory = \"" + LeveldesignWorldDirectory + "\";\n");
|
||||||
|
cf.write("level_design_dfn_directory = \"" + LeveldesignDfnDirectory + "\";\n");
|
||||||
|
cf.write("continent_name = \"" + ContinentName + "\";\n");
|
||||||
|
cf.write("\n");
|
||||||
|
cf.close()
|
||||||
|
|
||||||
|
for zoneRegion in ZoneRegions:
|
||||||
|
# zone_dependencies [properties.cfg] [firstZone.zone] [lastzone.zone] [output_dependencies.cfg]
|
||||||
|
subprocess.call([ ExecTimeout, str(ZoneBuildDependTimeout), ZoneDependencies, configFile, ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + zoneRegion[0] + ".zone", ExportBuildDirectory + "/" + ZoneExportDirectory + "/" + zoneRegion[1] + ".zone", ExportBuildDirectory + "/" + ZoneDependBuildDirectory + "/doomy.depend" ])
|
||||||
|
else:
|
||||||
|
printLog(log, "DETECT DECIDE SKIP")
|
||||||
|
printLog(log, "SKIP *")
|
||||||
printLog(log, "")
|
printLog(log, "")
|
||||||
|
|
||||||
# For each zone directory
|
# For each zone directory
|
||||||
|
|
Loading…
Reference in a new issue