]> git.tdb.fi Git - builder.git/blob - source/installedfile.h
Refactor transitive dependencies to work on all targets
[builder.git] / source / installedfile.h
1 #ifndef INSTALLEDFILE_H_
2 #define INSTALLEDFILE_H_
3
4 #include "sourcepackage.h"
5 #include "filetarget.h"
6
7 /**
8 Represents the installation of a file.
9 */
10 class InstalledFile: public FileTarget
11 {
12 private:
13         FileTarget &source;
14         Msp::FS::Path link;
15
16 public:
17         InstalledFile(Builder &, const SourcePackage &, FileTarget &, const std::string & =std::string());
18 private:
19         static Msp::FS::Path generate_target_path(const Msp::FS::Path &, const FileTarget &i, const std::string &);
20
21 public:
22         virtual const char *get_type() const { return "InstalledFile"; }
23         FileTarget &get_source() const { return source; }
24
25         /** Sets a symlink for the file.  A relative path will be rooted at the
26         directory the file resides in. */
27         void set_symlink(const Msp::FS::Path &);
28
29         const Msp::FS::Path &get_symlink() const { return link; }
30
31         virtual Target *get_real_target();
32 private:
33         virtual void check_rebuild();
34
35 public:
36         virtual void clean();
37 };
38
39 #endif