From: Mikko Rasa Date: Tue, 17 Jul 2012 11:31:14 +0000 (+0300) Subject: Re-stat FileTargets after a successful build X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c8dfe708b5551818dad3f6cf3e86cc72fe684572;p=builder.git Re-stat FileTargets after a successful build --- diff --git a/source/filetarget.cpp b/source/filetarget.cpp index 21c2bbf..7de9b79 100644 --- a/source/filetarget.cpp +++ b/source/filetarget.cpp @@ -30,6 +30,11 @@ void FileTarget::init(const SourcePackage *p) builder.get_vfs().register_path(path, this); + stat(); +} + +void FileTarget::stat() +{ if(FS::Stat st = FS::lstat(path)) { mtime = st.get_modify_time(); @@ -90,3 +95,11 @@ Task *FileTarget::build() return Target::build(); } + +void FileTarget::build_finished(bool success) +{ + if(success) + stat(); + + Target::build_finished(success); +} diff --git a/source/filetarget.h b/source/filetarget.h index 2319066..30cd3df 100644 --- a/source/filetarget.h +++ b/source/filetarget.h @@ -20,6 +20,7 @@ protected: FileTarget(Builder &, const SourcePackage &, const Msp::FS::Path &); private: void init(const SourcePackage *); + void stat(); static std::string generate_name(Builder &, const SourcePackage *, const Msp::FS::Path &); public: @@ -40,6 +41,9 @@ protected: public: virtual Task *build(); + +protected: + virtual void build_finished(bool); }; #endif