summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2009-08-06 15:11:29 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2009-08-06 15:11:29 +0000
commitae852ecc235e2786969e3acdc1635a374ae30ce3 (patch)
tree284ddc6084eb28c12023029a1085c0f1aee0cf0c
parenta848b3ffe64557afc4ec3c864a982cb3e290870a (diff)
downloadMPC-ae852ecc235e2786969e3acdc1635a374ae30ce3.tar.gz
ChangeLogTag: Thu Aug 6 15:11:07 UTC 2009 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog24
-rwxr-xr-xdevtools/document_template.pl12
-rw-r--r--modules/CCProjectCreator.pm2
-rw-r--r--modules/Creator.pm46
-rw-r--r--modules/MakeProjectCreator.pm41
-rw-r--r--modules/MakeWorkspaceCreator.pm2
-rw-r--r--modules/Options.pm23
-rw-r--r--modules/ProjectCreator.pm50
-rw-r--r--modules/VC6ProjectCreator.pm4
-rw-r--r--modules/VC7ProjectCreator.pm63
-rw-r--r--modules/VC7WorkspaceCreator.pm10
-rw-r--r--modules/VC8ProjectCreator.pm61
-rw-r--r--modules/VC8WorkspaceCreator.pm18
-rw-r--r--modules/WB26ProjectCreator.pm2
14 files changed, 225 insertions, 133 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ee853ee..8d402bdd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+Thu Aug 6 15:11:07 UTC 2009 Chad Elliott <elliott_c@ociweb.com>
+
+ * devtools/document_template.pl:
+ * modules/CCProjectCreator.pm:
+ * modules/Creator.pm:
+ * modules/MakeProjectCreator.pm:
+ * modules/MakeWorkspaceCreator.pm:
+ * modules/Options.pm:
+ * modules/ProjectCreator.pm:
+ * modules/VC6ProjectCreator.pm:
+ * modules/VC7ProjectCreator.pm:
+ * modules/VC7WorkspaceCreator.pm:
+ * modules/VC8ProjectCreator.pm:
+ * modules/VC8WorkspaceCreator.pm:
+ * modules/WB26ProjectCreator.pm:
+
+ Replaced all language related strings with constants stored in the
+ Creator base class.
+
+ Also, fixed a bug where a project that contained source files or
+ resource files for a language not supported by the project type
+ would be created. Now, the project will be skipped if the project
+ type does not support the language setting.
+
Wed Aug 5 18:41:55 UTC 2009 Chad Elliott <elliott_c@ociweb.com>
* MPC.ico:
diff --git a/devtools/document_template.pl b/devtools/document_template.pl
index bd143511..f284dfa8 100755
--- a/devtools/document_template.pl
+++ b/devtools/document_template.pl
@@ -137,7 +137,9 @@ sub display_template {
sub usageAndExit {
print "document_template.pl v$version\n",
"Usage: ", basename($0), " <template> [<html output> [language]]\n\n",
- "language can be any of the valid language settings for MPC.\n";
+ "language defaults to ", Creator::defaultLanguage(),
+ ". It can be any of the valid language settings\nfor MPC:\n",
+ join(' ', sort(Creator::validLanguages())), "\n";
exit(0);
}
@@ -162,13 +164,13 @@ if (!defined $output) {
if (open($fh, $input)) {
if (!defined $language) {
if (index($input, 'vb') != -1) {
- $language = 'vb';
+ $language = Creator::vb();
}
- elsif (index($input, 'csharp') != -1) {
- $language = 'csharp';
+ elsif (index($input, 'csharp') != -1 || index($input, '.net') != -1) {
+ $language = Creator::csharp();
}
else {
- $language = 'cplusplus';
+ $language = Creator::cplusplus();
}
}
diff --git a/modules/CCProjectCreator.pm b/modules/CCProjectCreator.pm
index d3c3d673..f154ca46 100644
--- a/modules/CCProjectCreator.pm
+++ b/modules/CCProjectCreator.pm
@@ -33,7 +33,7 @@ sub override_valid_component_extensions {
my $comp = shift;
my @array = @_;
- if ($comp eq 'source_files' && $self->get_language() eq 'cplusplus') {
+ if ($comp eq 'source_files' && $self->languageIs(Creator::cplusplus)) {
push(@array, "\\.cdb");
}
diff --git a/modules/Creator.pm b/modules/Creator.pm
index adb03c1c..15cd6b7a 100644
--- a/modules/Creator.pm
+++ b/modules/Creator.pm
@@ -23,6 +23,25 @@ use vars qw(@ISA);
# Data Section
# ************************************************************
+## Constants for use throughout the project
+use constant cplusplus => 'cplusplus';
+use constant csharp => 'csharp';
+use constant java => 'java';
+use constant vb => 'vb';
+use constant website => 'website';
+
+## The default language for MPC
+my $deflang = 'cplusplus';
+
+## A map of all of the allowed languages. The 'website' value
+## is not here because it isn't really a language. It is used
+## as a language internally by some project types though.
+my %languages = (cplusplus => 1,
+ csharp => 1,
+ java => 1,
+ vb => 1,
+ );
+
my $assign_key = 'assign';
my $gassign_key = 'global_assign';
my %non_convert = ('prebuild' => 1,
@@ -74,7 +93,7 @@ sub new {
$self->{'name_modifier'} = $nmodifier;
$self->{'apply_project'} = $applypj;
$self->{'into'} = $into;
- $self->{'language'} = defined $language ? $language : 'cplusplus';
+ $self->{'language'} = defined $language ? $language : $deflang;
$self->{'use_env'} = $use_env;
$self->{'expand_vars'} = $expandvars;
$self->{'convert_slashes'} = $self->convert_slashes();
@@ -1084,6 +1103,31 @@ sub relative {
return $value;
}
+
+## Static function. Returns the default language for MPC.
+sub defaultLanguage {
+ return $deflang;
+}
+
+
+## Static function. Returns an array of valid languages.
+sub validLanguages {
+ return keys %languages;
+}
+
+
+## Static function. The one and only argument is the language
+## string to check for validity.
+sub isValidLanguage {
+ return defined $languages{$_[0]};
+}
+
+
+sub languageIs {
+ #my($self, $language) = @_;
+ return $_[0]->{'language'} eq $_[1];
+}
+
# ************************************************************
# Virtual Methods To Be Overridden
# ************************************************************
diff --git a/modules/MakeProjectCreator.pm b/modules/MakeProjectCreator.pm
index 181cab39..3c589fed 100644
--- a/modules/MakeProjectCreator.pm
+++ b/modules/MakeProjectCreator.pm
@@ -22,28 +22,33 @@ use vars qw(@ISA);
# Data Section
# ************************************************************
-my %info = ('cplusplus' => {'dllexe' => 'makeexe',
- 'dll' => 'makedll',
- 'template' => 'make',
- },
- 'csharp' => {'dllexe' => 'make.net',
- 'dll' => 'make.net',
- 'template' => 'make.net',
- },
- 'java' => {'dllexe' => 'makeexe',
- 'dll' => 'makedll',
- 'template' => 'make',
- },
- 'vb' => {'dllexe' => 'make.net',
- 'dll' => 'make.net',
- 'template' => 'make.net',
- },
+my %info = (Creator::cplusplus => {'dllexe' => 'makeexe',
+ 'dll' => 'makedll',
+ 'template' => 'make',
+ },
+ Creator::csharp => {'dllexe' => 'make.net',
+ 'dll' => 'make.net',
+ 'template' => 'make.net',
+ },
+ Creator::java => {'dllexe' => 'makeexe',
+ 'dll' => 'makedll',
+ 'template' => 'make',
+ },
+ Creator::vb => {'dllexe' => 'make.net',
+ 'dll' => 'make.net',
+ 'template' => 'make.net',
+ },
);
# ************************************************************
# Subroutine Section
# ************************************************************
+sub languageSupported {
+ return defined $info{$_[0]->get_language()};
+}
+
+
sub escape_spaces {
#my $self = shift;
return 1;
@@ -73,10 +78,10 @@ sub fill_value {
## .mpt file (make.net.mpt for csharp and makedll.mpt for all
## others).
my $language = $self->get_language();
- if ($language eq 'java') {
+ if ($language eq Creator::java) {
return 'java';
}
- elsif ($language eq 'csharp') {
+ elsif ($language eq Creator::csharp) {
return 'gmcs';
}
else {
diff --git a/modules/MakeWorkspaceCreator.pm b/modules/MakeWorkspaceCreator.pm
index b658fdc5..fe3c0d05 100644
--- a/modules/MakeWorkspaceCreator.pm
+++ b/modules/MakeWorkspaceCreator.pm
@@ -60,7 +60,7 @@ sub write_comps {
## Send all the information to our base class method
$self->write_named_targets($fh, $self->crlf(), \%targnum, \@list,
- ($self->get_language() eq 'csharp' ?
+ ($self->languageIs(Creator::csharp) ?
'bundle ' : '') . $targets, '', 'generated ',
$self->project_target_translation(1), 1);
}
diff --git a/modules/Options.pm b/modules/Options.pm
index 8a83f2fc..b8b0a9b0 100644
--- a/modules/Options.pm
+++ b/modules/Options.pm
@@ -17,17 +17,6 @@ use StringProcessor;
use ProjectCreator;
# ************************************************************
-# Data Section
-# ************************************************************
-
-my $deflang = 'cplusplus';
-my %languages = ('cplusplus' => 1,
- 'csharp' => 1,
- 'java' => 1,
- 'vb' => 1,
- );
-
-# ************************************************************
# Subroutine Section
# ************************************************************
@@ -59,7 +48,7 @@ sub printUsage {
my $olen = length($spaces) + 12;
my $len = $olen;
my $mlen = 77;
- my @keys = sort keys %languages;
+ my @keys = sort Creator::validLanguages();
for(my $i = 0; $i <= $#keys; $i++) {
my $klen = length($keys[$i]);
$len += $klen;
@@ -136,8 +125,8 @@ sub printUsage {
" structure starting at <directory>. This should be a\n" .
" full path.\n" .
" -language Specify the language preference; possible values are\n",
-" [", join(' ', sort keys %languages), "]. The default is\n".
-" $deflang.\n",
+" [", join(' ', sort(Creator::validLanguages())), "]. The default is\n".
+" " . Creator::defaultLanguage() . ".\n",
" -make_coexistence If multiple 'make' based project types are\n" .
" generated, they will be named such that they can coexist.\n" .
" -name_modifier Modify output names. The pattern passed to this\n" .
@@ -202,7 +191,7 @@ sub completion_command {
"'n/-ti/(dll lib dll_exe lib_exe)/:' ";
$str .= "'n/-language/(";
- my @keys = sort keys %languages;
+ my @keys = sort Creator::validLanguages();
for(my $i = 0; $i <= $#keys; $i++) {
$str .= $keys[$i];
$str .= " " if ($i != $#keys);
@@ -243,7 +232,7 @@ sub options {
my $nmodifier;
my $into;
my $hierarchy = 0;
- my $language = ($defaults ? $deflang : undef);
+ my $language = ($defaults ? Creator::defaultLanguage() : undef);
my $dynamic = ($defaults ? 1 : undef);
my $comments = ($defaults ? 1 : undef);
my $reldefs = ($defaults ? 1 : undef);
@@ -401,7 +390,7 @@ sub options {
if (!defined $language) {
$self->optionError('-language requires a language argument');
}
- elsif (!defined $languages{$language}) {
+ elsif (!Creator::isValidLanguage($language)) {
$self->optionError("$language is not a valid language");
}
}
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 5b9834ef..dc2faa5e 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -254,16 +254,16 @@ my %vbma = ('source_files' => [ 'subtype' ],
# 5 Name of the tag for 'resource_files' for this language
# * This is special because it gets treated like source_files in that
# a project with only these files is a library/exe not "custom only".
-my %language = ('cplusplus' => [ \%cppvc, \%cppec, \%cppma, 'main', 1,
- $cppresource ],
+my %language = (Creator::cplusplus => [ \%cppvc, \%cppec, \%cppma, 'main',
+ 1, $cppresource ],
- 'csharp' => [ \%csvc, {}, \%csma, 'Main', 0,
- $csresource ],
+ Creator::csharp => [ \%csvc, {}, \%csma, 'Main', 0,
+ $csresource ],
- 'java' => [ \%jvc, {}, {}, 'main', 0 ],
+ Creator::java => [ \%jvc, {}, {}, 'main', 0 ],
- 'vb' => [ \%vbvc, {}, \%vbma, 'Main', 0,
- $vbresource ],
+ Creator::vb => [ \%vbvc, {}, \%vbma, 'Main', 0,
+ $vbresource ],
);
my %mains;
@@ -2786,7 +2786,7 @@ sub sift_files {
## The special actions taken based on $saverc only applies to
## C++ resource files.
my $saverc = (!$alldir && $tag eq $self->get_resource_tag() &&
- $self->get_language() eq 'cplusplus');
+ $self->languageIs(Creator::cplusplus));
foreach my $ext (@$exts) {
foreach my $file (grep(/$ext$/, @$files)) {
@@ -4279,6 +4279,8 @@ sub need_to_write_project {
my $count = 0;
## We always write a project if the user has provided a verbatim.
+ ## We have no idea what that verbatim clause does, so we need to just
+ ## do what the user tells us to do.
return 1 if (defined $self->{'verbatim'}->{$self->{'pctype'}});
## The order here is important, we must check for source or resource
@@ -4288,10 +4290,22 @@ sub need_to_write_project {
my $names = $self->{$key};
foreach my $name (keys %$names) {
foreach my $key (keys %{$names->{$name}}) {
- ## Return 1 if we have found a source file or a resource file.
- ## Return 2 if we have found a custom input file (and thus no
- ## source or resource files due to the foreach order).
- return ($count >= 2 ? 2 : 1) if (defined $names->{$name}->{$key}->[0]);
+ ## See if the project contains a file that corresponds to this
+ ## component name.
+ if (defined $names->{$name}->{$key}->[0]) {
+ if ($count >= 2) {
+ ## Return 2 if we have found a custom input file (and thus no
+ ## source or resource files due to the foreach order).
+ return 2;
+ }
+ ## We have either source files or resource files, we need to
+ ## see if this project creator supports the current language.
+ ## If it doesn't then we don't need to create the project.
+ elsif ($self->languageSupported()) {
+ ## Return 1 if we have found a source file or a resource file.
+ return 1;
+ }
+ }
}
}
$count++;
@@ -4675,7 +4689,7 @@ sub add_default_matching_assignments {
sub reset_generating_types {
my $self = shift;
- my $lang = $self->get_language();
+ my $lang = $self->get_language();
my %reset = ('valid_components' => $language{$lang}->[0],
'custom_only_removed' => $language{$lang}->[0],
'exclude_components' => $language{$lang}->[1],
@@ -4716,9 +4730,8 @@ sub get_template_input {
if ($self->get_static() == 1) {
return $self->{'lib_template_input'}->{$lang}->{$tikey};
}
- else {
- return $self->{'dll_template_input'}->{$lang}->{$tikey};
- }
+
+ return $self->{'dll_template_input'}->{$lang}->{$tikey};
}
@@ -5169,6 +5182,11 @@ sub getValidComponents {
# Virtual Methods To Be Overridden
# ************************************************************
+sub languageSupported {
+ #my $self = shift;
+ return $_[0]->get_language() eq Creator::cplusplus;
+}
+
sub file_visible {
#my($self, $template) = @_;
return 1;
diff --git a/modules/VC6ProjectCreator.pm b/modules/VC6ProjectCreator.pm
index 402901eb..4a28f228 100644
--- a/modules/VC6ProjectCreator.pm
+++ b/modules/VC6ProjectCreator.pm
@@ -33,7 +33,7 @@ sub override_valid_component_extensions {
## Visual C++ 6.0 doesn't understand all of the extensions that MPC
## supports.
- if ($comp eq 'source_files' && $self->get_language() eq 'cplusplus') {
+ if ($comp eq 'source_files' && $self->languageIs(Creator::cplusplus)) {
return ["\\.cpp", "\\.cxx", "\\.c"];
}
@@ -46,7 +46,7 @@ sub override_exclude_component_extensions {
## Visual C++ 6.0 doesn't understand all of the extensions that MPC
## supports.
- if ($comp eq 'source_files' && $self->get_language() eq 'cplusplus') {
+ if ($comp eq 'source_files' && $self->languageIs(Creator::cplusplus)) {
return ["_T\\.cpp", "_T\\.cxx"];
}
diff --git a/modules/VC7ProjectCreator.pm b/modules/VC7ProjectCreator.pm
index 52ee8ffa..8182c23f 100644
--- a/modules/VC7ProjectCreator.pm
+++ b/modules/VC7ProjectCreator.pm
@@ -24,34 +24,34 @@ use vars qw(@ISA);
# Data Section
# ************************************************************
-my %info = ('cplusplus' => {'ext' => '.vcproj',
- 'dllexe' => 'vc7exe',
- 'libexe' => 'vc7libexe',
- 'dll' => 'vc7dll',
- 'lib' => 'vc7lib',
- 'template' => 'vc7',
- },
- 'csharp' => {'ext' => '.csproj',
- 'dllexe' => 'vc7csharp',
- 'libexe' => 'vc7csharp',
- 'dll' => 'vc7csharp',
- 'lib' => 'vc7csharp',
- 'template' => 'vc7csharp',
- },
- 'java' => {'ext' => '.vjsproj',
- 'dllexe' => 'vc7java',
- 'libexe' => 'vc7java',
- 'dll' => 'vc7java',
- 'lib' => 'vc7java',
- 'template' => 'vc7java',
- },
- 'vb' => {'ext' => '.vbproj',
- 'dllexe' => 'vc7vb',
- 'libexe' => 'vc7vb',
- 'dll' => 'vc7vb',
- 'lib' => 'vc7vb',
- 'template' => 'vc7vb',
- },
+my %info = (Creator::cplusplus => {'ext' => '.vcproj',
+ 'dllexe' => 'vc7exe',
+ 'libexe' => 'vc7libexe',
+ 'dll' => 'vc7dll',
+ 'lib' => 'vc7lib',
+ 'template' => 'vc7',
+ },
+ Creator::csharp => {'ext' => '.csproj',
+ 'dllexe' => 'vc7csharp',
+ 'libexe' => 'vc7csharp',
+ 'dll' => 'vc7csharp',
+ 'lib' => 'vc7csharp',
+ 'template' => 'vc7csharp',
+ },
+ Creator::java => {'ext' => '.vjsproj',
+ 'dllexe' => 'vc7java',
+ 'libexe' => 'vc7java',
+ 'dll' => 'vc7java',
+ 'lib' => 'vc7java',
+ 'template' => 'vc7java',
+ },
+ Creator::vb => {'ext' => '.vbproj',
+ 'dllexe' => 'vc7vb',
+ 'libexe' => 'vc7vb',
+ 'dll' => 'vc7vb',
+ 'lib' => 'vc7vb',
+ 'template' => 'vc7vb',
+ },
);
my %config = ('vcversion' => '7.00',
@@ -62,6 +62,11 @@ my %config = ('vcversion' => '7.00',
# Subroutine Section
# ************************************************************
+sub languageSupported {
+ return defined $info{$_[0]->get_language()};
+}
+
+
sub get_info_hash {
#my($self, $key) = @_;
return $info{$_[1]};
@@ -89,7 +94,7 @@ sub fill_value {
## Since Visual Studio 2003 doesn't support Web Applications, this
## will never happen. However, this code is shared by the vc8
## project type, so it can happen then.
- return 'website' if ($self->get_assignment('webapp'));
+ return Creator::website if ($self->get_assignment('webapp'));
## Also for the vc8 project type, the language is stored in the
## project file as a comment when external C# references need to be
diff --git a/modules/VC7WorkspaceCreator.pm b/modules/VC7WorkspaceCreator.pm
index be389f73..eb680c2b 100644
--- a/modules/VC7WorkspaceCreator.pm
+++ b/modules/VC7WorkspaceCreator.pm
@@ -23,11 +23,11 @@ use vars qw(@ISA);
# Data Section
# ************************************************************
-my %guids = ('cplusplus' => '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942',
- 'csharp' => 'FAE04EC0-301F-11D3-BF4B-00C04F79EFBC',
- 'java' => 'E6FDF86B-F3D1-11D4-8576-0002A516ECE8',
- 'vb' => 'F184B08F-C81C-45F6-A57F-5ABD9991F28F',
- 'website' => 'E24C65DC-7377-472B-9ABA-BC803B73C61A',
+my %guids = (Creator::cplusplus => '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942',
+ Creator::csharp => 'FAE04EC0-301F-11D3-BF4B-00C04F79EFBC',
+ Creator::java => 'E6FDF86B-F3D1-11D4-8576-0002A516ECE8',
+ Creator::vb => 'F184B08F-C81C-45F6-A57F-5ABD9991F28F',
+ Creator::website => 'E24C65DC-7377-472B-9ABA-BC803B73C61A',
);
# ************************************************************
diff --git a/modules/VC8ProjectCreator.pm b/modules/VC8ProjectCreator.pm
index 7c76be54..67de189c 100644
--- a/modules/VC8ProjectCreator.pm
+++ b/modules/VC8ProjectCreator.pm
@@ -21,34 +21,34 @@ use vars qw(@ISA);
# Data Section
# ************************************************************
-my %info = ('cplusplus' => {'ext' => '.vcproj',
- 'dllexe' => 'vc8exe',
- 'libexe' => 'vc8libexe',
- 'dll' => 'vc8dll',
- 'lib' => 'vc8lib',
- 'template' => 'vc8',
- },
- 'csharp' => {'ext' => '.csproj',
- 'dllexe' => 'vc8csharp',
- 'libexe' => 'vc8csharp',
- 'dll' => 'vc8csharp',
- 'lib' => 'vc8csharp',
- 'template' => 'vc8csharp',
- },
- 'java' => {'ext' => '.vjsproj',
- 'dllexe' => 'vc8java',
- 'libexe' => 'vc8java',
- 'dll' => 'vc8java',
- 'lib' => 'vc8java',
- 'template' => 'vc8java',
- },
- 'vb' => {'ext' => '.vbproj',
- 'dllexe' => 'vc8vb',
- 'libexe' => 'vc8vb',
- 'dll' => 'vc8vb',
- 'lib' => 'vc8vb',
- 'template' => 'vc8vb',
- },
+my %info = (Creator::cplusplus => {'ext' => '.vcproj',
+ 'dllexe' => 'vc8exe',
+ 'libexe' => 'vc8libexe',
+ 'dll' => 'vc8dll',
+ 'lib' => 'vc8lib',
+ 'template' => 'vc8',
+ },
+ Creator::csharp => {'ext' => '.csproj',
+ 'dllexe' => 'vc8csharp',
+ 'libexe' => 'vc8csharp',
+ 'dll' => 'vc8csharp',
+ 'lib' => 'vc8csharp',
+ 'template' => 'vc8csharp',
+ },
+ Creator::java => {'ext' => '.vjsproj',
+ 'dllexe' => 'vc8java',
+ 'libexe' => 'vc8java',
+ 'dll' => 'vc8java',
+ 'lib' => 'vc8java',
+ 'template' => 'vc8java',
+ },
+ Creator::vb => {'ext' => '.vbproj',
+ 'dllexe' => 'vc8vb',
+ 'libexe' => 'vc8vb',
+ 'dll' => 'vc8vb',
+ 'lib' => 'vc8vb',
+ 'template' => 'vc8vb',
+ },
);
my %config = ('vcversion' => '8.00');
@@ -57,6 +57,11 @@ my %config = ('vcversion' => '8.00');
# Subroutine Section
# ************************************************************
+sub languageSupported {
+ return defined $info{$_[0]->get_language()};
+}
+
+
sub webapp_supported {
#my $self = shift;
return 1;
diff --git a/modules/VC8WorkspaceCreator.pm b/modules/VC8WorkspaceCreator.pm
index 3ad9cdee..ac677852 100644
--- a/modules/VC8WorkspaceCreator.pm
+++ b/modules/VC8WorkspaceCreator.pm
@@ -22,10 +22,10 @@ use vars qw(@ISA);
# Data Section
# ************************************************************
-my %lang_map = ('cplusplus' => 'Visual C#',
- 'csharp' => 'Visual C#',
- 'vb' => 'Visual Basic',
- 'java' => 'Visual J#');
+my %lang_map = (Creator::cplusplus => 'Visual C#',
+ Creator::csharp => 'Visual C#',
+ Creator::vb => 'Visual Basic',
+ Creator::java => 'Visual J#');
# ************************************************************
# Subroutine Section
@@ -88,7 +88,7 @@ sub post_workspace {
"$cwd/$project",
$dep);
if (defined $relative) {
- if (defined $lang && $lang eq 'cplusplus') {
+ if (defined $lang && $lang eq Creator::cplusplus) {
push(@read, $spc . '<ProjectReference' . $crlf .
$spc . "\tReferencedProjectIdentifier=" .
"\"\{$gmap{$dep}\}\"$crlf" .
@@ -133,7 +133,7 @@ sub adjust_names {
## For websites, the project needs to be the directory of the actual
## project file with a trailing slash. The name needs a trailing slash
## too.
- if ($lang eq 'website') {
+ if ($lang eq Creator::website) {
$proj = $self->mpc_dirname($proj);
$proj .= '\\';
$name .= '\\';
@@ -178,9 +178,8 @@ sub print_inner_project {
my($self, $fh, $gen, $currguid, $deps, $name, $name_to_guid_map, $proj_language, $cfgs) = @_;
## We need to perform a lot of work, but only for websites.
- if ($proj_language eq 'website') {
+ if ($proj_language eq Creator::website) {
my $crlf = $self->crlf();
- my $language = $self->get_language();
my $directory = ($name eq '.\\' ?
$self->get_workspace_name() . '\\' : $name);
@@ -220,7 +219,8 @@ sub print_inner_project {
}
}
print $fh "\t\tVWDPort = \"1573\"", $crlf,
- "\t\tDefaultWebSiteLanguage = \"", $lang_map{$language}, "\"", $crlf,
+ "\t\tDefaultWebSiteLanguage = \"",
+ $lang_map{$self->get_language()}, "\"", $crlf,
"\tEndProjectSection", $crlf;
}
else {
diff --git a/modules/WB26ProjectCreator.pm b/modules/WB26ProjectCreator.pm
index 45b58b23..8380a35b 100644
--- a/modules/WB26ProjectCreator.pm
+++ b/modules/WB26ProjectCreator.pm
@@ -67,7 +67,7 @@ sub requires_forward_slashes {
sub file_visible {
## We only want the project file visible to the workspace creator.
- ## There can only be one and this is the it.
+ ## There can only be one and this is it.
#my($self, $template) = @_;
return $_[1] eq 'wb26';
}