2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
29 $SCRIPTDIR =~ s/[^\/]*$//;
30 push(@INC,$SCRIPTDIR);
32 require "Moz/Milestone.pm";
34 &GetOptions
('topsrcdir=s' => \
$TOPSRCDIR, 'srcdir=s' => \
$SRCDIR, 'objdir=s' => \
$OBJDIR, 'debug', 'help', 'template', 'uaversion', 'symbolversion');
36 if (defined($opt_help)) {
41 if (defined($opt_template)) {
42 @TEMPLATE_FILE = @ARGV;
44 print("TEMPLATE_FILE = --@TEMPLATE_FILE--\n");
48 if (!defined($SRCDIR)) { $SRCDIR = '.'; }
49 if (!defined($OBJDIR)) { $OBJDIR = '.'; }
51 $MILESTONE_FILE = "$TOPSRCDIR/config/milestone.txt";
52 @MILESTONE_PARTS = (0, 0, 0, 0);
55 # Grab milestone (top line of $MILESTONE_FILE that starts with a digit)
57 my $milestone = Moz
::Milestone
::getOfficialMilestone
($MILESTONE_FILE);
62 foreach $TFILE (@TEMPLATE_FILE) {
63 my $BUILT_FILE = "$OBJDIR/$TFILE";
64 $TFILE = "$SRCDIR/$TFILE.tmpl";
68 Moz
::Milestone
::build_file
($TFILE,$BUILT_FILE);
71 warn("$0: No such file $TFILE!\n");
74 } elsif(defined($opt_uaversion)) {
75 # Only expose the major milestone in the UA string, hide the patch level
76 # (bugs 572659 and 870868).
77 my $uaversion = Moz
::Milestone
::getMilestoneMajor
($milestone) . ".0";
79 } elsif(defined($opt_symbolversion)) {
80 # Only expose major milestone and alpha version. Used for symbol versioning
82 my $symbolversion = Moz
::Milestone
::getMilestoneMajor
($milestone) .
83 Moz
::Milestone
::getMilestoneABWithNum
($milestone);
84 print "$symbolversion\n";
91 `milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion --symbolversion` # will build file list from .tmpl files