PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/config/milestone.pl

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
Perl | 112 lines | 58 code | 16 blank | 38 comment | 9 complexity | 90034f10c95d968e6f2d919fd7f4180d MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. #!/usr/bin/perl -w
  2. # ***** BEGIN LICENSE BLOCK *****
  3. # Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. #
  5. # The contents of this file are subject to the Mozilla Public License Version
  6. # 1.1 (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. # http://www.mozilla.org/MPL/
  9. #
  10. # Software distributed under the License is distributed on an "AS IS" basis,
  11. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. # for the specific language governing rights and limitations under the
  13. # License.
  14. #
  15. # The Original Code is the Win32 Version System.
  16. #
  17. # The Initial Developer of the Original Code is Netscape Communications Corporation
  18. # Portions created by the Initial Developer are Copyright (C) 2002
  19. # the Initial Developer. All Rights Reserved.
  20. #
  21. # Contributor(s):
  22. #
  23. # Alternatively, the contents of this file may be used under the terms of
  24. # either the GNU General Public License Version 2 or later (the "GPL"), or
  25. # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  26. # in which case the provisions of the GPL or the LGPL are applicable instead
  27. # of those above. If you wish to allow use of your version of this file only
  28. # under the terms of either the GPL or the LGPL, and not to allow others to
  29. # use your version of this file under the terms of the MPL, indicate your
  30. # decision by deleting the provisions above and replace them with the notice
  31. # and other provisions required by the GPL or the LGPL. If you do not delete
  32. # the provisions above, a recipient may use your version of this file under
  33. # the terms of any one of the MPL, the GPL or the LGPL.
  34. #
  35. # ***** END LICENSE BLOCK *****
  36. use Getopt::Long;
  37. use strict;
  38. use vars qw(
  39. $OBJDIR
  40. $SRCDIR
  41. $TOPSRCDIR
  42. $SCRIPTDIR
  43. @TEMPLATE_FILE
  44. $MILESTONE_FILE
  45. $MILESTONE
  46. $MILESTONE_NUM
  47. @MILESTONE_PARTS
  48. $MINI_VERSION
  49. $MICRO_VERSION
  50. $opt_debug
  51. $opt_template
  52. $opt_help
  53. );
  54. $SCRIPTDIR = $0;
  55. $SCRIPTDIR =~ s/[^\/]*$//;
  56. push(@INC,$SCRIPTDIR);
  57. require "Moz/Milestone.pm";
  58. &GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template');
  59. if (defined($opt_help)) {
  60. &usage();
  61. exit;
  62. }
  63. if (defined($opt_template)) {
  64. @TEMPLATE_FILE = @ARGV;
  65. if ($opt_debug) {
  66. print("TEMPLATE_FILE = --@TEMPLATE_FILE--\n");
  67. }
  68. }
  69. if (!defined($SRCDIR)) { $SRCDIR = '.'; }
  70. if (!defined($OBJDIR)) { $OBJDIR = '.'; }
  71. $MILESTONE_FILE = "$TOPSRCDIR/config/milestone.txt";
  72. @MILESTONE_PARTS = (0, 0, 0, 0);
  73. #
  74. # Grab milestone (top line of $MILESTONE_FILE that starts with a digit)
  75. #
  76. my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE);
  77. if (defined(@TEMPLATE_FILE)) {
  78. my $TFILE;
  79. foreach $TFILE (@TEMPLATE_FILE) {
  80. my $BUILT_FILE = "$OBJDIR/$TFILE";
  81. $TFILE = "$SRCDIR/$TFILE.tmpl";
  82. if (-e $TFILE) {
  83. Moz::Milestone::build_file($TFILE,$BUILT_FILE);
  84. } else {
  85. warn("$0: No such file $TFILE!\n");
  86. }
  87. }
  88. } else {
  89. print "$milestone\n";
  90. }
  91. sub usage() {
  92. print <<END
  93. `milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list]` # will build file list from .tmpl files
  94. END
  95. ;
  96. }