Merge pull request #178 from DOCGroup/elliottc/more_databases
[MPC.git] / modules / VC6WorkspaceCreator.pm
blobcd54f83bd9f40b170e38d474887f08e6e2ab0761
1 package VC6WorkspaceCreator;
3 # ************************************************************
4 # Description : A VC6 Workspace Creator
5 # Author : Chad Elliott
6 # Create Date : 5/13/2002
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use VC6ProjectCreator;
16 use WinWorkspaceBase;
17 use WorkspaceCreator;
18 use VCPropertyBase;
20 use vars qw(@ISA);
21 @ISA = qw(VCPropertyBase WinWorkspaceBase WorkspaceCreator);
23 # ************************************************************
24 # Subroutine Section
25 # ************************************************************
28 sub compare_output {
29 #my $self = shift;
30 return 1;
34 sub workspace_file_extension {
35 #my $self = shift;
36 return '.dsw';
40 sub pre_workspace {
41 my($self, $fh) = @_;
42 my $crlf = $self->crlf();
44 ## This identifies it as a Visual C++ file
45 print $fh 'Microsoft Developer Studio Workspace File, Format Version 6.00', $crlf;
47 ## Optionally print the workspace comment
48 $self->print_workspace_comment($fh,
49 '#', $crlf,
50 '# This file was generated by MPC. Any changes made directly to', $crlf,
51 '# this file will be lost the next time it is generated.', $crlf,
52 '#', $crlf,
53 '# MPC Command:', $crlf,
54 '# ', $self->create_command_line_string($0, @ARGV), $crlf, $crlf);
58 sub write_comps {
59 my($self, $fh, $gen) = @_;
60 my $projects = $self->get_projects();
61 my $pjs = $self->get_project_info();
62 my $crlf = $self->crlf();
64 ## Sort the project so that they resulting file can be exactly
65 ## reproduced given the same list of projects.
66 foreach my $project (sort { $gen->file_sorter($a, $b) } @$projects) {
68 ## Add the project name and project file information
69 print $fh "###############################################################################$crlf$crlf",
70 'Project: "', $$pjs{$project}->[ProjectCreator::PROJECT_NAME],
71 '"=', $self->slash_to_backslash($project),
72 " - Package Owner=<4>$crlf$crlf",
73 "Package=<5>$crlf", '{{{', $crlf, "}}}$crlf$crlf",
74 "Package=<4>$crlf", '{{{', $crlf;
76 my $deps = $self->get_validated_ordering($project);
77 if (defined $$deps[0]) {
78 ## Add in the project dependencies
79 foreach my $dep (@$deps) {
80 print $fh " Begin Project Dependency$crlf",
81 " Project_Dep_Name $dep$crlf",
82 " End Project Dependency$crlf";
86 ## End the project section
87 print $fh "}}}$crlf$crlf";
92 sub post_workspace {
93 my($self, $fh) = @_;
94 my $crlf = $self->crlf();
96 ## This text is always the same
97 print $fh "###############################################################################$crlf$crlf",
98 "Global:$crlf$crlf",
99 "Package=<5>$crlf", '{{{', "$crlf}}}$crlf$crlf",
100 "Package=<3>$crlf", '{{{', "$crlf}}}$crlf$crlf",
101 "###############################################################################$crlf$crlf";