Subversion Repositories DevTools

Rev

Rev 263 | Rev 275 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 263 Rev 273
Line 43... Line 43...
43
use FileUtils;
43
use FileUtils;
44
use JatsBuildFiles;
44
use JatsBuildFiles;
45
use JatsVersionUtils;
45
use JatsVersionUtils;
46
 
46
 
47
 
47
 
48
use File::Find;
-
 
49
use Pod::Usage;                             # required for help support
48
use Pod::Usage;                             # required for help support
50
use Getopt::Long qw(:config require_order); # Stop on non-option
49
use Getopt::Long qw(:config require_order); # Stop on non-option
51
my $VERSION = "1.0.0";                      # Update this
50
my $VERSION = "1.0.0";                      # Update this
52
 
51
 
53
#
52
#
Line 116... Line 115...
116
my $cmd = shift @ARGV || "";
115
my $cmd = shift @ARGV || "";
117
help(1)                                 if ( $cmd =~ m/^help$/ || $cmd eq "" );
116
help(1)                                 if ( $cmd =~ m/^help$/ || $cmd eq "" );
118
create_sandbox()                        if ( $cmd =~ m/^create$/ );
117
create_sandbox()                        if ( $cmd =~ m/^create$/ );
119
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
118
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
120
cmd(@ARGV)                              if ( $cmd =~ m/^cmd$/ );
119
cmd(@ARGV)                              if ( $cmd =~ m/^cmd$/ );
-
 
120
clean($cmd, @ARGV)                      if ( $cmd =~ m/(^clobber$)|(^clean$)/  );
121
 
121
 
122
Error ("Unknown sandbox command: $cmd");
122
Error ("Unknown sandbox command: $cmd");
123
exit 1;
123
exit 1;
124
 
124
 
125
 
125
 
Line 416... Line 416...
416
 
416
 
417
    exit 0;
417
    exit 0;
418
}
418
}
419
 
419
 
420
#-------------------------------------------------------------------------------
420
#-------------------------------------------------------------------------------
-
 
421
# Function        : clean
-
 
422
#
-
 
423
# Description     : Execute a command in all the sandboxes
-
 
424
#                       Locate the base of the sandbox
-
 
425
#                       Locate all packages in the sandbox
-
 
426
#                       Locate all build files in each sandbox
-
 
427
#                       Determine build order
-
 
428
#                       Issue commands for each sandbox in order
-
 
429
#
-
 
430
# Inputs          : Arguments passed to jats build
-
 
431
#
-
 
432
# Returns         : Will exit
-
 
433
#
-
 
434
sub clean
-
 
435
{
-
 
436
    my ($mode, @cmds ) = @_;
-
 
437
    #
-
 
438
    #   Determine Sandbox information
-
 
439
    #   Populate global variables
-
 
440
    #
-
 
441
    calc_sandbox_info();
-
 
442
 
-
 
443
    my @cmd = $mode eq 'clobber' ? ('clobber') : ('make', 'clean' );
-
 
444
 
-
 
445
    #
-
 
446
    #   Clobber and clean need to be done in the reverse order
-
 
447
    #
-
 
448
    foreach my $fe ( reverse @build_order )
-
 
449
    {
-
 
450
        my $dir = $fe->{dir};
-
 
451
        Message( "Level:" . $fe->{level} . " Name: " . $fe->{mname} ,
-
 
452
                  DisplayPath ("        Path: $fe->{dir}" ));
-
 
453
 
-
 
454
        my $result = JatsCmd( "-cd=$dir", @cmd, @cmds);
-
 
455
        Error ("Cmd failure") if ( $result );
-
 
456
    }
-
 
457
 
-
 
458
    exit 0;
-
 
459
}
-
 
460
 
-
 
461
 
-
 
462
#-------------------------------------------------------------------------------
421
#   Documentation
463
#   Documentation
422
#
464
#
423
 
465
 
424
=pod
466
=pod
425
 
467
 
Line 439... Line 481...
439
 Commands:
481
 Commands:
440
    help                - Same as -help
482
    help                - Same as -help
441
    create              - Create a sandbox in the current directory
483
    create              - Create a sandbox in the current directory
442
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
484
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
443
    cmd                 - Do commands in all sandbox components
485
    cmd                 - Do commands in all sandbox components
-
 
486
    clean               - Do 'make clean' in all sandbox components
-
 
487
    clobber             - Do 'build clobber' is all sandbox components
444
 
488
 
445
=head1 OPTIONS
489
=head1 OPTIONS
446
 
490
 
447
=over 8
491
=over 8
448
 
492