diff options
author | Bruce Momjian | 2012-07-05 01:47:49 +0000 |
---|---|---|
committer | Bruce Momjian | 2012-07-05 01:47:49 +0000 |
commit | 042d9ffc282a8c796d2a5babc600c1a6db150dac (patch) | |
tree | 3204f89a7552bb9211aa9565f18367da150ffe60 /src/tools/msvc/VCBuildProject.pm | |
parent | d7c734841b3e6cb44de363a8a3d83c35b75b30d9 (diff) |
Run newly-configured perltidy script on Perl files.
Run on HEAD and 9.2.
Diffstat (limited to 'src/tools/msvc/VCBuildProject.pm')
-rw-r--r-- | src/tools/msvc/VCBuildProject.pm | 68 |
1 files changed, 44 insertions, 24 deletions
diff --git a/src/tools/msvc/VCBuildProject.pm b/src/tools/msvc/VCBuildProject.pm index a7fd0c0d9d5..1022329dce2 100644 --- a/src/tools/msvc/VCBuildProject.pm +++ b/src/tools/msvc/VCBuildProject.pm @@ -14,7 +14,7 @@ use base qw(Project); sub _new { my $classname = shift; - my $self = $classname->SUPER::_new(@_); + my $self = $classname->SUPER::_new(@_); bless($self, $classname); $self->{filenameExtension} = '.vcproj'; @@ -32,10 +32,21 @@ sub WriteHeader <Platforms><Platform Name="$self->{platform}"/></Platforms> <Configurations> EOF - $self->WriteConfiguration($f, 'Debug', - {defs=>'_DEBUG;DEBUG=1;', wholeopt=>0, opt=>0, strpool=>'false', runtime=>3}); - $self->WriteConfiguration($f, 'Release', - {defs=>'', wholeopt=>0, opt=>3, strpool=>'true', runtime=>2}); + $self->WriteConfiguration( + $f, 'Debug', + { defs => '_DEBUG;DEBUG=1;', + wholeopt => 0, + opt => 0, + strpool => 'false', + runtime => 3 }); + $self->WriteConfiguration( + $f, + 'Release', + { defs => '', + wholeopt => 0, + opt => 3, + strpool => 'true', + runtime => 2 }); print $f <<EOF; </Configurations> EOF @@ -50,43 +61,49 @@ sub WriteFiles EOF my @dirstack = (); my %uniquefiles; - foreach my $fileNameWithPath (sort keys %{$self->{files}}) + foreach my $fileNameWithPath (sort keys %{ $self->{files} }) { confess "Bad format filename '$fileNameWithPath'\n" unless ($fileNameWithPath =~ /^(.*)\\([^\\]+)\.[r]?[cyl]$/); - my $dir = $1; + my $dir = $1; my $file = $2; - # Walk backwards down the directory stack and close any dirs we're done with + # Walk backwards down the directory stack and close any dirs we're done with while ($#dirstack >= 0) { - if (join('\\',@dirstack) eq substr($dir, 0, length(join('\\',@dirstack)))) + if (join('\\', @dirstack) eq + substr($dir, 0, length(join('\\', @dirstack)))) { - last if (length($dir) == length(join('\\',@dirstack))); - last if (substr($dir, length(join('\\',@dirstack)),1) eq '\\'); + last if (length($dir) == length(join('\\', @dirstack))); + last + if (substr($dir, length(join('\\', @dirstack)), 1) eq '\\'); } print $f ' ' x $#dirstack . " </Filter>\n"; pop @dirstack; } # Now walk forwards and create whatever directories are needed - while (join('\\',@dirstack) ne $dir) + while (join('\\', @dirstack) ne $dir) { - my $left = substr($dir, length(join('\\',@dirstack))); + my $left = substr($dir, length(join('\\', @dirstack))); $left =~ s/^\\//; my @pieces = split /\\/, $left; push @dirstack, $pieces[0]; - print $f ' ' x $#dirstack . " <Filter Name=\"$pieces[0]\" Filter=\"\">\n"; + print $f ' ' x $#dirstack + . " <Filter Name=\"$pieces[0]\" Filter=\"\">\n"; } - print $f ' ' x $#dirstack . " <File RelativePath=\"$fileNameWithPath\""; + print $f ' ' x $#dirstack + . " <File RelativePath=\"$fileNameWithPath\""; if ($fileNameWithPath =~ /\.y$/) { my $of = $fileNameWithPath; $of =~ s/\.y$/.c/; - $of =~ s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c}; + $of =~ +s{^src\\pl\\plpgsql\\src\\gram.c$}{src\\pl\\plpgsql\\src\\pl_gram.c}; print $f '>' - . $self->GenerateCustomTool('Running bison on ' . $fileNameWithPath, + . $self->GenerateCustomTool( + 'Running bison on ' . $fileNameWithPath, "perl src\\tools\\msvc\\pgbison.pl $fileNameWithPath", $of) . '</File>' . "\n"; } @@ -95,7 +112,8 @@ EOF my $of = $fileNameWithPath; $of =~ s/\.l$/.c/; print $f '>' - . $self->GenerateCustomTool('Running flex on ' . $fileNameWithPath, + . $self->GenerateCustomTool( + 'Running flex on ' . $fileNameWithPath, "perl src\\tools\\msvc\\pgflex.pl $fileNameWithPath", $of) . '</File>' . "\n"; } @@ -139,7 +157,8 @@ EOF sub WriteConfiguration { my ($self, $f, $cfgname, $p) = @_; - my $cfgtype = ($self->{type} eq "exe")?1:($self->{type} eq "dll"?2:4); + my $cfgtype = + ($self->{type} eq "exe") ? 1 : ($self->{type} eq "dll" ? 2 : 4); my $libs = $self->GetAdditionalLinkerDependencies($cfgname, ' '); my $targetmachine = $self->{platform} eq 'Win32' ? 1 : 17; @@ -168,7 +187,8 @@ EOF EOF if ($self->{disablelinkerwarnings}) { - print $f "\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n"; + print $f +"\t\tAdditionalOptions=\"/ignore:$self->{disablelinkerwarnings}\"\n"; } if ($self->{implib}) { @@ -202,7 +222,7 @@ sub WriteReferences { my ($self, $f) = @_; print $f " <References>\n"; - foreach my $ref (@{$self->{references}}) + foreach my $ref (@{ $self->{references} }) { print $f " <ProjectReference ReferencedProjectIdentifier=\"$ref->{guid}\" Name=\"$ref->{name}\" />\n"; @@ -216,7 +236,7 @@ sub GenerateCustomTool if (!defined($cfg)) { return $self->GenerateCustomTool($desc, $tool, $output, 'Debug') - .$self->GenerateCustomTool($desc, $tool, $output, 'Release'); + . $self->GenerateCustomTool($desc, $tool, $output, 'Release'); } return "<FileConfiguration Name=\"$cfg|$self->{platform}\"><Tool Name=\"VCCustomBuildTool\" Description=\"$desc\" CommandLine=\"$tool\" AdditionalDependencies=\"\" Outputs=\"$output\" /></FileConfiguration>"; @@ -235,7 +255,7 @@ use base qw(VCBuildProject); sub new { my $classname = shift; - my $self = $classname->SUPER::_new(@_); + my $self = $classname->SUPER::_new(@_); bless($self, $classname); $self->{vcver} = '8.00'; @@ -256,7 +276,7 @@ use base qw(VCBuildProject); sub new { my $classname = shift; - my $self = $classname->SUPER::_new(@_); + my $self = $classname->SUPER::_new(@_); bless($self, $classname); $self->{vcver} = '9.00'; |