Removed svn Id tag
[MPC.git] / modules / BCB2007WorkspaceCreator.pm
blob491953d30faf4ece61fb66f673bb4ed97a55bd7a
1 package BCB2007WorkspaceCreator;
3 # ************************************************************
4 # Description : A BCB2007 Workspace Creator
5 # Author : Johnny Willemsen
6 # Create Date : 14/12/2005
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use BCB2007ProjectCreator;
16 use BorlandPropertyBase;
17 use WinWorkspaceBase;
18 use WorkspaceCreator;
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 '.groupproj';
45 sub pre_workspace {
46 my($self, $fh) = @_;
47 my $crlf = $self->crlf();
49 ## This identifies it as a Borland C++Builder 2007 file
50 print $fh '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">', $crlf;
52 ## Optionally print the workspace comment
53 # $self->print_workspace_comment($fh,
54 # '<!-- -->', $crlf,
55 # '<!-- MPC Command -->', $crlf,
56 # '<!-- ', $self->create_command_line_string($0, @ARGV), ' -->',
57 # $crlf);
61 sub write_comps {
62 my($self, $fh) = @_;
63 my $crlf = $self->crlf();
64 my $project_info = $self->get_project_info();
65 my @projects = $self->sort_dependencies($self->get_projects(), 0);
67 ## Print GUID and personality information
68 print $fh ' <PropertyGroup>', $crlf,
69 ' <ProjectGuid>{1946f85e-487f-46b6-8e41-159cd446db35}</ProjectGuid>', $crlf,
70 ' </PropertyGroup>', $crlf,
71 ' <ItemGroup />', $crlf,
72 ' <ItemGroup />', $crlf,
73 ' <ProjectExtensions>', $crlf,
74 ' <Borland.Personality>Default.Personality</Borland.Personality>', $crlf,
75 ' <Borland.ProjectType />', $crlf,
76 ' <BorlandProject>', $crlf,
77 ' <BorlandProject xmlns=""> <Default.Personality> </Default.Personality> </BorlandProject></BorlandProject>', $crlf,
78 ' </ProjectExtensions>', $crlf;
80 ## Print the project targets
81 foreach my $project (@projects) {
82 my $name = $$project_info{$project}->[ProjectCreator::PROJECT_NAME];
83 print $fh ' <Target Name="', $name, '">', $crlf,
84 ' <MSBuild Projects="', $self->mpc_basename($project), '" Targets="" />', $crlf,
85 ' </Target>', $crlf,
86 ' <Target Name="', $name, ':Make">', $crlf,
87 ' <MSBuild Projects="', $self->mpc_basename($project), '" Targets="Make" />', $crlf,
88 ' </Target>', $crlf,
89 ' <Target Name="', $name, ':Clean">', $crlf,
90 ' <MSBuild Projects="', $self->mpc_basename($project), '" Targets="Clean" />', $crlf,
91 ' </Target>', $crlf;
94 ## Print the target build order
95 print $fh ' <Target Name="Build">', $crlf,
96 ' <CallTarget Targets="';
97 foreach my $project (@projects) {
98 print $fh $$project_info{$project}->[ProjectCreator::PROJECT_NAME], ';';
101 ## Print the target make order
102 print $fh '" />', $crlf,
103 ' </Target>', $crlf,
104 ' <Target Name="Make">', $crlf,
105 ' <CallTarget Targets="';
106 foreach my $project (@projects) {
107 print $fh $$project_info{$project}->[ProjectCreator::PROJECT_NAME],
108 ':Make;';
111 ## Print the target clean order
112 print $fh '" />', $crlf,
113 ' </Target>', $crlf,
114 ' <Target Name="Clean">', $crlf,
115 ' <CallTarget Targets="';
116 foreach my $project (@projects) {
117 print $fh $$project_info{$project}->[ProjectCreator::PROJECT_NAME],
118 ':Clean;';
120 print $fh '" />', $crlf,
121 ' </Target>', $crlf,
122 '</Project>', $crlf;