Added: #1440 Placeholder function for reading previous process run results

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent be30ccea4d
commit f9de7ed616

@ -72,17 +72,18 @@ void CFileRemove::serial(NLMISC::IStream &stream) throw (NLMISC::EStream)
stream.serial(Lost); stream.serial(Lost);
} }
void CProjectResult::CFileResult::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) void CProcessResult::CFileResult::serial(NLMISC::IStream &stream) throw (NLMISC::EStream)
{ {
uint version = stream.serialVersion(1); uint version = stream.serialVersion(1);
stream.serial(CRC32); stream.serial(CRC32);
stream.serial((uint8 &)Level); // test this :o) stream.serial((uint8 &)Level); // test this :o)
} }
void CProjectResult::serial(NLMISC::IStream &stream) throw (NLMISC::EStream) void CProcessResult::serial(NLMISC::IStream &stream) throw (NLMISC::EStream)
{ {
uint version = stream.serialVersion(1); uint version = stream.serialVersion(1);
stream.serialCont(FilePaths); stream.serial(LastSuccessfulBuildStart);
stream.serialCont(MacroPaths);
stream.serialCont(FileResults); stream.serialCont(FileResults);
} }
@ -133,6 +134,29 @@ void CMetadataStorage::eraseStatus(const std::string &path)
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
std::string CMetadataStorage::getResultPath(const std::string &projectName, const std::string &pluginName)
{
std::string lwPluginName = NLMISC::toLower(pluginName);
std::string resultPath = CWorkspaceStorage::getMetaDirectoryPath(
CWorkspaceStorage::getProjectDirectory(projectName))
+ lwPluginName + PIPELINE_DATABASE_RESULT_SUFFIX;
nldebug("Result path: '%s'", resultPath.c_str());
return resultPath;
}
void CMetadataStorage::readProcessResult(CProcessResult &result, const std::string &path)
{
// TODO
result.LastSuccessfulBuildStart = 0;
result.MacroPaths.clear();
result.FileResults.clear();
// TODO
}
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
} /* namespace PIPELINE */ } /* namespace PIPELINE */
/* end of file */ /* end of file */

@ -103,12 +103,17 @@ public:
#define PIPELINE_DATABASE_DEPEND_SUFFIX ".depend" #define PIPELINE_DATABASE_DEPEND_SUFFIX ".depend"
// ....................... // .......................
/// Suffix for metafiles that contain the result of the last build of a project /// Suffix for metafiles that contain the result of the last build of a process
#define PIPELINE_DATABASE_RESULT_SUFFIX ".result" #define PIPELINE_DATABASE_RESULT_SUFFIX ".result"
struct CProjectResult struct CProcessResult
{ {
public: public:
std::vector<std::string> FilePaths; // Note: this file may have been erased on build start in case something went wrong!
// In that case, the last successfulbuild start is 0, and no output files will be known.
// This is the same situation as if the project never built before.
// It must be handled sanely.
uint32 LastSuccessfulBuildStart;
std::vector<std::string> MacroPaths;
struct CFileResult struct CFileResult
{ {
uint32 CRC32; uint32 CRC32;
@ -145,7 +150,8 @@ public:
// static void eraseRemove(const std::string &path); // static void eraseRemove(const std::string &path);
// Pathname for result metadata is like .../project.projectname.meta/pluginname.result // Pathname for result metadata is like .../project.projectname.meta/pluginname.result
// static std::string getResultPath(const std::string &projectName, const std::string &pluginName); static std::string getResultPath(const std::string &projectName, const std::string &pluginName);
static void readProcessResult(CProcessResult &result, const std::string &path);
}; /* class CMetadataStorage */ }; /* class CMetadataStorage */

@ -87,6 +87,7 @@ std::string CPipelineProcessImpl::getTempDirectory()
ss << "."; ss << ".";
ss << rand(); ss << rand();
ss << PIPELINE_DIRECTORY_TEMP_SUFFIX; ss << PIPELINE_DIRECTORY_TEMP_SUFFIX;
ss << "/";
return ss.str(); return ss.str();
} }
else else

@ -41,6 +41,7 @@
// Project includes // Project includes
#include "pipeline_service.h" #include "pipeline_service.h"
#include "workspace_storage.h"
using namespace std; using namespace std;
// using namespace NLMISC; // using namespace NLMISC;
@ -206,7 +207,8 @@ std::string CPipelineProject::getName()
std::string CPipelineProject::getOutputDirectory() std::string CPipelineProject::getOutputDirectory()
{ {
return g_WorkDir + PIPELINE_DIRECTORY_PREFIX_PROJECT + getName() + "/"; // return g_WorkDir + PIPELINE_DIRECTORY_PREFIX_PROJECT + getName() + "/";
return CWorkspaceStorage::getProjectDirectory(getName());
} }
std::string CPipelineProject::getTempDirectory() std::string CPipelineProject::getTempDirectory()
@ -222,6 +224,7 @@ std::string CPipelineProject::getTempDirectory()
ss << "."; ss << ".";
ss << rand(); ss << rand();
ss << PIPELINE_DIRECTORY_TEMP_SUFFIX; ss << PIPELINE_DIRECTORY_TEMP_SUFFIX;
ss << "/";
m_TempDirectory = ss.str(); m_TempDirectory = ss.str();
} }
return m_TempDirectory; return m_TempDirectory;

@ -145,6 +145,12 @@ std::string CWorkspaceStorage::getMetaDirectoryPath(const std::string &path)
return standardizePath(CWorkspaceStorage::getMetaFilePath(path, ""), true); return standardizePath(CWorkspaceStorage::getMetaFilePath(path, ""), true);
} }
std::string CWorkspaceStorage::getProjectDirectory(const std::string &projectName)
{
std::string lwProjectName = NLMISC::toLower(projectName);
return g_WorkDir + PIPELINE_DIRECTORY_PREFIX_PROJECT + lwProjectName + "/";
}
} /* namespace PIPELINE */ } /* namespace PIPELINE */
/* end of file */ /* end of file */

@ -56,7 +56,8 @@ public:
/// Get the directory where metadata files are stored, based on the filepath containing the files which the containing metadata represents /// Get the directory where metadata files are stored, based on the filepath containing the files which the containing metadata represents
static std::string getMetaDirectoryPath(const std::string &path); static std::string getMetaDirectoryPath(const std::string &path);
// TODO: getProjectDirectory /// Format like .../project.common/ /// Format like .../project.someproject/
static std::string getProjectDirectory(const std::string &projectName);
}; /* class CWorkspaceStorage */ }; /* class CWorkspaceStorage */

Loading…
Cancel
Save