|
@@ -43,14 +43,26 @@ namespace Usm {
|
|
|
cfg.map<Properties>("provides", o => o.map_from_provides_dict(), (o, v) => o.build_provides_dict(v));
|
|
|
cfg.map_properties_with<Dependencies>("depends", o => o.dependencies, (o, v) => o.dependencies = v, Dependencies.get_mapper());
|
|
|
cfg.map_properties_with<Executables>("execs", o => o.executables, (o, v) => o.executables = v, Executables.get_mapper());
|
|
|
- cfg.map_many<string>("flags", o => o.flags.select<string>(f => f.to_string()), (o, v) => o.flags = v.try_select<ManifestFlag>(f => ManifestFlag.from_string(f)).to_set());
|
|
|
- cfg.map<string>("md", o => o.markdown_path, (o, v) => o.markdown_path = v, false);
|
|
|
- cfg.map<string>("url", o => o.url, (o, v) => o.url = v, false);
|
|
|
- cfg.map_many<string>("screenshots", o => o.screenshot_paths, (o, v) => o.screenshot_paths = v.to_vector(), false);
|
|
|
- cfg.map<string>("icon", o => o.icon_path, (o, v) => o.icon_path = v, false);
|
|
|
- cfg.map<string>("metainfo", o => o.metainfo_path, (o, v) => o.metainfo_path = v, false);
|
|
|
+ cfg.map_many<string>("flags", o => o.flags.select<string>(f => f.to_string()), (o, v) => o.flags = v.attempt_select<ManifestFlag>(f => ManifestFlag.from_string(f)).to_set());
|
|
|
+ cfg.map<string>("md", o => o.markdown_path, (o, v) => o.markdown_path = v)
|
|
|
+ .undefined_when(o => o.markdown_path == null)
|
|
|
+ .when_undefined(o => o.markdown_path = null);
|
|
|
+ cfg.map<string>("url", o => o.url, (o, v) => o.url = v)
|
|
|
+ .undefined_when(o => o.url == null)
|
|
|
+ .when_undefined(o => o.url = null);
|
|
|
+ cfg.map_many<string>("screenshots", o => o.screenshot_paths, (o, v) => o.screenshot_paths = v.to_vector())
|
|
|
+ .undefined_when(o => o.screenshot_paths == null)
|
|
|
+ .when_undefined(o => o.screenshot_paths = null);
|
|
|
+ cfg.map<string>("icon", o => o.icon_path, (o, v) => o.icon_path = v)
|
|
|
+ .undefined_when(o => o.icon_path == null)
|
|
|
+ .when_undefined(o => o.icon_path = null);
|
|
|
+ cfg.map<string>("metainfo", o => o.metainfo_path, (o, v) => o.metainfo_path = v)
|
|
|
+ .undefined_when(o => o.metainfo_path == null)
|
|
|
+ .when_undefined(o => o.metainfo_path = null);
|
|
|
// cfg.map_with<Git>("git", o => o.git, (o, v) => o.git = v, Git.get_mapper(), false);
|
|
|
- cfg.map<Properties>("extras", o => o.extra_properties, (o, v) => o.extra_properties = v, false);
|
|
|
+ cfg.map<Properties>("extras", o => o.extra_properties, (o, v) => o.extra_properties = v)
|
|
|
+ .undefined_when(o => o.extra_properties == null)
|
|
|
+ .when_undefined(o => o.extra_properties = null);
|
|
|
cfg.set_constructor(() => new Manifest());
|
|
|
});
|
|
|
}
|