1 #ifndef SOURCEPACKAGE_H_
2 #define SOURCEPACKAGE_H_
12 #include "toolchain.h"
17 class SourceArchiveComponent;
20 A package that can be built by Builder.
22 class SourcePackage: public Package
25 class Loader: public Msp::DataFile::DerivedObjectLoader<SourcePackage, Package::Loader>
28 const Config::InputOptions *options;
31 Loader(SourcePackage &);
32 Loader(SourcePackage &, const Config::InputOptions &);
34 void init(const Config::InputOptions *);
35 virtual void finish();
36 void feature(const std::string &, const std::string &);
38 void component(const std::string &);
39 template<typename C, typename A, A>
40 void component_arg(const std::string &);
42 void generate(const std::string &);
43 void if_feature(const std::string &);
44 void interface_version(const std::string &);
45 void source_archive();
46 void tarball(const std::string &);
47 void version(const std::string &);
50 typedef std::list<Component *> ComponentList;
53 typedef std::list<Feature> FeatureList;
56 std::string interface_version;
57 std::string description;
59 FileTarget *build_file;
60 Msp::FS::Path source_dir;
61 const BuildType *build_type;
62 Toolchain local_tools;
65 ComponentList components;
66 SourceArchiveComponent *source_archive;
71 SourcePackage(Builder &, const std::string &, const Msp::FS::Path &);
74 const std::string &get_version() const { return version; }
75 const std::string &get_interface_version() const { return interface_version; }
76 const std::string &get_description() const { return description; }
78 FileTarget &get_build_file() const { return *build_file; }
79 const Msp::FS::Path &get_source_directory() const { return source_dir; }
80 Msp::FS::Path get_temp_directory() const;
81 Msp::FS::Path get_output_directory() const;
83 const Toolchain &get_toolchain() const { return local_tools; }
84 const Component &get_component(const std::string &) const;
85 const Config &get_config() const { return config; }
86 bool match_feature(const std::string &, const std::string *) const;
87 void set_build_type(const BuildType &);
88 const BuildInfo &get_build_info() const { return build_info; }
90 virtual void do_prepare();
93 Cache &get_cache() const { return cache; }
95 virtual void save_caches();