]> git.tdb.fi Git - builder.git/blob - source/sourcegenerator.h
Refactor transitive dependencies to work on all targets
[builder.git] / source / sourcegenerator.h
1 #ifndef SOURCEGENERATOR_H_
2 #define SOURCEGENERATOR_H_
3
4 #include <msp/datafile/objectloader.h>
5 #include "conditionalloader.h"
6 #include "sourcepackage.h"
7 #include "tool.h"
8
9 class SourceGenerator: public Tool
10 {
11 public:
12         class Loader: public Msp::DataFile::ObjectLoader<SourceGenerator>, public ConditionalLoader
13         {
14         public:
15                 Loader(SourceGenerator &);
16
17         private:
18                 void argument(const std::string &);
19                 void arguments(const std::vector<std::string> &);
20                 void command(const std::string &);
21                 void in_suffix(const std::string &);
22                 void out_argument(const std::string &);
23                 void out_suffix(const std::string &);
24         };
25
26 private:
27         const SourcePackage &package;
28         std::list<std::string> out_suffixes;
29         std::list<std::string> arguments;
30         std::string out_argument;
31
32 public:
33         SourceGenerator(Builder &, const SourcePackage &, const std::string &);
34
35         virtual Target *create_source(const Component &, const Msp::FS::Path &) const;
36         virtual Target *create_target(const std::list<Target *> &, const std::string &);
37
38         virtual Task *run(const Target &) const;
39 };
40
41 #endif