summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcalkinsc <calkinsc@a3e5c962-4219-0410-a828-e124f845ac39>2010-11-02 17:24:47 +0000
committercalkinsc <calkinsc@a3e5c962-4219-0410-a828-e124f845ac39>2010-11-02 17:24:47 +0000
commite837506acbcef31264ccaa731dc4679b1dbf82ef (patch)
tree15139e634b63efc29fb622c2fc5cd1259358cae3
parent22c608a05db29834959ad691cd843666c04db945 (diff)
downloadMPC-e837506acbcef31264ccaa731dc4679b1dbf82ef.tar.gz
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.
-rw-r--r--ChangeLog12
-rw-r--r--docs/templates/wix.txt2
-rw-r--r--modules/WixProjectCreator.pm50
-rw-r--r--modules/WixWorkspaceCreator.pm122
-rw-r--r--templates/wix.mpd2
5 files changed, 98 insertions, 90 deletions
diff --git a/ChangeLog b/ChangeLog
index 98a896a9..c04dd397 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,18 @@
-Sat Oct 30 00:11:31 UTC 2010 Charles Calkins <calkinsc@ociweb.com>
+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.
+
+Sat Oct 30 00:11:31 UTC 2010 Charles Calkins <calkinsc@ociweb.com>
+
+ * modules/WixProjectCreator.pm:
+ * modules/WixWorkspaceCreator.pm:
+
Removed unneeded comments.
Fri Oct 29 18:44:33 UTC 2010 Charles Calkins <calkinsc@ociweb.com>
diff --git a/docs/templates/wix.txt b/docs/templates/wix.txt
index cbe7041a..6ae25765 100644
--- a/docs/templates/wix.txt
+++ b/docs/templates/wix.txt
@@ -8,7 +8,7 @@
guid = The value for this variable is generated during project generation.
install_location = A space separated list of installation directories.
source_directory = The value of either exeout, dllout, or libout with the variable portion converted to a suitable value for WIX.
-// if wix2=1 is set
+// if wix_extended=1 is set
exclude = If true (1), no components are generated for WiX for this project
guid = The value for this variable is generated during project generation.
install_location = A space separated list of installation directories.
diff --git a/modules/WixProjectCreator.pm b/modules/WixProjectCreator.pm
index 0d41ef4a..068ab8b2 100644
--- a/modules/WixProjectCreator.pm
+++ b/modules/WixProjectCreator.pm
@@ -107,8 +107,8 @@ sub is_culture_code {
'he-IL', 'uz', 'hi', 'uz-UZ-Cyrl', 'hi-IN', 'uz-UZ-Latn',
'hu', 'vi');
- return 1 if (exists {map { $_ => 1 } @culture_codes}->{$culture_code});
- return 0;
+ return 1 if (exists {map { $_ => 1 } @culture_codes}->{$culture_code});
+ return 0;
}
@@ -164,29 +164,29 @@ sub fill_value {
my $crlf = $self->crlf();
- # iterate over resx_files, make list of culture abbreviations
- my @resx_files = $self->get_component_list('resx_files');
-
- my %cultures = ();
- foreach my $resx_file (@resx_files) {
- my @parts = split('\.', $resx_file);
- if ($parts[-1] eq 'resx') { # if the file is a .resx file
- if (is_culture_code($parts[-2])) { # if a culture is specified
- $cultures{$parts[-2]} = 1; # remember that culture
- }
- else {
- $cultures{'_neutral_'} = 1; # have a neutral culture
- }
- }
- }
-
- # flatten into a string
- my $found_cultures = '';
- foreach my $culture (keys %cultures) {
- $found_cultures = $found_cultures . $culture . ' ';
- }
-
- return $found_cultures;
+ # iterate over resx_files, make list of culture abbreviations
+ my @resx_files = $self->get_component_list('resx_files');
+
+ my %cultures = ();
+ foreach my $resx_file (@resx_files) {
+ my @parts = split('\.', $resx_file);
+ if ($parts[-1] eq 'resx') { # if the file is a .resx file
+ if (is_culture_code($parts[-2])) { # if a culture is specified
+ $cultures{$parts[-2]} = 1; # remember that culture
+ }
+ else {
+ $cultures{'_neutral_'} = 1; # have a neutral culture
+ }
+ }
+ }
+
+ # flatten into a string
+ my $found_cultures = '';
+ foreach my $culture (keys %cultures) {
+ $found_cultures = $found_cultures . $culture . ' ';
+ }
+
+ return $found_cultures;
}
return undef;
}
diff --git a/modules/WixWorkspaceCreator.pm b/modules/WixWorkspaceCreator.pm
index 1da70e4d..9e5a67d9 100644
--- a/modules/WixWorkspaceCreator.pm
+++ b/modules/WixWorkspaceCreator.pm
@@ -94,69 +94,67 @@ sub post_workspace {
# for each project, find all dependencies
foreach my $project (keys %project_dependencies) {
# foreach my $cfg (@cfgs_main) -> <configuration|platform> could be <Debug|AnyCPU Release|AnyCPU> or <Debug|Win32 Release|Win32 Debug|x64 Release|x64>
- my($pname_main, $rawdeps_main, $guid_main, $language_main, $custom_only_main, $nocross_main, $managed_main, $make_group_main, @cfgs_main) = @{$$info{$project}};
-
- # only generate a group if "make_group = 1"
- if ($make_group_main) {
-
- my %all_deps = (); # all dependencies used by any project referenced by $project
- my @dep_stack = ($project);
- while (my $top = pop @dep_stack) {
- # add current project to dependencies (use hash key as set)
- $all_deps{$top} = 1;
- my $deps = $project_dependencies{$top};
- foreach my $dep (@$deps) {
- # add current project's dependencies to stack for processing, if not already processed
- 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) {
-
- print $fh ' <Fragment>'.$crlf;
- print $fh ' <ComponentGroup Id="MainGroup.'.$config.'_'.$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;
- }
- }
- }
-
- print $fh ' </ComponentGroup>'.$crlf;
- print $fh ' </Fragment>'.$crlf;
- print $fh $crlf;
- }
- }
-
- }
+ my($pname_main, $rawdeps_main, $guid_main, $language_main, $custom_only_main, $nocross_main, $managed_main, $make_group_main, @cfgs_main) = @{$$info{$project}};
+
+ # only generate a group if "make_group = 1"
+ if ($make_group_main) {
+ my %all_deps = (); # all dependencies used by any project referenced by $project
+ my @dep_stack = ($project);
+ while (my $top = pop @dep_stack) {
+ # add current project to dependencies (use hash key as set)
+ $all_deps{$top} = 1;
+ my $deps = $project_dependencies{$top};
+ foreach my $dep (@$deps) {
+ # add current project's dependencies to stack for processing, if not already processed
+ 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) {
+
+ print $fh ' <Fragment>'.$crlf;
+ print $fh ' <ComponentGroup Id="MainGroup.'.$config.'_'.$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;
+ }
+ }
+ }
+
+ print $fh ' </ComponentGroup>'.$crlf;
+ print $fh ' </Fragment>'.$crlf;
+ print $fh $crlf;
+ }
+ }
+
+ }
}
-
+
print $fh '</Include>'.$crlf;
}
diff --git a/templates/wix.mpd b/templates/wix.mpd
index ef916639..22124b0f 100644
--- a/templates/wix.mpd
+++ b/templates/wix.mpd
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Include>
<%marker(top)%>
-<%if(wix2)%>
+<%if(wix_extended)%>
<%foreach(platforms)%>
<%foreach(configurations)%>
<%if(!exclude)%>