|
@@ -30,23 +30,23 @@ namespace Usm {
|
|
|
public Properties? extra_properties { get; set; }
|
|
|
|
|
|
public static PropertyMapper<Manifest> get_mapper() {
|
|
|
- return once<PropertyMapper<Manifest>>(() => new PropertyMapperBuilder<Manifest>()
|
|
|
- .map<string>("name", o => o.name, (o, v) => o.name = v)
|
|
|
- .map<string>("version", o => o.version.to_string(), (o, v) => o.version = new Version.from_string(v))
|
|
|
- .map<string>("summary", o => o.summary, (o, v) => o.summary = v)
|
|
|
- .map_many_with<Licence>("licences", o => o.licences, (o, v) => o.licences = v.to_vector(), Licence.get_mapper())
|
|
|
- .map<Properties>("provides", o => o.map_from_provides_dict(), (o, v) => o.build_provides_dict(v))
|
|
|
- .map_with<Dependencies>("depends", o => o.dependencies, (o, v) => o.dependencies = v, Dependencies.get_mapper())
|
|
|
- .map_with<Executables>("execs", o => o.executables, (o, v) => o.executables = v, Executables.get_mapper())
|
|
|
- .map<string>("md", o => o.markdown_path, (o, v) => o.markdown_path = v, false)
|
|
|
- .map<string>("url", o => o.url, (o, v) => o.url = v, false)
|
|
|
- .map_many<string>("screenshots", o => o.screenshot_paths, (o, v) => o.screenshot_paths = v.to_vector(), false)
|
|
|
- .map<string>("icon", o => o.icon_path, (o, v) => o.icon_path = v, false)
|
|
|
- .map<string>("metainfo", o => o.metainfo_path, (o, v) => o.metainfo_path = v, false)
|
|
|
- .map_with<Git>("git", o => o.git, (o, v) => o.git = v, Git.get_mapper(), false)
|
|
|
- .map<Properties>("extras", o => o.extra_properties, (o, v) => o.extra_properties = v, false)
|
|
|
- .set_constructor(() => new Manifest())
|
|
|
- .build());
|
|
|
+ return PropertyMapper.build_for<Manifest>(cfg => {
|
|
|
+ cfg.map<string>("name", o => o.name, (o, v) => o.name = v);
|
|
|
+ cfg.map<string>("version", o => o.version.to_string(), (o, v) => o.version = new Version.from_string(v));
|
|
|
+ cfg.map<string>("summary", o => o.summary, (o, v) => o.summary = v);
|
|
|
+ cfg.map_many_with<Licence>("licences", o => o.licences, (o, v) => o.licences = v.to_vector(), Licence.get_mapper());
|
|
|
+ cfg.map<Properties>("provides", o => o.map_from_provides_dict(), (o, v) => o.build_provides_dict(v));
|
|
|
+ cfg.map_with<Dependencies>("depends", o => o.dependencies, (o, v) => o.dependencies = v, Dependencies.get_mapper());
|
|
|
+ cfg.map_with<Executables>("execs", o => o.executables, (o, v) => o.executables = v, Executables.get_mapper());
|
|
|
+ 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_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.set_constructor(() => new Manifest());
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void build_provides_dict(Properties obj) throws Error {
|