Wed Jun 9 07:35:19 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
[MPC.git] / modules / WixWorkspaceCreator.pm
blob5ea4fe0aa6269a08ab8f34d62d33c13993208c84
1 package WixWorkspaceCreator;
3 # ************************************************************
4 # Description : A Wix Workspace creator
5 # Author : James H. Hill
6 # Create Date : 6/23/2009
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
14 use WixProjectCreator;
15 use WorkspaceCreator;
16 use WinWorkspaceBase;
18 use vars qw(@ISA);
19 @ISA = qw(WinWorkspaceBase WorkspaceCreator);
21 # ************************************************************
22 # Data Section
23 # ************************************************************
26 # ************************************************************
27 # Subroutine Section
28 # ************************************************************
30 sub workspace_file_extension {
31 return '.wxs';
34 sub workspace_file_name {
35 my $self = shift;
36 return $self->get_modified_workspace_name($self->get_workspace_name(),
37 '.wxi');
40 sub pre_workspace {
41 my($self, $fh) = @_;
42 my $crlf = $self->crlf();
43 my $name = $self->get_workspace_name();
45 ## Begin the project definition for the workspace
46 print $fh '<?xml version="1.0" encoding="utf-8" standalone="yes"?>', $crlf,
47 '<Include>', $crlf;
50 sub write_comps {
51 my($self, $fh) = @_;
52 my $crlf = $self->crlf();
55 # print the target for clean
56 foreach my $project ($self->sort_dependencies($self->get_projects())) {
57 print $fh " <?include $project ?>", $crlf;
61 sub post_workspace {
62 my($self, $fh) = @_;
63 my $info = $self->get_project_info();
64 my $crlf = $self->crlf();
66 # Create a component group consisting of all the projects.
67 print $fh $crlf,
68 ' <Fragment>', $crlf,
69 ' <ComponentGroup Id="',
70 $self->get_workspace_name(), '">', $crlf;
72 foreach my $project ($self->sort_dependencies($self->get_projects())) {
73 print $fh ' <ComponentGroupRef Id="ComponentGroup.',
74 $$info{$project}->[0], '" />', $crlf;
77 print $fh ' </ComponentGroup>', $crlf,
78 ' </Fragment>', $crlf,
79 '</Include>', $crlf;