From c8dfe708b5551818dad3f6cf3e86cc72fe684572 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 17 Jul 2012 14:31:14 +0300 Subject: [PATCH] Re-stat FileTargets after a successful build --- source/filetarget.cpp | 13 +++++++++++++ source/filetarget.h | 4 ++++ 2 files changed, 17 insertions(+) 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 -- 2.43.0