diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-10 17:51:47 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-11 13:10:38 +0100 |
commit | eda9beace3caad0be71f9b7bf245ae0805d855bb (patch) | |
tree | 408d992265cc4999fc6ed8de84cfc27958f9171b /tools | |
parent | 9c4ef6a6fcdeaf6d9e93e2986e8165374a6e9cf8 (diff) | |
download | msitools-eda9beace3caad0be71f9b7bf245ae0805d855bb.tar.gz msitools-eda9beace3caad0be71f9b7bf245ae0805d855bb.tar.xz msitools-eda9beace3caad0be71f9b7bf245ae0805d855bb.zip |
wixl: handle ComponentGroup and ComponentGroupRef
Diffstat (limited to 'tools')
-rw-r--r-- | tools/wixl/builder.vala | 23 | ||||
-rw-r--r-- | tools/wixl/wix.vala | 24 |
2 files changed, 44 insertions, 3 deletions
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala index 701bba4..9a25737 100644 --- a/tools/wixl/builder.vala +++ b/tools/wixl/builder.vala @@ -383,13 +383,30 @@ namespace Wixl { } + void feature_add_component (WixFeature feature, WixComponent component) throws GLib.Error { + component.in_feature.append (feature); + db.table_feature_components.add (feature.Id, component.Id); + } + public override void visit_component_ref (WixComponentRef ref) throws GLib.Error { + var component = resolve<WixComponent> (@ref); + + if (ref.parent is WixFeature) { + feature_add_component (@ref.parent as WixFeature, component); + } else if (ref.parent is WixComponentGroup) { + // will be added in GroupRef + } else + warning ("unhandled parent type %s", @ref.parent.name); + } + + public override void visit_component_group_ref (WixComponentGroupRef ref) throws GLib.Error { + var group = resolve<WixComponentGroup> (@ref); + if (ref.parent is WixFeature) { var feature = ref.parent as WixFeature; - var component = resolve<WixComponent> (@ref); - component.in_feature.append (feature); - db.table_feature_components.add (feature.Id, @ref.Id); + foreach (var comp in group.children) + feature_add_component (feature, resolve<WixComponent> (comp as WixElement)); } else warning ("unhandled parent type %s", @ref.parent.name); } diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala index eb7f08a..b336441 100644 --- a/tools/wixl/wix.vala +++ b/tools/wixl/wix.vala @@ -28,6 +28,7 @@ namespace Wixl { public abstract void visit_upgrade_version (WixUpgradeVersion version) throws GLib.Error; public abstract void visit_action (WixAction action) throws GLib.Error; public abstract void visit_text (WixText text) throws GLib.Error; + public abstract void visit_component_group_ref (WixComponentGroupRef ref) throws GLib.Error; } public abstract class WixNode: Object { @@ -210,6 +211,16 @@ namespace Wixl { } } + public class WixComponentGroup: WixElement { + static construct { + name = "ComponentGroup"; + + add_child_types (child_types, { + typeof (WixComponentRef), + }); + } + } + public class WixFragment: WixElement { static construct { name = "Fragment"; @@ -217,6 +228,7 @@ namespace Wixl { add_child_types (child_types, { typeof (WixDirectory), typeof (WixDirectoryRef), + typeof (WixComponentGroup), }); } @@ -370,6 +382,7 @@ namespace Wixl { add_child_types (child_types, { typeof (WixComponentRef), + typeof (WixComponentGroupRef), typeof (WixFeature), }); } @@ -398,6 +411,17 @@ namespace Wixl { } } + public class WixComponentGroupRef: WixElementRef<WixComponentGroup> { + static construct { + name = "ComponentGroupRef"; + ref_type = typeof (WixComponentGroup); + } + + public override void accept (WixNodeVisitor visitor) throws GLib.Error { + visitor.visit_component_group_ref (this); + } + } + public class WixCondition: WixElement { static construct { name = "Condition"; |