1 #ifndef SOURCEPACKAGE_H_
2 #define SOURCEPACKAGE_H_
12 #include "toolchain.h"
19 A package that can be built by Builder.
21 class SourcePackage: public Package
24 class Loader: public Msp::DataFile::DerivedObjectLoader<SourcePackage, Package::Loader>
27 const Config::InputOptions *options;
30 Loader(SourcePackage &);
31 Loader(SourcePackage &, const Config::InputOptions &);
33 void init(const Config::InputOptions *);
34 virtual void finish();
35 void feature(const std::string &, const std::string &);
36 template<Component::Type>
37 void component(const std::string &);
39 void generate(const std::string &);
40 void if_feature(const std::string &);
41 void interface_version(const std::string &);
42 void source_tarball();
43 void tarball(const std::string &);
44 void version(const std::string &);
47 typedef std::list<Component> ComponentList;
50 typedef std::list<Feature> FeatureList;
53 std::string interface_version;
54 std::string description;
56 FileTarget *build_file;
57 Msp::FS::Path source_dir;
58 const BuildType *build_type;
59 Toolchain local_tools;
62 ComponentList components;
63 Component *source_tarball;
68 SourcePackage(Builder &, const std::string &, const Msp::FS::Path &);
70 const std::string &get_version() const { return version; }
71 const std::string &get_interface_version() const { return interface_version; }
72 const std::string &get_description() const { return description; }
74 FileTarget &get_build_file() const { return *build_file; }
75 const Msp::FS::Path &get_source_directory() const { return source_dir; }
76 Msp::FS::Path get_temp_directory() const;
77 Msp::FS::Path get_output_directory() const;
79 const Toolchain &get_toolchain() const { return local_tools; }
80 const ComponentList &get_components() const { return components; }
81 const Config &get_config() const { return config; }
82 bool match_feature(const std::string &, const std::string *) const;
83 void set_build_type(const BuildType &);
84 const BuildInfo &get_build_info() const { return build_info; }
86 virtual void do_prepare();
89 Cache &get_cache() const { return cache; }
91 virtual void save_caches();