{
SourcePackage *pkg = new SourcePackage(obj, n, get_source());
- if(options)
- load_sub(*pkg, *options);
- else
- load_sub(*pkg);
+ load_sub(*pkg, options);
if(obj.build_type)
pkg->set_build_type(*obj.build_type);
}
-SourcePackage::Loader::Loader(SourcePackage &p):
+SourcePackage::Loader::Loader(SourcePackage &p, const Config::InputOptions *o):
DataFile::DerivedObjectLoader<SourcePackage, Package::Loader>(p),
- FeatureConditional(p, p.name)
+ FeatureConditional(p, p.name),
+ options(o)
{
- init(0);
-}
-
-SourcePackage::Loader::Loader(SourcePackage &p, const Config::InputOptions &o):
- DataFile::DerivedObjectLoader<SourcePackage, Package::Loader>(p),
- FeatureConditional(p, p.name)
-{
- init(&o);
-}
-
-void SourcePackage::Loader::init(const Config::InputOptions *o)
-{
- options = o;
add("android_application", &Loader::component<AndroidApplicationComponent>);
add("build_info", &Loader::build_info);
add("datapack", &Loader::component<DataPackComponent>);
const Config::InputOptions *options;
public:
- Loader(SourcePackage &);
- Loader(SourcePackage &, const Config::InputOptions &);
+ Loader(SourcePackage &, const Config::InputOptions *);
private:
- void init(const Config::InputOptions *);
void finish() override;
+
void feature(const std::string &, const std::string &);
template<typename C>
void component(const std::string &);