diff --git a/code/nel/include/nel/misc/tool_logger.h b/code/nel/include/nel/misc/tool_logger.h index 566ea4bac..a994abca9 100644 --- a/code/nel/include/nel/misc/tool_logger.h +++ b/code/nel/include/nel/misc/tool_logger.h @@ -56,6 +56,7 @@ enum TError enum TDepend { BUILD, + DIRECTORY, RUNTIME, }; @@ -144,6 +145,9 @@ public: case BUILD: fwrite("BUILD", 1, 5, m_DependLog); break; + case DIRECTORY: + fwrite("DIRECTORY", 1, 9, m_DependLog); + break; case RUNTIME: fwrite("RUNTIME", 1, 7, m_DependLog); break; diff --git a/code/nel/tools/3d/build_interface/main.cpp b/code/nel/tools/3d/build_interface/main.cpp index ebecfddc0..f2e42b80c 100644 --- a/code/nel/tools/3d/build_interface/main.cpp +++ b/code/nel/tools/3d/build_interface/main.cpp @@ -256,6 +256,8 @@ int main(int nNbArg, char **ppArgs) ToolLogger.release(); return -1; } + ToolLogger.writeDepend(PIPELINE::DIRECTORY, tgaName, sDir); + ToolLogger.writeDepend(PIPELINE::DIRECTORY, uvName, sDir); CPath::getPathContent(sDir, false, false, true, AllMapNames); } diff --git a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp index 6becf5e7b..f6a5f5342 100644 --- a/code/nel/tools/3d/tga_2_dds/tga2dds.cpp +++ b/code/nel/tools/3d/tga_2_dds/tga2dds.cpp @@ -25,10 +25,13 @@ #include "../s3tc_compressor_lib/s3tc_compressor.h" +#include +#include "nel/misc/tool_logger.h" using namespace NLMISC; using namespace std; +PIPELINE::CToolLogger ToolLogger; #define TGA8 8 #define TGA16 16 @@ -204,7 +207,7 @@ void writeInstructions() cout<<"extension \"_usercolor\""< [-o ] [-a ] [-m]"< [-o ] [-a ] [-m] [-d dependLog] [-e errorLog]"<(NLMISC::INelContext::getInstance().getSingletonPointer("IPipelineProcess")); } +bool IPipelineProcess::getValue(bool &result, const std::string &name) +{ + // It's true. + std::string resultString; + if (!getValue(resultString, name)) + return false; + if (resultString == "true") + result = true; + if (resultString == "false") + result = false; + else + { + nlwarning("Value '%s' with result '%s' is not a boolean", name.c_str(), resultString.c_str()); + return false; + } + return true; +} + +bool IPipelineProcess::getValue(uint &result, const std::string &name) +{ + std::string resultString; + if (!getValue(resultString, name)) + return false; + if (!NLMISC::fromString(resultString, result)) + { + nlwarning("Value '%s' with result '%s' is not an integer", name.c_str(), resultString.c_str()); + return false; + } + return true; +} + +bool IPipelineProcess::getValue(sint &result, const std::string &name) +{ + std::string resultString; + if (!getValue(resultString, name)) + return false; + if (!NLMISC::fromString(resultString, result)) + { + nlwarning("Value '%s' with result '%s' is not an integer", name.c_str(), resultString.c_str()); + return false; + } + return true; +} + } /* namespace PIPELINE */ /* end of file */ diff --git a/code/nel/tools/pipeline/plugin_library/pipeline_process.h b/code/nel/tools/pipeline/plugin_library/pipeline_process.h index b7c611cf6..cc2181994 100644 --- a/code/nel/tools/pipeline/plugin_library/pipeline_process.h +++ b/code/nel/tools/pipeline/plugin_library/pipeline_process.h @@ -90,6 +90,9 @@ public: /// Get a value from the currently active project configuration. If false, don't use, no need to write warnings to service log, already written, set exit state and exit if necessary virtual bool getValue(std::string &result, const std::string &name) = 0; + bool getValue(bool &result, const std::string &name); + bool getValue(uint &result, const std::string &name); + bool getValue(sint &result, const std::string &name); virtual bool getValues(std::vector &resultAppend, const std::string &name) = 0; virtual bool getValueNb(uint &result, const std::string &name) = 0; diff --git a/code/nel/tools/pipeline/service/metadata_storage.cpp b/code/nel/tools/pipeline/service/metadata_storage.cpp index e8c7e0aae..80fd20399 100644 --- a/code/nel/tools/pipeline/service/metadata_storage.cpp +++ b/code/nel/tools/pipeline/service/metadata_storage.cpp @@ -80,11 +80,12 @@ void CFileDepend::CDependency::serial(NLMISC::IStream &stream) throw (NLMISC::ES void CFileDepend::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) { - uint version = stream.serialVersion(2); + uint version = stream.serialVersion(3); if (version >= 2) stream.serial(BuildStart); else BuildStart = 0; stream.serial(CRC32); stream.serialCont(Dependencies); - stream.serialCont(RuntimeDependencies); + if (version >= 3) stream.serialCont(DirectoryDependencies); else DirectoryDependencies.clear(); + if (version >= 3) stream.serialCont(RuntimeDependencies); else { std::vector dummy; stream.serialCont(dummy); } } void CProcessResult::CFileResult::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) diff --git a/code/nel/tools/pipeline/service/metadata_storage.h b/code/nel/tools/pipeline/service/metadata_storage.h index 8fdbc089f..205db4508 100644 --- a/code/nel/tools/pipeline/service/metadata_storage.h +++ b/code/nel/tools/pipeline/service/metadata_storage.h @@ -114,7 +114,8 @@ public: void serial(NLMISC::IStream &stream) throw (NLMISC::EStream); }; std::vector Dependencies; - std::vector RuntimeDependencies; // informational (TODO) + std::vector DirectoryDependencies; // In case the file needs to be informed when files are added to a directory. + std::vector RuntimeDependencies; // informational (TODO) User can use this to check if any files are missing. void serial(NLMISC::IStream &stream) throw (NLMISC::EStream); }; diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp index db1959690..bc09e2cb4 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp +++ b/code/nel/tools/pipeline/service/pipeline_process_impl_buildinfo.cpp @@ -540,6 +540,7 @@ bool CPipelineProcessImpl::needsToBeRebuiltSub(const std::vector &i // Find out if any files were added in dependency directories since last build start if (inputModified) { + // TODO: ONLY CHECK INPUT PATHS GIVEN BY DEPEND META FILES for (std::vector::const_iterator it = inputPaths.begin(), end = inputPaths.end(); it != end; ++it) { const std::string &path = *it; diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp b/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp index 5d83d2b60..a3ed2b28c 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp +++ b/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp @@ -153,6 +153,8 @@ void CPipelineProcessImpl::parseToolLog(const std::string &dependLogFile, const TDepend type; if (tabbedLine[0] == "BUILD") type = BUILD; + else if (tabbedLine[0] == "DIRECTORY") + type = DIRECTORY; else if (tabbedLine[0] == "RUNTIME") type = RUNTIME; else @@ -166,7 +168,7 @@ void CPipelineProcessImpl::parseToolLog(const std::string &dependLogFile, const } std::string outputFile = standardizePath(tabbedLine[1], false); // std::string outputFileMacro = macroPath(outputFile); - std::string inputFile = standardizePath(tabbedLine[2], false); + std::string inputFile = standardizePath(tabbedLine[2], type == DIRECTORY); std::string inputFileMacro = macroPath(inputFile); std::map::iterator metaDependIt = metaDepends.find(outputFile); if (metaDependIt == metaDepends.end()) @@ -187,46 +189,58 @@ void CPipelineProcessImpl::parseToolLog(const std::string &dependLogFile, const m_FileStatusOutputCache[outputFile] = status; } - CFileDepend::CDependency dependency; - dependency.MacroPath = inputFileMacro; - std::map::iterator statusIt = statusCache.find(inputFile); - if (statusIt == statusCache.end()) + switch (type) { - if (!isFileDependency(inputFile)) + case BUILD: { - m_SubTaskErrorMessage = std::string("Invalid dependency '") + inputFile + "'"; - m_SubTaskResult = FINISH_ERROR; - file.close(); - return; + CFileDepend::CDependency dependency; + dependency.MacroPath = inputFileMacro; + std::map::iterator statusIt = statusCache.find(inputFile); + if (statusIt == statusCache.end()) + { + if (!isFileDependency(inputFile)) + { + m_SubTaskErrorMessage = std::string("Invalid dependency '") + inputFile + "'"; + m_SubTaskResult = FINISH_ERROR; + file.close(); + return; + } + CFileStatus statusOriginal; + if (!getDependencyFileStatusCached(statusOriginal, inputFile)) + { + m_SubTaskErrorMessage = std::string("Cached status for '") + inputFile + "' does not exist, this may be a programming error"; + m_SubTaskResult = FINISH_ERROR; + file.close(); + return; + } + CFileStatus status; + if (!getDependencyFileStatusLatest(status, inputFile)) + { + m_SubTaskErrorMessage = std::string("Invalid status for '") + inputFile + "', file may have changed during build"; + m_SubTaskResult = FINISH_ERROR; + file.close(); + return; + } + if (statusOriginal.CRC32 != status.CRC32) + { + m_SubTaskErrorMessage = std::string("Status checksums changed for '") + inputFile + "', file has changed during build"; + m_SubTaskResult = FINISH_ERROR; + file.close(); + return; + } + statusCache[inputFile] = status; + statusIt = statusCache.find(inputFile); + } + dependency.CRC32 = statusIt->second.CRC32; + metaDependIt->second.Dependencies.push_back(dependency); } - CFileStatus statusOriginal; - if (!getDependencyFileStatusCached(statusOriginal, inputFile)) - { - m_SubTaskErrorMessage = std::string("Cached status for '") + inputFile + "' does not exist, this may be a programming error"; - m_SubTaskResult = FINISH_ERROR; - file.close(); - return; - } - CFileStatus status; - if (!getDependencyFileStatusLatest(status, inputFile)) - { - m_SubTaskErrorMessage = std::string("Invalid status for '") + inputFile + "', file may have changed during build"; - m_SubTaskResult = FINISH_ERROR; - file.close(); - return; - } - if (statusOriginal.CRC32 != status.CRC32) - { - m_SubTaskErrorMessage = std::string("Status checksums changed for '") + inputFile + "', file has changed during build"; - m_SubTaskResult = FINISH_ERROR; - file.close(); - return; - } - statusCache[inputFile] = status; - statusIt = statusCache.find(inputFile); + case DIRECTORY: + metaDependIt->second.DirectoryDependencies.push_back(inputFileMacro); + break; + case RUNTIME: + metaDependIt->second.RuntimeDependencies.push_back(inputFileMacro); + break; } - dependency.CRC32 = statusIt->second.CRC32; - metaDependIt->second.Dependencies.push_back(dependency); } } diff --git a/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_process_texture_dds.dfn b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_process_texture_dds.dfn index fa538dbd4..85954e4ab 100644 --- a/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_process_texture_dds.dfn +++ b/code/ryzom/common/data_leveldesign/leveldesign/DFN/pipeline/pipeline_process_texture_dds.dfn @@ -3,7 +3,10 @@ - + - Sat Aug 04 15:22:53 2012 (kaetemi) Dfn Structure = + + Sat Aug 04 15:22:53 2012 (kaetemi) Dfn Structure = +Sat Aug 04 16:36:51 2012 (kaetemi) Dfn Structure = +Sat Aug 04 16:38:11 2012 (kaetemi) Dfn Structure =