ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/Build.pm
Revision: 1.5
Committed: Fri Sep 29 10:32:18 2000 UTC (24 years, 7 months ago) by williamc
Content type: text/plain
Branch: MAIN
CVS Tags: V0_19_5, SFATEST, V0_19_4, V0_19_4_pre3, V0_19_4_pre2, V0_19_4_pre1, V0_19_3, V0_19_2, V0_19_1, V0_19_0, V0_18_5, V0_18_4, V_18_3_TEST, VO_18_3, V0_18_2, V0_18_1
Branch point for: V0_19_4_B, V0_16branch
Changes since 1.4: +1 -1 lines
Log Message:
Bugfixes

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 BuildSystem::BuildSetup;
17 use Utilities::Verbose;
18 require 5.004;
19 @ISA=qw(Utilities::Verbose);
20
21 sub new {
22 my $class=shift;
23 my $self={};
24 bless $self, $class;
25 $self->{area}=shift;
26 $self->{area}->copyenv(\%ENV);
27 $ENV{LOCALTOP}=$self->{area}->location();
28
29 # -- set RELEASTOP
30 my $rarea=$self->{area}->linkarea();
31 if ( ! defined $rarea ) {
32 $ENV{RELEASETOP}=$ENV{LOCALTOP};
33 }
34 else {
35 $ENV{RELEASETOP}=$rarea->location();
36 }
37
38 $self->verbose("LOCALTOP=".$ENV{LOCALTOP});
39 $self->verbose("RELEASETOP=".$ENV{RELEASETOP});
40 return $self;
41 }
42
43 sub build {
44 my $self=shift;
45 my $dir=shift;
46
47 # -- set up a report
48 my $report=BuildSystem::BuildReport->new();
49
50 # -- interface with old system
51 my $fulldir=$self->{area}->location()."/".$dir;
52 if ( ! -d $fulldir ) {
53 $report->error("$fulldir does not exist");
54 $report->status(1); # set to fail
55 }
56 else {
57 chdir $fulldir;
58 # -- initialise BuildSystem if we dont already have it
59 if ( ! defined $self->{bs} ) {
60 $self->{bs}=BuildSystem::BuildSetup->new($self->{area});
61 $self->{bs}->verbosity(1);
62 }
63 $self->verbose("Calling build module with $dir, @_");
64 my $rv=$self->{bs}->BuildDir($dir,@_);
65 $report->status($rv);
66 }
67 return $report;
68 }