summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcalkinsc <calkinsc@a3e5c962-4219-0410-a828-e124f845ac39>2010-11-02 19:14:44 +0000
committercalkinsc <calkinsc@a3e5c962-4219-0410-a828-e124f845ac39>2010-11-02 19:14:44 +0000
commit0133c72eee52f958609c74899cea14ad45608f5c (patch)
treed94d3d8bba365335fd2a13465bf154c395f249df
parente837506acbcef31264ccaa731dc4679b1dbf82ef (diff)
downloadMPC-0133c72eee52f958609c74899cea14ad45608f5c.tar.gz
Tue Nov 2 19:13:09 UTC 2010 Charles Calkins <calkinsc@ociweb.com>
* modules/WixWorkspaceCreator.pm: Generalized the configuration and platform selection to match what is available in the projects, instead of assuming default VC-style configurations. * templates/wix.mpd: * templates/wixcs.mpd: Added normalize() to the configuration and platform values to handle entries such as "Windows Mobile 6 SDK".
-rw-r--r--ChangeLog16
-rw-r--r--modules/WixWorkspaceCreator.pm68
-rw-r--r--templates/wix.mpd10
-rw-r--r--templates/wixcs.mpd16
4 files changed, 62 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index c04dd397..06fb9c05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,24 @@
+Tue Nov 2 19:13:09 UTC 2010 Charles Calkins <calkinsc@ociweb.com>
+
+ * modules/WixWorkspaceCreator.pm:
+
+ Generalized the configuration and platform selection to match
+ what is available in the projects, instead of assuming default
+ VC-style configurations.
+
+ * templates/wix.mpd:
+ * templates/wixcs.mpd:
+
+ Added normalize() to the configuration and platform values to
+ handle entries such as "Windows Mobile 6 SDK".
+
Tue Nov 2 17:23:26 UTC 2010 Charles Calkins <calkinsc@ociweb.com>
* docs/templates/wix.txt:
* modules/WixProjectCreator.pm:
* modules/WixWorkspaceCreator.pm:
* templates/wix.mpd:
-
+
Changed the "wix2" flag to "wix_extended" and fixed formatting
to match existing convention.
diff --git a/modules/WixWorkspaceCreator.pm b/modules/WixWorkspaceCreator.pm
index 9e5a67d9..446432f5 100644
--- a/modules/WixWorkspaceCreator.pm
+++ b/modules/WixWorkspaceCreator.pm
@@ -59,6 +59,13 @@ sub write_comps {
}
}
+
+sub normalize {
+ my $val = shift;
+ $val =~ tr/ \t\/\\\-$()./_/;
+ return $val;
+}
+
sub post_workspace {
my($self, $fh) = @_;
my $info = $self->get_project_info();
@@ -109,47 +116,40 @@ sub post_workspace {
push(@dep_stack, $dep) if !exists $all_deps{$dep};
}
}
-
- # Create two configurations, Debug and Release, for each project - WiX is for Windows, so this is guaranteed
- my @configs = ('Debug', 'Release');
- foreach my $config (@configs) {
- # For each configuration, emit two platforms, Win32 and x64, but be careful of AnyCPU
- my @platforms = ('Win32', 'x64');
- foreach my $platform (@platforms) {
+ # for every config/platform pairing, emit a MainGroup
+ foreach my $cfg (@cfgs_main) {
+ my ($config, $platform) = split('\|', $cfg);
- print $fh ' <Fragment>'.$crlf;
- print $fh ' <ComponentGroup Id="MainGroup.'.$config.'_'.$platform.'_'.$pname_main.'">'.$crlf;
+ print $fh ' <Fragment>'.$crlf;
+ print $fh ' <ComponentGroup Id="MainGroup.'.normalize($config).'_'.normalize($platform).'_'.$pname_main.'">'.$crlf;
- # add main project - pattern is "ComponentGroup.<Debug|Release>_<Win32|x64|AnyCPU>_<projectname>"
- my $pform = $platform;
- if (!exists {map { $_ => 1 } @cfgs_main}->{$config.'|'.$pform}) {
- $pform = 'AnyCPU';
- }
- print $fh ' <ComponentGroupRef Id="ComponentGroup.'.$config.'_'.$pform.'_'.$pname_main.'" />'.$crlf;
-
- # loop over each dependency, and obtain its parameters
- foreach my $dep (keys %all_deps) {
- foreach my $p (@{$self->{'projects'}}) {
- if ($dep eq $self->{'project_info'}->{$p}->[0] || $dep eq $self->mpc_basename($p)) {
- my($pname_dep, $rawdeps_dep, $guid_dep, $language_dep, $custom_only_dep, $nocross_dep, $managed_dep, $make_group_main, @cfgs_dep) = @{$$info{$p}};
-
- # add dependency
- $pform = $platform;
- if (!exists {map { $_ => 1 } @cfgs_dep}->{$config.'|'.$pform}) {
- $pform = 'AnyCPU';
- }
- print $fh ' <ComponentGroupRef Id="ComponentGroup.'.$config.'_'.$pform.'_'.$pname_dep.'" />'.$crlf;
-
- last;
+ # add main project - pattern is "ComponentGroup.<Debug|Release>_<Win32|x64|AnyCPU>_<projectname>"
+ print $fh ' <ComponentGroupRef Id="ComponentGroup.'.normalize($config).'_'.normalize($platform).'_'.$pname_main.'" />'.$crlf;
+
+ # loop over each dependency, and obtain its parameters
+ foreach my $dep (keys %all_deps) {
+ foreach my $p (@{$self->{'projects'}}) {
+ if ($dep eq $self->{'project_info'}->{$p}->[0] || $dep eq $self->mpc_basename($p)) {
+ my($pname_dep, $rawdeps_dep, $guid_dep, $language_dep, $custom_only_dep, $nocross_dep, $managed_dep, $make_group_main, @cfgs_dep) = @{$$info{$p}};
+
+ # add dependency - include AnyCPU if no dependency configuration matches exactly (if the AnyCPU platform exists, that is)
+ my $pform = $platform;
+ if (!exists {map { $_ => 1 } @cfgs_dep}->{$config.'|'.$pform}) {
+ $pform = 'AnyCPU';
+ }
+ if (exists {map { $_ => 1 } @cfgs_dep}->{$config.'|'.$pform}) {
+ print $fh ' <ComponentGroupRef Id="ComponentGroup.'.normalize($config).'_'.normalize($pform).'_'.$pname_dep.'" />'.$crlf;
}
+
+ last;
}
}
-
- print $fh ' </ComponentGroup>'.$crlf;
- print $fh ' </Fragment>'.$crlf;
- print $fh $crlf;
}
+
+ print $fh ' </ComponentGroup>'.$crlf;
+ print $fh ' </Fragment>'.$crlf;
+ print $fh $crlf;
}
}
diff --git a/templates/wix.mpd b/templates/wix.mpd
index 22124b0f..3e660a56 100644
--- a/templates/wix.mpd
+++ b/templates/wix.mpd
@@ -9,10 +9,10 @@
<%comment("same fragment, and just the debug component is used in an installer, the release component will")%>
<%comment("be identified as unused, and an error generated. That is, it seems that referencing any component")%>
<%comment("in a fragment causes the entire fragment to be pulled in, and any unused component in the fragment will be flagged as an error")%>
- <Fragment Id="<%configuration%>_<%platform%>_<%project_name%>">
- <ComponentGroup Id="ComponentGroup.<%configuration%>_<%platform%>_<%project_name%>">
+ <Fragment Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>">
+ <ComponentGroup Id="ComponentGroup.<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>">
<%if(!no_binary)%>
- <ComponentRef Id="<%configuration%>_<%platform%><%foreach(name, install_location)%>_<%name%><%endfor%>.<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%normalize(exename)%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>" />
+ <ComponentRef Id="<%normalize(configuration)%>_<%normalize(platform)%><%foreach(name, install_location)%>_<%name%><%endfor%>.<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%normalize(exename)%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>" />
<%endif%>
<%if(gme_install || gme_decorator)%>
<ComponentRef Id="gme.component.<%gme_progid%>" />
@@ -36,8 +36,8 @@
<%foreach(name, install_location)%>
<Directory Id="<%project_name%>.binary.<%forcount%>.<%name%>" Name="<%name%>">
<%endfor%>
- <Component Id="<%configuration%>_<%platform%>.<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%normalize(exename)%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>" Guid="*">
- <File Id="<%configuration%>_<%platform%>_<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%>_dll<%else%><%normalize(exename)%>_exe<%endif%>"
+ <Component Id="<%normalize(configuration)%>_<%normalize(platform)%>.<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%normalize(exename)%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>" Guid="*">
+ <File Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%if(type_is_dynamic)%><%normalize(libname_prefix)%><%normalize(sharedname)%>_dll<%else%><%normalize(exename)%>_exe<%endif%>"
Name="<%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>"
Source="<%if(type_is_dynamic)%><%if(dllout)%><%full_path(dllout)%>/<%else%><%full_path(libout)%>/<%endif%><%else%><%if(type_is_static)%><%full_path(libout)%>/<%else%><%if(exeout)%><%full_path(exeout)%>/<%if(windows_style)%><%output_dir("Debug")%>/<%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%>/<%else%><%output_dir(".")%>/<%endif%><%endif%><%endif%><%endif%><%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>"
DiskId="<%diskid(1)%>"
diff --git a/templates/wixcs.mpd b/templates/wixcs.mpd
index 655d2d4f..dd003728 100644
--- a/templates/wixcs.mpd
+++ b/templates/wixcs.mpd
@@ -8,16 +8,16 @@
<%comment("same fragment, and just the debug component is used in an installer, the release component will")%>
<%comment("be identified as unused, and an error generated. That is, it seems that referencing any component")%>
<%comment("in a fragment causes the entire fragment to be pulled in, and any unused component in the fragment will be flagged as an error")%>
- <Fragment Id="<%configuration%>_<%platform%>_<%project_name%>">
- <ComponentGroup Id="ComponentGroup.<%configuration%>_<%platform%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%>">
+ <Fragment Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>">
+ <ComponentGroup Id="ComponentGroup.<%normalize(configuration)%>_<%normalize(platform)%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%>">
<%if(!no_binary)%>
- <ComponentRef Id="<%configuration%>_<%platform%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>" />
+ <ComponentRef Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>" />
<%endif%>
<%foreach(cultures)%>
<%if(compares(culture, _neutral_))%>
<%comment("Do nothing here - the neutral culture will be built as the primary output of the project")%>
<%else%>
- <ComponentRef Id="<%configuration%>_<%platform%>_<%project_name%>_<%normalize(culture)%>" />
+ <ComponentRef Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>_<%normalize(culture)%>" />
<%endif%>
<%endfor%>
</ComponentGroup>
@@ -25,8 +25,8 @@
<DirectoryRef Id="INSTALLDIR">
<%marker(component_top)%>
<%if(!no_binary)%>
- <Component Id="<%configuration%>_<%platform%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>" Guid="*">
- <File Id="<%configuration%>_<%platform%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>"
+ <Component Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>" Guid="*">
+ <File Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>"
Name="<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>"
Source="<%if(exename)%><%if(exeout)%><%full_path(exeout)%><%if(windows_style)%>/<%output_dir%><%endif%><%else%>./<%output_dir%><%endif%><%else%><%if(dllout)%><%full_path(dllout)%><%else%><%full_path(libout)%><%endif%>/<%output_dir%><%endif%>/<%if(exename || sharedname || staticname)%><%if(exename)%><%exename%><%else%><%libname_prefix%><%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%><%endif%><%else%><%project_name%><%endif%><%if(exename)%><%exe_ext%><%else%><%dll_ext%><%endif%>"
DiskId="<%diskid(1)%>" />
@@ -38,8 +38,8 @@
<%comment("Do nothing here - the neutral culture will be built as the primary output of the project")%>
<%else%>
<Directory Id="<%project_name%>.<%normalize(culture)%>.<%forcount%>" Name="<%culture%>">
- <Component Id="<%configuration%>_<%platform%>_<%project_name%>_<%normalize(culture)%>" Guid="*">
- <File Id="<%configuration%>_<%platform%>_<%project_name%>_<%normalize(culture)%>"
+ <Component Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>_<%normalize(culture)%>" Guid="*">
+ <File Id="<%normalize(configuration)%>_<%normalize(platform)%>_<%project_name%>_<%normalize(culture)%>"
Name="<%project_name%>.resources.dll"
Source="<%if(exename)%><%if(exeout)%><%full_path(exeout)%><%if(windows_style)%>/<%output_dir%><%endif%><%else%>./<%output_dir%><%endif%><%else%><%if(dllout)%><%full_path(dllout)%><%else%><%full_path(libout)%><%endif%>/<%output_dir%><%endif%>/<%culture%>/<%project_name%>.resources.dll"
DiskId="<%diskid(1)%>" />