Merge pull request #228 from DOCGroup/jwillemsen-patch-1
[MPC.git] / modules / IARWorkspaceCreator.pm
blob53e98ea60a058de715347ecd11f319bb65a9e779
1 package IARWorkspaceCreator;
3 # ************************************************************
4 # Description : The IAR Embedded Workbench IDE Workspace Creator
5 # Author : Chad Elliott
6 # Create Date : 4/18/2019
7 # ************************************************************
9 # ************************************************************
10 # Pragmas
11 # ************************************************************
13 use strict;
15 use IARProjectCreator;
16 use WinWorkspaceBase;
17 use WorkspaceCreator;
19 use vars qw(@ISA);
20 @ISA = qw(WinWorkspaceBase WorkspaceCreator);
22 # ************************************************************
23 # Subroutine Section
24 # ************************************************************
27 sub compare_output {
28 #my $self = shift;
29 return 1;
33 sub workspace_file_extension {
34 #my $self = shift;
35 return '.eww';
39 sub pre_workspace {
40 my($self, $fh) = @_;
41 my $crlf = $self->crlf();
43 print $fh "<?xml version=\"1.0\" encoding=\"UTF-8\"?>$crlf",
44 "<workspace>$crlf";
48 sub write_comps {
49 my($self, $fh) = @_;
50 my $crlf = $self->crlf();
52 print $fh ' <!-- ', $self->get_workspace_name(), ' - ',
53 $self->create_command_line_string($0, @ARGV),
54 ' -->', $crlf;
55 foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
56 ## Only emit the prefix if the path is relative. IAR requires it unless
57 ## the path is fully qualified.
58 print $fh " <project>$crlf",
59 " <path>";
60 print $fh '$WS_DIR$\\' if ($self->path_is_relative($project));
61 print $fh $self->slash_to_backslash($project), "</path>$crlf",
62 " </project>$crlf";
67 sub post_workspace {
68 my($self, $fh) = @_;
69 print $fh '</workspace>' . $self->crlf();
73 sub aggressive_relative_replacement {
74 #my $self = shift;
75 return 1;