Merge pull request #228 from DOCGroup/jwillemsen-patch-1
[MPC.git] / modules / VC7ProjectCreator.pm
blobf373bf6c7c344d530b7c8317d3cbea89c2880db3
1 package VC7ProjectCreator;
3 # ************************************************************
4 # Description : A VC7 Project Creator
5 # Author : Chad Elliott
6 # Create Date : 4/23/2002
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use GUID;
16 use ProjectCreator;
17 use VCProjectBase;
18 use XMLProjectBase;
20 use vars qw(@ISA);
21 @ISA = qw(XMLProjectBase VCProjectBase ProjectCreator);
23 # ************************************************************
24 # Data Section
25 # ************************************************************
27 ## NOTE: We call the constant as a function to support Perl 5.6.
28 my %info = (Creator::cplusplus() => {'ext' => '.vcproj',
29 'dllexe' => 'vc7exe',
30 'libexe' => 'vc7libexe',
31 'dll' => 'vc7dll',
32 'lib' => 'vc7lib',
33 'template' => 'vc7',
35 Creator::csharp() => {'ext' => '.csproj',
36 'dllexe' => 'vc7csharp',
37 'libexe' => 'vc7csharp',
38 'dll' => 'vc7csharp',
39 'lib' => 'vc7csharp',
40 'template' => 'vc7csharp',
42 Creator::java() => {'ext' => '.vjsproj',
43 'dllexe' => 'vc7java',
44 'libexe' => 'vc7java',
45 'dll' => 'vc7java',
46 'lib' => 'vc7java',
47 'template' => 'vc7java',
49 Creator::vb() => {'ext' => '.vbproj',
50 'dllexe' => 'vc7vb',
51 'libexe' => 'vc7vb',
52 'dll' => 'vc7vb',
53 'lib' => 'vc7vb',
54 'template' => 'vc7vb',
58 my %config = ('vcversion' => '7.00',
59 'forloopscope' => 'TRUE',
62 # ************************************************************
63 # Subroutine Section
64 # ************************************************************
66 sub languageSupported {
67 return defined $info{$_[0]->get_language()};
71 sub get_info_hash {
72 #my($self, $key) = @_;
73 return $info{$_[1]};
77 sub get_configurable {
78 #my($self, $name) = @_;
79 return $config{$_[1]};
83 sub fill_value {
84 my($self, $name) = @_;
86 if ($name eq 'guid') {
87 ## Return a repeatable GUID for use within the template. The values
88 ## provided will be hashed and returned in a format expected by
89 ## Visual Studio.
90 return GUID::generate($self->project_file_name(),
91 $self->{'current_input'},
92 File::Spec->abs2rel($self->getcwd(),
93 $self->getstartdir()));
95 elsif ($name eq 'language') {
96 ## If this project is a Web Application, the language is website.
97 ## Since Visual Studio 2003 doesn't support Web Applications, this
98 ## will never happen. However, this code is shared by the vc8
99 ## project type, so it can happen then.
100 return Creator::website if ($self->get_assignment('webapp'));
102 ## Also for the vc8 project type, the language is stored in the
103 ## project file as a comment when external C# references need to be
104 ## added to the resulting project. Since a C++ project can mix with
105 ## C#, the particular project language can not be determined by the
106 ## workspace language.
107 return $self->get_language();
110 ## Consult another method for this template name. This method is
111 ## overridden by the other project creators that inherit from this
112 ## one.
113 return $self->get_configurable($name);
117 sub project_file_extension {
118 return $_[0]->get_info_hash($_[0]->get_language())->{'ext'};
122 sub get_dll_exe_template_input_file {
123 return $_[0]->get_info_hash($_[0]->get_language())->{'dllexe'};
127 sub get_lib_exe_template_input_file {
128 return $_[0]->get_info_hash($_[0]->get_language())->{'libexe'};
132 sub get_dll_template_input_file {
133 return $_[0]->get_info_hash($_[0]->get_language())->{'dll'};
137 sub get_lib_template_input_file {
138 return $_[0]->get_info_hash($_[0]->get_language())->{'lib'};
142 sub get_template {
143 return $_[0]->get_info_hash($_[0]->get_language())->{'template'};
147 sub get_cmdsep_symbol {
148 #my $self = shift;
149 return '&';