Wed Jun 9 07:35:19 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
[MPC.git] / modules / VC7ProjectCreator.pm
blob8182c23f130f27254c73d8b640d04d547b6c347d
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 my %info = (Creator::cplusplus => {'ext' => '.vcproj',
28 'dllexe' => 'vc7exe',
29 'libexe' => 'vc7libexe',
30 'dll' => 'vc7dll',
31 'lib' => 'vc7lib',
32 'template' => 'vc7',
34 Creator::csharp => {'ext' => '.csproj',
35 'dllexe' => 'vc7csharp',
36 'libexe' => 'vc7csharp',
37 'dll' => 'vc7csharp',
38 'lib' => 'vc7csharp',
39 'template' => 'vc7csharp',
41 Creator::java => {'ext' => '.vjsproj',
42 'dllexe' => 'vc7java',
43 'libexe' => 'vc7java',
44 'dll' => 'vc7java',
45 'lib' => 'vc7java',
46 'template' => 'vc7java',
48 Creator::vb => {'ext' => '.vbproj',
49 'dllexe' => 'vc7vb',
50 'libexe' => 'vc7vb',
51 'dll' => 'vc7vb',
52 'lib' => 'vc7vb',
53 'template' => 'vc7vb',
57 my %config = ('vcversion' => '7.00',
58 'forloopscope' => 'TRUE',
61 # ************************************************************
62 # Subroutine Section
63 # ************************************************************
65 sub languageSupported {
66 return defined $info{$_[0]->get_language()};
70 sub get_info_hash {
71 #my($self, $key) = @_;
72 return $info{$_[1]};
76 sub get_configurable {
77 #my($self, $name) = @_;
78 return $config{$_[1]};
82 sub fill_value {
83 my($self, $name) = @_;
85 if ($name eq 'guid') {
86 ## Return a repeatable GUID for use within the template. The values
87 ## provided will be hashed and returned in a format expected by
88 ## Visual Studio.
89 return GUID::generate($self->project_file_name(),
90 $self->{'current_input'}, $self->getcwd());
92 elsif ($name eq 'language') {
93 ## If this project is a Web Application, the language is website.
94 ## Since Visual Studio 2003 doesn't support Web Applications, this
95 ## will never happen. However, this code is shared by the vc8
96 ## project type, so it can happen then.
97 return Creator::website if ($self->get_assignment('webapp'));
99 ## Also for the vc8 project type, the language is stored in the
100 ## project file as a comment when external C# references need to be
101 ## added to the resulting project. Since a C++ project can mix with
102 ## C#, the particular project language can not be determined by the
103 ## workspace language.
104 return $self->get_language();
107 ## Consult another method for this template name. This method is
108 ## overrridden by the other project creators that inherit from this
109 ## one.
110 return $self->get_configurable($name);
114 sub project_file_extension {
115 return $_[0]->get_info_hash($_[0]->get_language())->{'ext'};
119 sub get_dll_exe_template_input_file {
120 return $_[0]->get_info_hash($_[0]->get_language())->{'dllexe'};
124 sub get_lib_exe_template_input_file {
125 return $_[0]->get_info_hash($_[0]->get_language())->{'libexe'};
129 sub get_dll_template_input_file {
130 return $_[0]->get_info_hash($_[0]->get_language())->{'dll'};
134 sub get_lib_template_input_file {
135 return $_[0]->get_info_hash($_[0]->get_language())->{'lib'};
139 sub get_template {
140 return $_[0]->get_info_hash($_[0]->get_language())->{'template'};
144 sub get_cmdsep_symbol {
145 #my $self = shift;
146 return '&amp;';