ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/Build.pm
Revision: 1.3
Committed: Fri Sep 15 11:18:21 2000 UTC (24 years, 7 months ago) by williamc
Content type: text/plain
Branch: MAIN
Changes since 1.2: +7 -4 lines
Log Message:
updates to setup environment

File Contents

# Content
1 #
2 # Build.pm
3 #
4 # Originally Written by Christopher Williams
5 #
6 # Description
7 #
8 # Interface
9 # ---------
10 # new(ConfigArea) : A new Build object
11 # build(dir,[@targets]) : Build relevant target for a given directory
12 # dir relative to top. Returns a BuildReport
13
14 package BuildSystem::Build;
15 use BuildSystem::BuildReport;
16 use Utilities::Verbose;
17 require 5.004;
18 @ISA=qw(Utilities::Verbose);
19
20 sub new {
21 my $class=shift;
22 my $self={};
23 bless $self, $class;
24 $self->{area}=shift;
25 $self->{area}->copyenv(\%ENV);
26 $ENV{LOCALTOP}=$self->{area}->location();
27 $self->verbose("LOCALTOP=".$ENV{LOCALTOP});
28 return $self;
29 }
30
31 sub build {
32 my $self=shift;
33 my $dir=shift;
34
35 # -- set up a report
36 my $report=BuildSystem::BuildReport->new();
37
38 # -- interface with old system
39 my $fulldir=$self->{area}->location()."/".$dir;
40 if ( ! -d $fulldir ) {
41 $report->error("$fulldir does not exist");
42 $report->status(1); # set to fail
43 }
44 else {
45 chdir $fulldir;
46 # -- initialise BuildSystem if we dont already have it
47 if ( ! defined $self->{bs} ) {
48 $self->{bs}=BuildSystem::BuildSetup->new($self->{area});
49 $self->{bs}->verbosity(1);
50 }
51 $self->verbose("Calling build module with $dir, @_");
52 my $rv=$self->{bs}->BuildDir($dir,@_);
53 $report->status($rv);
54 }
55 return $report;
56 }