diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | modules/Driver.pm | 13 | ||||
-rw-r--r-- | modules/ProjectCreator.pm | 11 | ||||
-rwxr-xr-x | mpc.pl | 2 | ||||
-rwxr-xr-x | mwc.pl | 2 |
5 files changed, 32 insertions, 9 deletions
@@ -1,3 +1,16 @@ +Mon Aug 3 16:43:18 UTC 2009 Chad Elliott <elliott_c@ociweb.com> + + * modules/Driver.pm: + * mpc.pl: + * mwc.pl: + + Added a pair of constants that will be used in determining which + type of creators to use (either workspace or project). + + * modules/ProjectCreator.pm: + + Removed the use of a hard-coded string and simplified some code. + Fri Jul 24 09:29:31 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> * config/nddslib.mpb: diff --git a/modules/Driver.pm b/modules/Driver.pm index 3a2a419b..a80824be 100644 --- a/modules/Driver.pm +++ b/modules/Driver.pm @@ -34,6 +34,7 @@ my %valid_cfg = ('command_line' => 1, 'main_functions' => 1, 'verbose_ordering' => 1, ); +my @intype = ('mwc.pl', 'mpc.pl'); # ************************************************************ # Subroutine Section @@ -49,7 +50,7 @@ sub new { $self->{'path'} = $path; $self->{'basepath'} = ::getBasePath(); $self->{'name'} = $name; - $self->{'type'} = (lc($self->{'name'}) eq 'mwc.pl' ? + $self->{'type'} = (lc($self->{'name'}) eq $intype[0] ? 'WorkspaceCreator' : 'ProjectCreator'); $self->{'types'} = {}; $self->{'creators'} = \@creators; @@ -60,6 +61,16 @@ sub new { } +sub workspaces { + return $intype[0]; +} + + +sub projects { + return $intype[1]; +} + + sub locate_default_type { my $self = shift; my $name = lc(shift) . lc($self->{'type'}) . '.pm'; diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm index e6f2a263..d8e07e9a 100644 --- a/modules/ProjectCreator.pm +++ b/modules/ProjectCreator.pm @@ -258,7 +258,7 @@ my %language = ('cplusplus' => [ \%cppvc, \%cppec, \%cppma, 'main', 1, $csresource ], 'java' => [ \%jvc, {}, {}, 'main', 0, - 'resource_files' ], + $cppresource ], 'vb' => [ \%vbvc, {}, \%vbma, 'Main', 0, $vbresource ], @@ -5127,12 +5127,11 @@ sub add_main_function { } sub get_resource_tag { - my($self) = @_; + my $self = shift; my $lang = $self->get_language(); - if (!defined $lang) { - return 'resource_files'; # backwards compatibility if no lang. - } - return $language{$lang}->[5]; + + ## For backwards compatibility if on the off chance there is no language. + return defined $lang ? $language{$lang}->[5] : $cppresource; } # ************************************************************ @@ -42,5 +42,5 @@ sub getBasePath { # Main Section # ************************************************************ -my $driver = new Driver($basePath, basename($0)); +my $driver = new Driver($basePath, Driver::projects()); exit($driver->run(@ARGV)); @@ -42,5 +42,5 @@ sub getBasePath { # Main Section # ************************************************************ -my $driver = new Driver($basePath, basename($0)); +my $driver = new Driver($basePath, Driver::workspaces()); exit($driver->run(@ARGV)); |