Support for a text-based list of build flags, and configurable log file locations. NOT PART OF THE BUILD

This commit is contained in:
sfraser%netscape.com 2000-10-25 02:32:30 +00:00
Родитель fa5f216463
Коммит 839e69cefd
8 изменённых файлов: 102 добавлений и 25 удалений

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

@ -100,4 +100,4 @@ $MOZ_SRC = cwd();
my($do_checkout) = 0;
my($do_build) = 1;
RunBuild($do_checkout, $do_build, "Mozilla opt build prefs");
RunBuild($do_checkout, $do_build, "MozillaBuildFlags.txt", "Mozilla opt build prefs");

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

@ -103,4 +103,4 @@ $MOZ_SRC = cwd();
my($do_checkout) = 0;
my($do_build) = 1;
RunBuild($do_checkout, $do_build, "Mozilla debug build prefs");
RunBuild($do_checkout, $do_build, "MozillaBuildFlags.txt", "Mozilla debug build prefs");

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

@ -148,7 +148,7 @@ sub OpenErrorLog($)
{
$log_file = full_path_to($log_file);
open(ERROR_LOG, ">$log_file") || die "Can't open logfile, check the file path.\n";
open(ERROR_LOG, ">$log_file") || die "Error: Can't open $log_file\n";
MacPerl::SetFileInfo("CWIE", "TEXT", $log_file);
$log_file =~ m/.+:(.+)/;
@ -474,6 +474,18 @@ sub RedirectOutputToFile($)
{
my($log_file) = @_;
# ensure that folders in the path exist
my($logdir) = "";
my($logfile) = $log_file;
if ($log_file =~ /(.+?:)([^:]+)$/) # ? for non-greedy match
{
$logdir = $1;
$logfile = $2;
mkpath($logdir);
}
print "Output is now being redirected to the file '$log_file'\n";
open(STDOUT, "> $log_file") || die "Can't redirect stdout";

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

@ -11,6 +11,7 @@ use strict;
use Exporter;
use Cwd;
use File::Path;
use Mac::Events;
use Mac::StandardFile;
@ -302,16 +303,22 @@ sub ScanForManifestFiles($$$$)
#-----------------------------------------------
# SetupBuildLog
#-----------------------------------------------
sub SetupBuildLog($)
sub SetupBuildLog($$)
{
my($timestamped_log) = @_;
my($logfile_path, $timestamped_log) = @_;
my $logdir = ":Build Logs:";
if (! -d $logdir)
my($logdir) = "";
my($logfile) = $logfile_path;
if ($logfile_path =~ /(.+?:)([^:]+)$/) # ? for non-greedy match
{
mkdir $logdir, 0777 || die "Couldn't create directory $logdir";
$logdir = $1;
$logfile = $2;
print "got log file settings '$logdir' '$logfile'\n";
mkpath($logdir);
}
if ($timestamped_log)
{
#Use time-stamped names so that you don't clobber your previous log file!
@ -321,7 +328,7 @@ sub SetupBuildLog($)
}
else
{
OpenErrorLog("${logdir}Mozilla build log");
OpenErrorLog("${logdir}${logfile}");
}
}

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

@ -84,10 +84,11 @@ sub WriteDefaultPrefsFile($)
% buildfrom nglayout % where to start the build
%
% Lines which specify the location of the files used to store paths
% to the CodeWarrior IDE, and the MacCVS Pro session file. Examples:
% to the CodeWarrior IDE, and the MacCVS Pro session file. Note quoting
% of paths containing whitespace. Examples:
%
% filepath idepath ::codewarrior.txt
% filepath sessionpath :sessionpath.txt
% filepath sessionpath ":Some folder:MacCVS session path.txt"
%
% Lines which modify the build settings like %main::DEBUG.
% Any lines which do not match either of the above are assumed
@ -180,12 +181,16 @@ sub ReadPrefsFile($$$$$)
next;
}
if ($line =~ /^\s*(\w+)\s+(\w+)\s+([^\s]+)\s*/)
if (($line =~ /^\s*(\w+)\s+(\w+)\s+\"(.+)\"\s*/) ||
($line =~ /^\s*(\w+)\s+(\w+)\s+\'(.+)\'\s*/) ||
($line =~ /^\s*(\w+)\s+(\w+)\s+([^\s]+)\s*/))
{
my($array_name) = $1;
my($option_name) = $2;
my($option_value) = $3;
# print "Read '$array_name' '$option_name' '$option_value'\n";
if ($array_name eq "pull")
{
HandlePrefSet($pull_flags, $option_name, $option_value, "Pull");

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

@ -0,0 +1,53 @@
#-------------------------------------------------------------------------------
# These 3 lists are the 'master lists' to control what gets built.
#
# Ordering in these arrays is important; it has to reflect the order in
# which the build occurs.
#
# Setting containing spaces must be quoted with double quotes.
#-------------------------------------------------------------------------------
pull_flags
all 1
build_flags
all 1
dist 0
xpidl 0
idl 0
stubs 0
runtime 0
common 0
imglib 0
necko 0
security 0
browserutils 0
intl 0
nglayout 0
editor 0
viewer 0
xpapp 0
extensions 0
plugins 0
mailnews 0
apprunner 0
resources 0
options_flags
chrome_jars 1
chrome_files 0
use_jars 1
transformiix 0
mathml 0
svg 0
mng 1
ldap 0
xmlextras 0
mailextras 1
xptlink 0
filepath_flags
idepath ":Build IDE Path.txt"
sessionpath ":Build session path.txt"
buildlogfilepath ":Build Logs:Mozilla build log.txt"
scriptlogfilepath ":Build Logs:Mozilla script log.txt"

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

@ -1976,16 +1976,10 @@ sub Checkout()
#//--------------------------------------------------------------------------------------------------
#// RunBuild
#//--------------------------------------------------------------------------------------------------
sub RunBuild($$$)
sub RunBuild($$$$)
{
my($do_pull, $do_build, $build_prefs) = @_;
my($do_pull, $do_build, $build_flags_file, $build_prefs) = @_;
# setup the build log
SetupBuildLog($main::USE_TIMESTAMPED_LOGS);
StopForErrors();
#DontStopForErrors();
# if we are pulling, we probably want to do a full build, so clear the build progress
if ($do_pull) {
ClearBuildProgress();
@ -1997,11 +1991,15 @@ sub RunBuild($$$)
\%main::options,
\%main::optiondefines,
\%main::filepaths,
"MozillaBuildFlags.txt",
$build_flags_file,
$build_prefs);
# setup the build log
SetupBuildLog($main::filepaths{"buildlogfilepath"}, $main::USE_TIMESTAMPED_LOGS);
StopForErrors();
if ($main::LOG_TO_FILE) {
RedirectOutputToFile("Mozilla script log");
RedirectOutputToFile($main::filepaths{"scriptlogfilepath"});
}
# run a pre-build check to see that the tools etc are in order
@ -2015,7 +2013,9 @@ sub RunBuild($$$)
# create generated headers
ConfigureBuildSystem();
die;
chdir($main::MOZ_SRC);
BuildDist();

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

@ -48,4 +48,4 @@ $MOZ_SRC = cwd();
my($do_checkout) = 1;
my($do_build) = 0;
RunBuild($do_checkout, $do_build, "Pull prefs");
RunBuild($do_checkout, $do_build, "MozillaBuildFlags.txt", "Pull prefs");