X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffiletarget.h;h=da6b9a883d6625b9e20d87bc9880822b23aea846;hb=82ae60a647ebb9567f7177c353245f4d72faaf5e;hp=3b8bfcc4a0f0212f43bc23a058ecbf6f422215c2;hpb=66d1078c04849ec17a7343d0494d6ed087e04318;p=builder.git diff --git a/source/filetarget.h b/source/filetarget.h index 3b8bfcc..da6b9a8 100644 --- a/source/filetarget.h +++ b/source/filetarget.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef FILETARGET_H_ #define FILETARGET_H_ @@ -19,10 +12,43 @@ class FileTarget: public Target { protected: Msp::FS::Path path; + Msp::Time::TimeStamp mtime; + unsigned size; + Msp::FS::Path install_location; + std::string install_filename; + + FileTarget(Builder &, const Msp::FS::Path &); + 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 &); - FileTarget(Builder &, const Package *, const Msp::FS::Path &); public: const Msp::FS::Path &get_path() const { return path; } + const Msp::Time::TimeStamp &get_mtime() const { return mtime; } + unsigned get_size() const { return size; } + + bool is_installable() const { return !install_location.empty(); } + const Msp::FS::Path &get_install_location() const { return install_location; } + const std::string &get_install_filename() const { return install_filename; } + + /// Changes the mtime of the target to the current time. + void touch(); + +protected: + virtual void check_rebuild(); + + virtual std::string create_build_signature() const; + +public: + virtual Task *build(); + +protected: + virtual void build_finished(bool); + +public: + virtual void clean(); }; #endif