Added option to Macintosh build scripts, to delete all the dist aliases or just all the dist library aliases.

This commit is contained in:
mcmullen%netscape.com 1999-05-10 23:01:39 +00:00
Родитель ab85603c92
Коммит 31c7a1f1be
7 изменённых файлов: 96 добавлений и 22 удалений

Просмотреть файл

@ -31,6 +31,10 @@ $ALIAS_SYM_FILES = $DEBUG;
$CLOBBER_LIBS = 1;
$MOZ_FULLCIRCLE = 0;
# The following two options will delete all files, but leave the directory structure intact.
$CLOBBER_DIST_ALL = 0; # turn on to clobber all files inside dist (headers, xsym and libs)
$CLOBBER_DIST_LIBS = 0; # turn on to clobber the aliases to libraries and sym files in dist
$pull{all} = 0;
$pull{lizard} = 0;
$pull{xpcom} = 0;

Просмотреть файл

@ -30,6 +30,11 @@ $DEBUG = 1;
$ALIAS_SYM_FILES = $DEBUG;
$CLOBBER_LIBS = 1; # turn on to clobber existing libs and .xSYM files before
# building each project
# The following two options will delete all files, but leave the directory structure intact.
$CLOBBER_DIST_ALL = 0; # turn on to clobber all aliases/files inside dist (headers/xsym/libs)
$CLOBBER_DIST_LIBS = 0; # turn on to clobber only aliases/files for libraries/sym files in dist
$MOZ_FULLCIRCLE = 0;
$pull{all} = 0;
@ -71,7 +76,7 @@ if ($build{most})
{
### Just uncomment/comment to get the ones you want (if "most" is selected).
$build{dist} = 1;
# $build{stubs} = 1;
$build{stubs} = 1;
$build{common} = 1; # Requires intl
# $build{intl} = 1;
$build{nglayout} = 1;
@ -94,18 +99,25 @@ if ($MOZ_FULLCIRCLE)
$buildnum = Moz::SetBuildNumber();
}
#Use time-stamped names so that you don't clobber your previous log file!
my $now = localtime();
while ($now =~ s@:@.@) {} # replace all colons by periods
my $logdir = ":Build Logs:";
if (!stat($logdir))
$USE_TIMESTAMPED_LOGS = 1;
if ($USE_TIMESTAMPED_LOGS)
{
print "Creating directory $logdir\n";
mkdir $logdir, 0777 || die "Couldn't create directory $logdir";
#Use time-stamped names so that you don't clobber your previous log file!
my $now = localtime();
while ($now =~ s@:@.@) {} # replace all colons by periods
my $logdir = ":Build Logs:";
if (!stat($logdir))
{
print "Creating directory $logdir\n";
mkdir $logdir, 0777 || die "Couldn't create directory $logdir";
}
OpenErrorLog("$logdir$now");
}
else
{
OpenErrorLog("NGLayoutBuildLog"); # Release build
#OpenErrorLog("Mozilla.BuildLog"); # Tinderbox requires that name
}
OpenErrorLog("$logdir$now");
#OpenErrorLog("Mozilla.BuildLog"); # Tinderbox requires that name
Moz::StopForErrors();
#Moz::DontStopForErrors();

Просмотреть файл

@ -103,7 +103,7 @@ sub _getDistDirectory()
#//--------------------------------------------------------------------------------------------------
#// Checkout everything
#// Check out everything
#//--------------------------------------------------------------------------------------------------
sub Checkout()
@ -134,6 +134,41 @@ sub Checkout()
}
}
#//--------------------------------------------------------------------------------------------------
#// Remove all files from a tree, leaving directories intact (except "CVS").
#//--------------------------------------------------------------------------------------------------
sub EmptyTree($)
{
my ($root) = @_;
#print "EmptyTree($root)\n";
opendir(DIR, $root);
my $sub;
foreach $sub (readdir(DIR))
{
my $fullpathname = $root.$sub; # -f, -d only work on full paths
if (-d $fullpathname) #if it's a directory (returns true for the alias of a directory, false for a broken alias)
{
EmptyTree($fullpathname.":");
if ($sub eq "CVS")
{
#print "rmdir $fullpathname\n";
rmdir $fullpathname;
}
}
else
{
#print "\tunlink $fullpathname\n";
my $cnt = unlink $fullpathname; # this is perlspeak for deleting a file.
if ($cnt ne 1)
{
print "Failed to delete $fullpathname";
die;
}
}
}
closedir(DIR);
}
#//--------------------------------------------------------------------------------------------------
#// Build the 'dist' directory
@ -147,22 +182,29 @@ sub BuildDist()
# activate MacPerl
ActivateApplication('McPL');
my $distdirectory = ":mozilla:dist"; # the parent directory in dist, including all the headers
my $dist_dir = _getDistDirectory(); # the subdirectory with the libs and executable.
if ($main::CLOBBER_DIST_ALL)
{
print "Clobbering ALL files inside :mozilla:dist:\n";
EmptyTree($distdirectory);
}
else
{
if ($main::CLOBBER_DIST_LIBS)
{
print "Clobbering library aliases and executables inside ".$dist_dir."\n";
EmptyTree($dist_dir);
}
}
# we really do not need all these paths, but many client projects include them
mkpath([ ":mozilla:dist:", ":mozilla:dist:client:", ":mozilla:dist:client_debug:", ":mozilla:dist:client_stubs:" ]);
mkpath([ ":mozilla:dist:viewer:", ":mozilla:dist:viewer_debug:" ]);
my($distdirectory) = ":mozilla:dist";
if ($main::MOZ_FULLCIRCLE)
{
if ( $main::DEBUG )
{
mkpath([ "$distdirectory:viewer_debug:TalkBack"]);
}
else
{
mkpath([ "$distdirectory:viewer:TalkBack"]);
}
mkpath([ $dist_dir."TalkBack"]);
}
#MAC_COMMON

Просмотреть файл

@ -31,6 +31,10 @@ $ALIAS_SYM_FILES = $DEBUG;
$CLOBBER_LIBS = 0;
$MOZ_FULLCIRCLE = 0;
# The following two options will delete all files, but leave the directory structure intact.
$CLOBBER_DIST_ALL = 0; # turn on to clobber all files inside dist (headers, xsym and libs)
$CLOBBER_DIST_LIBS = 0; # turn on to clobber the aliases to libraries and sym files in dist
$pull{all} = 1;
$pull{lizard} = 0;
$pull{xpcom} = 0;

Просмотреть файл

@ -32,6 +32,10 @@ $CLOBBER_LIBS = 1; # turn on to clobber existing libs and .xSYM files before
# building each project
$MOZ_FULLCIRCLE = 0;
# The following two options will delete all files, but leave the directory structure intact.
$CLOBBER_DIST_ALL = 0; # turn on to clobber all files inside dist (headers, xsym and libs)
$CLOBBER_DIST_LIBS = 0; # turn on to clobber the aliases to libraries and sym files in dist
$pull{all} = 1;
$pull{lizard} = 0;
$pull{xpcom} = 0;

Просмотреть файл

@ -32,6 +32,10 @@ $ALIAS_SYM_FILES = 0;
$CLOBBER_LIBS = 1;
$MOZ_FULLCIRCLE = 0;
# The following two options will delete all files, but leave the directory structure intact.
$CLOBBER_DIST_ALL = 0; # turn on to clobber all files inside dist (headers, xsym and libs)
$CLOBBER_DIST_LIBS = 0; # turn on to clobber the aliases to libraries and sym files in dist
$pull{all} = 0;
$pull{lizard} = 0;
$pull{xpcom} = 0;

Просмотреть файл

@ -32,6 +32,10 @@ $ALIAS_SYM_FILES = 0;
$CLOBBER_LIBS = 1;
$MOZ_FULLCIRCLE = 0;
# The following two options will delete all files, but leave the directory structure intact.
$CLOBBER_DIST_ALL = 0; # turn on to clobber all files inside dist (headers, xsym and libs)
$CLOBBER_DIST_LIBS = 0; # turn on to clobber the aliases to libraries and sym files in dist
$pull{all} = 1;
$pull{lizard} = 0;
$pull{xpcom} = 0;