зеркало из https://github.com/mozilla/pjs.git
Make sure that buildID is set to 0 unless MOZILLA_OFFICIAL is set. Bug #26798 r=leaf r=scc
Note: for mac, MOZILLA_OFFICIAL is only set by default on opt builds until the new mac build scripts land.
This commit is contained in:
Родитель
835df3b76c
Коммит
5e988eb824
|
@ -21,12 +21,21 @@
|
|||
# Contributor(s):
|
||||
#
|
||||
|
||||
use Cwd;
|
||||
|
||||
# Make sure we add the config dir to search
|
||||
BEGIN
|
||||
{
|
||||
my ($inc_path) = cwd();
|
||||
$inc_path =~ s/:build:mac$/:config:/;
|
||||
push(@INC, $inc_path);
|
||||
}
|
||||
|
||||
#
|
||||
# build script (optimized)
|
||||
#
|
||||
use Mac::Processes;
|
||||
use NGLayoutBuildList;
|
||||
use Cwd;
|
||||
use Moz;
|
||||
|
||||
#-----------------------------------------------
|
||||
|
@ -37,6 +46,7 @@ $CARBON = 0; # turn on to build with TARGET_CARBON
|
|||
$PROFILE = 0;
|
||||
$GC_LEAK_DETECTOR = 0; # turn on to use GC leak detection
|
||||
$INCLUDE_CLASSIC_SKIN = 1;
|
||||
$MOZILLA_OFFICIAL = 1;
|
||||
|
||||
$pull{all} = 0;
|
||||
$pull{moz} = 0;
|
||||
|
@ -198,8 +208,8 @@ Checkout();
|
|||
ConfigureBuildSystem();
|
||||
|
||||
my(@gen_files) = (
|
||||
":mozilla:xpfe:appshell:public:nsBuildID.h",
|
||||
":mozilla:xpfe:browser:resources:locale:en-US:navigator.dtd"
|
||||
":mozilla:config:nsBuildID.h",
|
||||
":mozilla:xpfe:global:build.dtd"
|
||||
);
|
||||
SetBuildNumber(":mozilla:config:build_number", ":mozilla:config:aboutime.pl", \@gen_files);
|
||||
|
||||
|
|
|
@ -21,12 +21,21 @@
|
|||
# Contributor(s):
|
||||
#
|
||||
|
||||
use Cwd;
|
||||
|
||||
# Make sure we add the config dir to search
|
||||
BEGIN
|
||||
{
|
||||
my ($inc_path) = cwd();
|
||||
$inc_path =~ s/:build:mac$/:config:/;
|
||||
push(@INC, $inc_path);
|
||||
}
|
||||
|
||||
#
|
||||
# build script (debug)
|
||||
#
|
||||
use Mac::Processes;
|
||||
use NGLayoutBuildList;
|
||||
use Cwd;
|
||||
use Moz;
|
||||
|
||||
$DEBUG = 1;
|
||||
|
@ -194,6 +203,12 @@ Checkout();
|
|||
|
||||
ConfigureBuildSystem();
|
||||
|
||||
my(@gen_files) = (
|
||||
":mozilla:config:nsBuildID.h",
|
||||
":mozilla:xpfe:global:build.dtd"
|
||||
);
|
||||
SetBuildNumber(":mozilla:config:build_number", ":mozilla:config:aboutime.pl", \@gen_files);
|
||||
|
||||
chdir($MOZ_SRC);
|
||||
BuildDist();
|
||||
|
||||
|
|
572
build/mac/Moz.pm
572
build/mac/Moz.pm
|
@ -1,572 +0,0 @@
|
|||
=head1 NAME
|
||||
|
||||
B<Moz> - routines for automating CodeWarrior builds, and some extra-curricular activities related to building Mozilla
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use Moz;
|
||||
|
||||
OpenErrorLog(":::BuildLog");
|
||||
StopForErrors();
|
||||
|
||||
$Moz::QUIET = 1;
|
||||
InstallFromManifest(":projects:MANIFEST", $dist_dir);
|
||||
|
||||
BuildProjectClean(":projects:SomeProject.mcp", "SomeTarget");
|
||||
MakeAlias(":projects:SomeProject.shlb", $dist_dir);
|
||||
|
||||
DontStopForErrors();
|
||||
|
||||
BuildProject(":projects:SomeOtherProject.mcp", "SomeTarget");
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<Moz> comprises the routines needed to slap CodeWarrior around, force it to build a sequence of projects, report the results, and a few other things.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
|
||||
|
||||
package Moz;
|
||||
require Exporter;
|
||||
|
||||
use Mac::Types;
|
||||
use Mac::Events;
|
||||
use Mac::Processes;
|
||||
use File::Copy;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(LaunchCodeWarrior BuildProject BuildProjectClean GetFileModDate OpenErrorLog MakeAlias StopForErrors DontStopForErrors InstallFromManifest InstallResources SetBuildNumber SetAgentString SetTimeBomb Delay ActivateApplication);
|
||||
@EXPORT_OK = qw(CloseErrorLog UseCodeWarriorLib QUIET);
|
||||
|
||||
use Cwd;
|
||||
use File::Path;
|
||||
use ExtUtils::Manifest 'maniread';
|
||||
|
||||
use CodeWarriorLib;
|
||||
|
||||
sub current_directory()
|
||||
{
|
||||
my $current_directory = cwd();
|
||||
chop($current_directory) if ( $current_directory =~ m/:$/ );
|
||||
return $current_directory;
|
||||
}
|
||||
|
||||
sub full_path_to($)
|
||||
{
|
||||
my ($path) = @_;
|
||||
if ( $path =~ m/^[^:]+$/ )
|
||||
{
|
||||
$path = ":" . $path;
|
||||
}
|
||||
|
||||
if ( $path =~ m/^:/ )
|
||||
{
|
||||
$path = current_directory() . $path;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
=head2 Setup
|
||||
|
||||
Pretty much, everything is taken care of for you.
|
||||
However, B<Moz> does use a little compiled AppleScript library (the file CodeWarriorLib) for some of its communcication with CodeWarrior.
|
||||
If this library isn't in the same directory as "Moz.pm", then you need to tell B<Moz> where to find it.
|
||||
Call C<UseCodeWarriorLib($path_to_CodeWarriorLib)>.
|
||||
This routine is not exported by default, nor are you likely to need it.
|
||||
|
||||
=cut
|
||||
|
||||
sub UseCodeWarriorLib($)
|
||||
{
|
||||
# ($CodeWarriorLib) = @_;
|
||||
# $CodeWarriorLib = full_path_to($CodeWarriorLib);
|
||||
}
|
||||
|
||||
sub activate_CodeWarrior()
|
||||
{
|
||||
#MacPerl::DoAppleScript(<<END_OF_APPLESCRIPT);
|
||||
# tell (load script file "$CodeWarriorLib") to ActivateCodeWarrior()
|
||||
#END_OF_APPLESCRIPT
|
||||
}
|
||||
|
||||
|
||||
$logging = 0;
|
||||
$recent_errors_file = "";
|
||||
$stop_on_1st_error = 1;
|
||||
$QUIET = 0;
|
||||
|
||||
|
||||
|
||||
=head2 Logging all the errors and warnings - C<OpenErrorLog($log_file)>, C<CloseErrorLog()>
|
||||
|
||||
The warnings and errors generated in the course of building projects can be logged to a file.
|
||||
Tinderbox uses this facility to show why a remote build failed.
|
||||
|
||||
Logging is off by default.
|
||||
Start logging at any point in your build process with C<OpenErrorLog($log_file)>.
|
||||
Stop with C<CloseErrorLog()>.
|
||||
You never need to close the log explicitly, unless you want to just log a couple of projects in the middle of a big list.
|
||||
C<CloseErrorLog()> is not exported by default.
|
||||
|
||||
=cut
|
||||
|
||||
sub CloseErrorLog()
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
close(ERROR_LOG);
|
||||
$logging = 0;
|
||||
StopForErrors() if $stop_on_1st_error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub OpenErrorLog($)
|
||||
{
|
||||
my ($log_file) = @_;
|
||||
|
||||
CloseErrorLog();
|
||||
if ( $log_file )
|
||||
{
|
||||
$log_file = full_path_to($log_file);
|
||||
|
||||
open(ERROR_LOG, ">$log_file") || die "Can't open logfile, check the file path.\n";
|
||||
MacPerl::SetFileInfo("CWIE", "TEXT", $log_file);
|
||||
|
||||
$log_file =~ m/.+:(.+)/;
|
||||
$recent_errors_file = full_path_to("$1.part");
|
||||
$logging = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=head2 Stopping before it's too late - C<StopForErrors()>, C<DontStopForErrors()>
|
||||
|
||||
When building a long list of projects, you decide whether to continue building subsequent projects when one fails.
|
||||
By default, your build script will C<die> after the first project that generates an error while building.
|
||||
Change this behavior with C<DontStopForErrors()>.
|
||||
Re-enable it with C<StopForErrors()>.
|
||||
|
||||
=cut
|
||||
|
||||
sub StopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 1;
|
||||
|
||||
# Can't stop for errors unless we notice them.
|
||||
# Can't notice them unless we are logging.
|
||||
# If the user didn't explicitly request logging, log to a temporary file.
|
||||
|
||||
if ( ! $recent_errors_file )
|
||||
{
|
||||
OpenErrorLog("${TMPDIR}BuildResults");
|
||||
}
|
||||
}
|
||||
|
||||
sub DontStopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 0;
|
||||
}
|
||||
|
||||
sub log_message($)
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
my ($message) = @_;
|
||||
print ERROR_LOG $message;
|
||||
}
|
||||
}
|
||||
|
||||
sub log_message_with_time($)
|
||||
{
|
||||
if ( $logging )
|
||||
{
|
||||
my ($message) = @_;
|
||||
my $time_stamp = localtime();
|
||||
log_message("$message ($time_stamp)\n");
|
||||
}
|
||||
}
|
||||
|
||||
sub log_recent_errors($)
|
||||
{
|
||||
my ($project_name) = @_;
|
||||
my $found_errors = 0;
|
||||
|
||||
if ( $logging )
|
||||
{
|
||||
open(RECENT_ERRORS, "<$recent_errors_file");
|
||||
|
||||
while( <RECENT_ERRORS> )
|
||||
{
|
||||
if ( /^Error/ || /^CouldnÕt find project file/ || /^Link Error/ )
|
||||
{
|
||||
# if (!$found_errors)
|
||||
# print $_;
|
||||
$found_errors = 1;
|
||||
}
|
||||
print ERROR_LOG $_;
|
||||
}
|
||||
|
||||
close(RECENT_ERRORS);
|
||||
unlink("$recent_errors_file");
|
||||
}
|
||||
|
||||
if ( $stop_on_1st_error && $found_errors )
|
||||
{
|
||||
print ERROR_LOG "### Build failed.\n";
|
||||
die "### Errors encountered building \"$project_name\".\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub build_project($$$)
|
||||
{
|
||||
my ($project_path, $target_name, $clean_build) = @_;
|
||||
$project_path = full_path_to($project_path);
|
||||
|
||||
# $project_path =~ m/.+:(.+)/;
|
||||
# my $project_name = $1;
|
||||
|
||||
log_message_with_time("### Building \"$project_path\"");
|
||||
|
||||
# Check that the given project exists
|
||||
if (! -e $project_path)
|
||||
{
|
||||
print ERROR_LOG "### Build failed.\n";
|
||||
die "### Can't find project file \"$project_path\".\n";
|
||||
}
|
||||
|
||||
print "Building \"$project_path\[$target_name\]\"\n";
|
||||
|
||||
$had_errors = CodeWarriorLib::build_project(
|
||||
$project_path, $target_name, $recent_errors_file, $clean_build
|
||||
);
|
||||
WaitNextEvent();
|
||||
|
||||
# $had_errors =
|
||||
#MacPerl::DoAppleScript(<<END_OF_APPLESCRIPT);
|
||||
# tell (load script file "$CodeWarriorLib") to BuildProject("$project_path", "$project_name", "$target_name", "$recent_errors_file", $clean_build)
|
||||
#END_OF_APPLESCRIPT
|
||||
|
||||
# Append any errors to the globally accumulated log file
|
||||
# if ( $had_errors ) # Removed this test, because we want warnings, too. -- jrm
|
||||
{
|
||||
log_recent_errors($project_path);
|
||||
}
|
||||
}
|
||||
|
||||
=head2 Getting CodeWarrior to build projects - C<BuildProject($project, $opt_target)>, C<BuildProjectClean($project, $opt_target)>
|
||||
|
||||
C<BuildProject()> and C<BuildProjectClean()> are identical, except that the latter first removes object code.
|
||||
In both, CodeWarrior opens the project if it wasn't already open; builds the given (or else current) target; and finally closes
|
||||
the project, if it wasn't already open.
|
||||
|
||||
=cut
|
||||
|
||||
sub BuildProject($;$)
|
||||
{
|
||||
my ($project_path, $target_name) = @_;
|
||||
build_project($project_path, $target_name, 0);
|
||||
}
|
||||
|
||||
sub BuildProjectClean($;$)
|
||||
{
|
||||
my ($project_path, $target_name) = @_;
|
||||
build_project($project_path, $target_name, 1);
|
||||
}
|
||||
|
||||
|
||||
=head2 Miscellaneous
|
||||
|
||||
C<MakeAlias($old_file, $new_file)> functions like C<symlink()>, except with better argument defaulting and more explicit error messages.
|
||||
|
||||
=cut
|
||||
|
||||
sub MakeAlias($$)
|
||||
{
|
||||
my ($old_file, $new_file) = @_;
|
||||
|
||||
# if the directory to hold $new_file doesn't exist, create it
|
||||
if ( ($new_file =~ m/(.+:)/) && !-d $1 )
|
||||
{
|
||||
mkpath($1);
|
||||
}
|
||||
|
||||
# if a leaf name wasn't specified for $new_file, use the leaf from $old_file
|
||||
if ( ($new_file =~ m/:$/) && ($old_file =~ m/.+:(.+)/) )
|
||||
{
|
||||
$new_file .= $1;
|
||||
}
|
||||
|
||||
my $message = "Can't create a Finder alias (at \"$new_file\")\n for \"$old_file\"; because ";
|
||||
|
||||
die "$message \"$old_file\" doesn't exist.\n" unless -e $old_file;
|
||||
die "$message I won't replace an existing (non-alias) file with an alias.\n" if ( -e $new_file && ! -l $new_file );
|
||||
|
||||
# now: $old_file exists; $new_file doesn't (or else, is an alias already)
|
||||
|
||||
if ( -l $new_file )
|
||||
{
|
||||
# ...then see if it already points to $old_file
|
||||
my $current_target = full_path_to(readlink($new_file));
|
||||
my $new_target = full_path_to($old_file);
|
||||
|
||||
return if ( $current_target eq $new_target );
|
||||
# if the desired alias already exists and points to the right thing, then we're done
|
||||
|
||||
unlink $new_file;
|
||||
}
|
||||
|
||||
symlink($old_file, $new_file) || die "$message symlink returned an unexpected error.\n";
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
C<InstallFromManifest()>
|
||||
|
||||
=cut
|
||||
|
||||
sub InstallFromManifest($;$$)
|
||||
{
|
||||
my ($manifest_file, $dest_dir, $flat) = @_;
|
||||
|
||||
$flat = 0 unless defined($flat); # if $flat, all rel. paths in MANIFEST get aliased to the root of $dest_dir
|
||||
|
||||
$dest_dir ||= ":";
|
||||
|
||||
$manifest_file =~ m/(.+):/;
|
||||
my $source_dir = $1;
|
||||
|
||||
chop($dest_dir) if $dest_dir =~ m/:$/;
|
||||
|
||||
#Mac::Events->import();
|
||||
WaitNextEvent();
|
||||
if ($flat)
|
||||
{
|
||||
print "Doing manifest on \"$manifest_file\" FLAT\n" unless $QUIET;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Doing manifest on \"$manifest_file\"\n" unless $QUIET;
|
||||
}
|
||||
|
||||
my $read = maniread(full_path_to($manifest_file));
|
||||
foreach $file (keys %$read)
|
||||
{
|
||||
next unless $file;
|
||||
|
||||
$subdir = ":";
|
||||
if (!$flat && ($file =~ /:.+:/ ))
|
||||
{
|
||||
$subdir = $&;
|
||||
}
|
||||
|
||||
$file = ":$file" unless $file =~ m/^:/;
|
||||
MakeAlias("$source_dir$file", "$dest_dir$subdir");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
C<InstallResources()>
|
||||
|
||||
=cut
|
||||
|
||||
# parameters are path to MANIFEST file, destination dir, true (to make copies) or false (to make aliases)
|
||||
sub InstallResources($;$;$)
|
||||
{
|
||||
my ($manifest_file, $dest_dir, $copy_files) = @_;
|
||||
|
||||
$dest_dir ||= ":";
|
||||
mkpath($dest_dir) if !-d $dest_dir;
|
||||
|
||||
$manifest_file =~ m/(.+):/;
|
||||
my $source_dir = $1;
|
||||
|
||||
chop($dest_dir) if $dest_dir =~ m/:$/;
|
||||
|
||||
WaitNextEvent();
|
||||
print "Installing resources from \"$manifest_file\"\n" unless $QUIET;
|
||||
|
||||
my $read = maniread(full_path_to($manifest_file));
|
||||
foreach $file (keys %$read)
|
||||
{
|
||||
next unless $file;
|
||||
|
||||
if ($copy_files)
|
||||
{
|
||||
copy("$source_dir:$file", "$dest_dir:$file");
|
||||
}
|
||||
else
|
||||
{
|
||||
MakeAlias("$source_dir:$file", "$dest_dir:$file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub SetBuildNumber($$$)
|
||||
{
|
||||
my($build_num_file, $build_gen_script, $files_to_touch) = @_;
|
||||
|
||||
open (OUTPUT, ">$build_num_file") || die "could not open buildnumber";
|
||||
|
||||
open (BDATE, "perl :mozilla:config:bdate.pl|");
|
||||
|
||||
while (<BDATE>) {
|
||||
print OUTPUT $_;
|
||||
}
|
||||
|
||||
close (BDATE);
|
||||
close (OUTPUT);
|
||||
|
||||
my($file);
|
||||
foreach $file (@$files_to_touch)
|
||||
{
|
||||
print "Writing build number to $file\n";
|
||||
system ("perl $build_gen_script $file $build_num_file");
|
||||
}
|
||||
}
|
||||
|
||||
sub SetAgentString
|
||||
{
|
||||
|
||||
open (BDATE, ":mozilla:config:build_number") || die "could not open buildnumber";
|
||||
|
||||
while (<BDATE>) {
|
||||
$build_number = $_;
|
||||
}
|
||||
|
||||
close (BDATE);
|
||||
|
||||
open (ORIGFILE, ":mozilla:cmd:macfe:restext:custom.r") || die "no original file";
|
||||
open (OUTPUT, ">:mozilla:cmd:macfe:restext:agent.r") || die "no output file";
|
||||
|
||||
chop($build_number);
|
||||
|
||||
while (<ORIGFILE>) {
|
||||
|
||||
$tempstring = $_;
|
||||
if ($tempstring =~ "\#define VERSION_MAJOR_STR") {
|
||||
$tempstring = "\#define VERSION_MAJOR_STR \"5.0a1-" . $build_number . " Development\"\n";
|
||||
}
|
||||
print OUTPUT $tempstring;
|
||||
}
|
||||
|
||||
close (ORIGFILE);
|
||||
close (OUTPUT);
|
||||
|
||||
unlink (":mozilla:cmd:macfe:restext:custom.r");
|
||||
rename (":mozilla:cmd:macfe:restext:agent.r", ":mozilla:cmd:macfe:restext:custom.r");
|
||||
}
|
||||
|
||||
sub SetTimeBomb($$)
|
||||
|
||||
{
|
||||
my ($warn_days, $bomb_days) = @_;
|
||||
|
||||
system("perl :mozilla:config:mac-set-timebomb.pl $warn_days $bomb_days");
|
||||
|
||||
}
|
||||
|
||||
sub Delay($)
|
||||
|
||||
{
|
||||
my ($delay_seconds) = @_;
|
||||
|
||||
$now = time;
|
||||
|
||||
$exit_time = $now + $delay_seconds;
|
||||
|
||||
while ($exit_time > $now) {
|
||||
$now = time;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub GetFileModDate($)
|
||||
{
|
||||
my($filePath)=@_;
|
||||
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
|
||||
$atime,$mtime,$ctime,$blksize,$blocks) = stat($filePath);
|
||||
return $mtime;
|
||||
}
|
||||
|
||||
|
||||
sub LaunchCodeWarrior()
|
||||
{
|
||||
# this both launches and writes idepath.txt
|
||||
CodeWarriorLib::activate();
|
||||
}
|
||||
|
||||
sub ActivateApplication($)
|
||||
{
|
||||
my ($appSignature) = @_;
|
||||
my ($psi, $found);
|
||||
my ($appPSN);
|
||||
|
||||
$found = 0;
|
||||
|
||||
foreach $psi (values(%Process))
|
||||
{
|
||||
if ($psi->processSignature() eq $appSignature)
|
||||
{
|
||||
$appPSN = $psi->processNumber();
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if ($found == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetFrontProcess($appPSN);
|
||||
|
||||
while (GetFrontProcess() != $appPSN)
|
||||
{
|
||||
WaitNextEvent();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Scott Collins <scc@netscape.com>, Simon Fraser <sfraser@netscape.com>, Chris Yeh <cyeh@netscape.com>
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
BuildMozillaDebug.pl (et al), BuildList.pm, CodeWarriorLib (an AppleScript library)
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
The contents of this file are subject to the Netscape Public
|
||||
License Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/NPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS
|
||||
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is Netscape
|
||||
Communications Corporation. Portions created by Netscape are
|
||||
Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
||||
Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
=cut
|
|
@ -1,54 +0,0 @@
|
|||
#!perl
|
||||
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
#
|
||||
# nglayout pull script
|
||||
#
|
||||
use Mac::Processes;
|
||||
use NGLayoutBuildList;
|
||||
use Cwd;
|
||||
use Moz;
|
||||
|
||||
# configuration variables
|
||||
$pull{all} = 1;
|
||||
$pull{moz} = 0;
|
||||
$pull{runtime} = 0;
|
||||
|
||||
if ($pull{all})
|
||||
{
|
||||
foreach $k (keys(%pull))
|
||||
{
|
||||
$pull{$k} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# you should not have to edit anything bellow
|
||||
|
||||
chdir("::::");
|
||||
|
||||
Moz::StopForErrors();
|
||||
#Moz::DontStopForErrors();
|
||||
|
||||
OpenErrorLog("NGLayoutPullLog");
|
||||
|
||||
Checkout();
|
|
@ -75,24 +75,20 @@ ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|||
$(INSTALL) -m 444 $(srcdir)/os2/getopt.h $(DIST)/include
|
||||
endif
|
||||
|
||||
# Make sure the build_number is 00000000000 unless MOZILLA_OFFICIAL is set
|
||||
build_number: FORCE
|
||||
GARBAGE += build_number nsBuildId.h
|
||||
|
||||
ifneq ($(origin BUILD_OFFICIAL)_$(origin MOZILLA_OFFICIAL),undefined_undefined)
|
||||
$(PERL) $(srcdir)/bdate.pl > $@
|
||||
_BN_OFFICIAL=1
|
||||
else
|
||||
@if [ ! -f build_number ]; then \
|
||||
$(RM) -rf $@ ; \
|
||||
echo 0000000000 > $@ ; \
|
||||
else if [ `cat build_number` != "0000000000" ]; then \
|
||||
echo 0000000000 > $@ ; \
|
||||
fi \
|
||||
fi
|
||||
_BN_OFFICIAL=
|
||||
endif
|
||||
|
||||
nsBuildID.h: build_number
|
||||
build_number: FORCE
|
||||
$(PERL) -I$(srcdir) $(srcdir)/bdate.pl $@ $(_BN_OFFICIAL)
|
||||
|
||||
nsBuildID.h: nsBuildID.h.in build_number
|
||||
$(RM) $@
|
||||
echo "#define NS_BUILD_ID 0000000000" > $@
|
||||
$(PERL) $(srcdir)/aboutime.pl $@ build_number
|
||||
$(PERL) -I$(srcdir) $(srcdir)/aboutime.pl $@ build_number $<
|
||||
|
||||
# clear record of installed chrome on complete rebuild
|
||||
#install::
|
||||
|
|
|
@ -1,30 +1,12 @@
|
|||
open INFILE, "<$ARGV[1]";
|
||||
$build = <INFILE>;
|
||||
close INFILE;
|
||||
chop $build;
|
||||
open INFILE, "<$ARGV[0]" || die;
|
||||
open OUTFILE, ">$ARGV[0].old" || die;
|
||||
|
||||
while (<INFILE>) {
|
||||
use strict;
|
||||
use mozBDate;
|
||||
|
||||
$id = $_;
|
||||
if ($id =~ "Build ID:") {
|
||||
$temp = "Build ID: " . $build;
|
||||
$id =~ s/Build ID:\s\d+/$temp/;
|
||||
print OUTFILE $id;
|
||||
}
|
||||
elsif ($id =~ "NS_BUILD_ID") {
|
||||
$temp = "NS_BUILD_ID " . $build;
|
||||
$id =~ s/NS_BUILD_ID\s\d+/$temp/;
|
||||
print OUTFILE $id;
|
||||
}
|
||||
else {
|
||||
print OUTFILE $_;
|
||||
}
|
||||
}
|
||||
my $outfile = $ARGV[0];
|
||||
my $build_num_file = $ARGV[1];
|
||||
my $infile = "";
|
||||
|
||||
close INFILE;
|
||||
close OUTFILE;
|
||||
$infile = $ARGV[2] if ("$ARGV[2]" ne "");
|
||||
|
||||
&mozBDate::SubstituteBuildNumber($outfile, $build_num_file, $infile);
|
||||
|
||||
unlink $ARGV[0];
|
||||
rename "$ARGV[0].old", "$ARGV[0]";
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
# Contributor(s):
|
||||
#
|
||||
|
||||
# XP way of doing the build date.
|
||||
# 1998091509 = 1998, September, 15th, 9am local time zone
|
||||
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
|
||||
# localtime returns year minus 1900
|
||||
$year = $year + 1900;
|
||||
printf("%04d%02d%02d%02d\n", $year, 1+$mon, $mday, $hour);
|
||||
use mozBDate;
|
||||
|
||||
# Both "generate" args are optional
|
||||
$file = $ARGV[0] if ("$ARGV[0]" ne "");
|
||||
$official = 1 if ("$ARGV[1]" ne "");
|
||||
&mozBDate::UpdateBuildNumber($file, $official);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ INSTALL_FILE_LIST=$(MOZ_TOOLS)\bin\fullsoft.dll $(MOZ_TOOLS)\bin\talkback.cnt $(
|
|||
INSTALL_DIR=$(DIST)\bin
|
||||
!endif
|
||||
|
||||
GARBAGE = *.obj *.sbr *.pdb
|
||||
GARBAGE = *.obj *.sbr *.pdb build_number nsBuildID.h
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
|
@ -58,17 +58,20 @@ GARBAGE = *.obj *.sbr *.pdb
|
|||
include <$(DEPTH)/config/config.mak>
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
# update build number from within make script
|
||||
build_number::
|
||||
!ifdef MOZILLA_OFFICIAL
|
||||
echo Generating build number...
|
||||
$(RM) $@
|
||||
$(PERL) bdate.pl > $@
|
||||
echo Setting build number...
|
||||
$(PERL) aboutime.pl $(DEPTH)/xpfe/browser/resources/locale/en-US/navigator.dtd $@
|
||||
$(PERL) aboutime.pl $(DEPTH)/xpfe/appshell/public/nsBuildID.h $@
|
||||
_BN_OFFICIAL=1
|
||||
!else
|
||||
_BN_OFFICIAL=
|
||||
!endif
|
||||
|
||||
# update build number from within make script
|
||||
build_number:
|
||||
$(PERL) -I. bdate.pl $@ $(_BN_OFFICIAL)
|
||||
|
||||
nsBuildID.h: build_number nsBuildID.h.in
|
||||
$(RM) $@
|
||||
$(PERL) -I. aboutime.pl $@ build_number nsBuildID.h.in
|
||||
|
||||
#// Rule to set the timebomb on official mozilla builds
|
||||
|
||||
|
||||
|
@ -94,7 +97,7 @@ bin2rc.exe:: bin2rc.c
|
|||
makedep.exe:: makedep.cpp
|
||||
$(CC) -MT /O2 /GB $**
|
||||
|
||||
export:: makecopy.exe mangle.exe mantomak.exe bin2rc.exe makedep.exe build_number
|
||||
export:: makecopy.exe mangle.exe mantomak.exe bin2rc.exe makedep.exe build_number nsBuildID.h
|
||||
$(MAKE_INSTALL) nsBuildID.h $(PUBLIC)
|
||||
|
||||
!ifdef MOZ_FULLCIRCLE
|
||||
|
|
|
@ -605,7 +605,7 @@ REGCHROME = @perl $(DEPTH)\config\add-chrome.pl $(DIST)\bin\chrome\installed-chr
|
|||
|
||||
!if exist($(JAR_MANIFEST))
|
||||
|
||||
chrome::
|
||||
chrome:: $(CHROME_DEPS)
|
||||
$(PERL) $(DEPTH)\config\make-jars.pl $(_JAR_FLAT_FILES_ONLY) -d $(DIST)\bin\chrome < $(JAR_MANIFEST)
|
||||
|
||||
!endif
|
||||
|
|
|
@ -1142,7 +1142,7 @@ _JAR_FLAT_FILES_ONLY=
|
|||
_JAR_REGCHROME_JAR=0
|
||||
endif
|
||||
|
||||
chrome::
|
||||
chrome:: $(CHROME_DEPS)
|
||||
@if test -f $(JAR_MANIFEST); then $(PERL) $(topsrcdir)/../mozilla/config/make-jars.pl $(_JAR_FLAT_FILES_ONLY) -d $(DIST)/bin/chrome -s $(srcdir) < $(JAR_MANIFEST); fi
|
||||
|
||||
install:: chrome
|
||||
|
|
|
@ -40,7 +40,6 @@ XPIDLSRCS = \
|
|||
EXPORTS = \
|
||||
nsIWebShellWindow.h \
|
||||
nsAppShellCIDs.h \
|
||||
nsBuildID.h \
|
||||
nsIDOMXPConnectFactory.h \
|
||||
nsFileLocations.h \
|
||||
nsINetSupportDialogService.h \
|
||||
|
|
|
@ -33,6 +33,8 @@ Contributor(s): ______________________________________. -->
|
|||
<!DOCTYPE window [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
|
||||
%brandDTD;
|
||||
<!ENTITY % buildDTD SYSTEM "chrome://global/content/build.dtd" >
|
||||
%buildDTD;
|
||||
<!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd" >
|
||||
%navigatorDTD;
|
||||
]>
|
||||
|
|
|
@ -28,14 +28,5 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
DIRS = unix
|
||||
|
||||
GARBAGE += navigator.dtd.out
|
||||
|
||||
navigator.dtd.out: navigator.dtd $(DEPTH)/config/build_number Makefile Makefile.in
|
||||
cp $(srcdir)/navigator.dtd $@
|
||||
$(PERL) $(topsrcdir)/config/aboutime.pl $@ $(DEPTH)/config/build_number
|
||||
|
||||
chrome:: navigator.dtd.out unix-jar.mn
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
JAR_MANIFEST = $(srcdir)/unix-jar.mn
|
||||
|
|
|
@ -309,7 +309,6 @@
|
|||
|
||||
<!-- Statusbar -->
|
||||
<!ENTITY statusText.label "Document: Done">
|
||||
<!ENTITY buildId.label "Build ID: 2000091312">
|
||||
|
||||
<!-- Context Menu -->
|
||||
<!ENTITY blockImageCmd.label "Block Image from Loading">
|
||||
|
|
|
@ -28,8 +28,17 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
DIRS = resources
|
||||
|
||||
CHROME_DEPS = build.dtd
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
GARBAGE += build.dtd
|
||||
|
||||
build.dtd: build.dtd.in $(DEPTH)/config/build_number
|
||||
@$(RM) -f $@
|
||||
$(PERL) -I$(topsrcdir)/config $(topsrcdir)/config/aboutime.pl $@ $(DEPTH)/config/build_number $<
|
||||
|
||||
chrome::
|
||||
@$(REGCHROME) content global toolkit.jar
|
||||
@$(REGCHROME) locale en-US/global en-US.jar
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ toolkit.jar:
|
|||
content/global/xul.css (resources/content/xul.css)
|
||||
content/global/toolbarBindings.xml (resources/content/toolbarBindings.xml)
|
||||
content/global/stringbundleBindings.xml (resources/content/stringbundleBindings.xml)
|
||||
content/global/build.dtd (build.dtd)
|
||||
|
||||
en-US.jar:
|
||||
locale/en-US/global/contents.rdf (resources/locale/en-US/contents.rdf)
|
||||
|
|
|
@ -23,8 +23,16 @@ DEPTH=..\..
|
|||
|
||||
DIRS= resources
|
||||
|
||||
CHROME_DEPS = build.dtd
|
||||
GARBAGE = build.dtd
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
chrome::
|
||||
$(REGCHROME) content global toolkit.jar
|
||||
$(REGCHROME) locale en-US/global en-US.jar
|
||||
|
||||
build.dtd: build.dtd.in $(DEPTH)\config\build_number
|
||||
@rm -f $@
|
||||
$(PERL) -I$(DEPTH)\config $(DEPTH)\config\aboutime.pl $@ $(DEPTH)\config\build_number build.dtd.in
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче