Merge pull request #228 from DOCGroup/jwillemsen-patch-1
[MPC.git] / modules / BDS4WorkspaceCreator.pm
blob068eee314a61b3ff6d04ca45d1ef5d3dce3e8e27
1 package BDS4WorkspaceCreator;
3 # ************************************************************
4 # Description : A BDS 4 Workspace Creator
5 # Author : Johnny Willemsen
6 # Create Date : 14/12/2005
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use BDS4ProjectCreator;
16 use WinWorkspaceBase;
17 use WorkspaceCreator;
18 use BorlandPropertyBase;
20 use vars qw(@ISA);
21 @ISA = qw(BorlandPropertyBase WinWorkspaceBase WorkspaceCreator);
23 # ************************************************************
24 # Subroutine Section
25 # ************************************************************
27 sub crlf {
28 #my $self = shift;
29 return "\n";
33 sub compare_output {
34 #my $self = shift;
35 return 1;
39 sub workspace_file_extension {
40 #my $self = shift;
41 return '.bdsgroup';
45 sub pre_workspace {
46 my($self, $fh) = @_;
47 my $crlf = $self->crlf();
49 ## This identifies it as a Borland Developer Studio 2006 file
50 print $fh '<?xml version="1.0" encoding="utf-8"?>', $crlf;
52 ## Optionally print the workspace comment
53 $self->print_workspace_comment($fh,
54 '<!-- MPC Command -->', $crlf,
55 '<!-- ', $self->create_command_line_string($0, @ARGV), ' -->',
56 $crlf);
60 sub write_comps {
61 my($self, $fh) = @_;
62 my $crlf = $self->crlf();
64 ## Print out the guid and the personality information
65 print $fh '<BorlandProject>', $crlf,
66 ' <PersonalityInfo>', $crlf,
67 ' <Option>', $crlf,
68 ' <Option Name="Personality">Default.Personality</Option>', $crlf,
69 ' <Option Name="ProjectType"></Option>', $crlf,
70 ' <Option Name="Version">1.0</Option>', $crlf,
71 ' <Option Name="GUID">{93D77FAD-C603-4FB1-95AB-34E0B6FBF615}</Option>', $crlf,
72 ' </Option>', $crlf,
73 ' </PersonalityInfo>', $crlf,
74 ' <Default.Personality>', $crlf,
75 ' <Projects>', $crlf;
77 ## Print out the projects in the correct build order
78 foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
79 print $fh ' <Projects Name="$project">$project</Projects>', $crlf;
82 print $fh ' </Projects>', $crlf,
83 ' <Dependencies/>', $crlf,
84 ' </Default.Personality>', $crlf,
85 '</BorlandProject>', $crlf;