source: trunk/third/firefox/config/sj.pl @ 21695

Revision 21695, 2.3 KB checked in by rbasch, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21694, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
1#!perl
2#
3# The contents of this file are subject to the Netscape Public
4# License Version 1.1 (the "License"); you may not use this file
5# except in compliance with the License. You may obtain a copy of
6# the License at http://www.mozilla.org/NPL/
7#
8# Software distributed under the License is distributed on an "AS
9# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10# implied. See the License for the specific language governing
11# rights and limitations under the License.
12#
13# The Original Code is mozilla.org code.
14#
15# The Initial Developer of the Original Code is Netscape
16# Communications Corporation.  Portions created by Netscape are
17# Copyright (C) 1998 Netscape Communications Corporation. All
18# Rights Reserved.
19#
20# Contributor(s):
21#
22
23#
24# Input: output_class_dir argfile javafilelist
25#
26
27$classdir = $ARGV[0];
28$argfile = $ARGV[1];
29$filelist = $ARGV[2];
30shift;
31
32$sjcmd = $ENV{'MOZ_TOOLS'} . '\bin\sj.exe';
33
34open(FL, "<$filelist" ) || die "can't open $filelist for reading";
35
36while( <FL> ){
37    # print;
38    @java_files = (@java_files, split(/[ \t\n]/));
39}
40close (FL);
41
42open(FL, "<$argfile" ) || die "can't open $argfile for reading";
43
44while( <FL> ){
45    chop;
46    $args .= $_;
47}
48close (FL);
49
50
51print "Java Files: @java_files\n";
52
53
54# compile as many java files as we can in one invocation
55# given the limitations of the command line
56foreach $filename (@java_files) {
57    $classfilename = $classdir;
58    $classfilename .= $filename;
59    $classfilename =~ s/.java$/.class/;
60    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
61     $ctime,$blksize,$blocks) = stat($filename);
62    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$classmtime,
63     $ctime,$blksize,$blocks) = stat($classfilename);
64#    print $filename, " ", $mtime, ", ", $classfilename, " ", $classmtime, "\n";
65    if ($mtime > $classmtime) {
66# are we too big?         
67                $len += length($filename);
68                if( $len >= 512 ) {
69                        print "$sjcmd $args $outofdate\n";
70                        $status = system "$sjcmd $args $outofdate";
71                        if( $status != 0 ) {
72                                exit( $status / 256 );
73                        }
74                        $outofdate = "";
75                        $len = length($filename);
76                }
77                $outofdate .= $filename;
78                $outofdate .= " ";
79    }
80}
81
82if( length($outofdate) > 0 ) {
83        print "$sjcmd $args $outofdate\n";
84        $status = system "$sjcmd $args $outofdate";
85        if( $status != 0 ) {
86                exit( $status / 256 );
87        }
88} else {
89        print "Files are up to date.\n";
90}
91
92
93print "\n";
Note: See TracBrowser for help on using the repository browser.