From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16675 invoked by alias); 18 May 2006 18:55:13 -0000 Received: (qmail 16665 invoked by uid 22791); 18 May 2006 18:55:12 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 18 May 2006 18:55:09 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4IIt7xd016082 for ; Thu, 18 May 2006 14:55:07 -0400 Received: from opsy.redhat.com (vpn50-175.rdu.redhat.com [172.16.50.175]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k4IIt1mD017569; Thu, 18 May 2006 14:55:01 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id CD51A3B43D4; Thu, 18 May 2006 12:51:53 -0600 (MDT) To: Java Patch List Subject: Patch: FYI: finding resource files From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Thu, 18 May 2006 18:55:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2006-q2/txt/msg00197.txt.bz2 I'm checking this in. I've updated makemake.tcl to search for resource files as well. This way we won't miss any during updates -- Casey pointed out on irc yesterday that we had missed one. Currently it looks for .properties files and for service files in META-INF. It ignores resource files for the time being. Tom Index: ChangeLog from Tom Tromey * source.am, Makefile.in: Rebuilt. * Makefile.am (property_files): Removed. * scripts/makemake.tcl (properties_map): New global. (properties_files): Likewise. (emit_property_files): New proc. (scan_packages): Scan META-INF. Print property_files variable. Scan classpath/resource. * java/util/logging/logging.properties: Removed. Index: scripts/makemake.tcl =================================================================== --- scripts/makemake.tcl (revision 113887) +++ scripts/makemake.tcl (working copy) @@ -88,6 +88,20 @@ global dir_map makearray dir_map +# An entry in this map means that all .properties files in the +# corresponding directory should be ignored. +global properties_map +makearray properties_map + +# logging.properties is installed and is editable. +set properties_map(java/util/logging) _ +# We haven't merged locale resources yet. +set properties_map(gnu/java/locale) _ + + +# List of all properties files. +set properties_files {} + # List of all '@' files that we are going to compile. set package_files {} @@ -163,11 +177,11 @@ error "can't happen" } -# Scan a directory and its subdirectories for .java source files. -# Note that we keep basedir and subdir separate so we can properly -# update our global data structures. +# Scan a directory and its subdirectories for .java source files or +# .properties files. Note that we keep basedir and subdir separate so +# we can properly update our global data structures. proc scan_directory {basedir subdir} { - global dir_map + global dir_map properties_map properties_files set subdirs {} set files {} @@ -176,8 +190,16 @@ foreach file [lsort [glob -nocomplain *]] { if {[string match *.java $file]} { lappend files $subdir/$file + } elseif {[string match *.properties $file]} { + if {! [info exists properties_map($subdir)]} { + # We assume there aren't any overrides. + lappend properties_files $basedir/$subdir/$file + } } elseif {[file isdirectory $file]} { lappend subdirs $subdir/$file + } elseif {$subdir == "META-INF/services"} { + # All service files are included as properties. + lappend properties_files $basedir/$subdir/$file } } cd $here @@ -195,7 +217,7 @@ # Scan known packages beneath the base directory for .java source # files. proc scan_packages {basedir} { - foreach subdir {gnu java javax org} { + foreach subdir {gnu java javax org META-INF} { if {[file exists $basedir/$subdir]} { scan_directory $basedir $subdir } @@ -340,6 +362,8 @@ scan_packages classpath/external/sax scan_packages classpath/external/w3c_dom scan_packages classpath/external/relaxngDatatype +# Resource files. +scan_packages classpath/resource # Now scan our own files; this will correctly override decisions made # when scanning classpath. scan_packages . @@ -376,3 +400,4 @@ pp_var all_packages_source_files $package_files pp_var ordinary_header_files $header_vars "\$(" ")" pp_var bc_objects $bc_objects +pp_var property_files $properties_files Index: java/util/logging/logging.properties =================================================================== --- java/util/logging/logging.properties (revision 113887) +++ java/util/logging/logging.properties (working copy) @@ -1,8 +0,0 @@ -# Default logging properties. -# See javadoc in java.util.logging.LogManager to information on -# overriding these settings. Most of the defaults are compiled in, so -# this file is fairly minimal. - -# Send log records to System.err, default to INFO per documentation. -handlers = java.util.logging.ConsoleHandler -.level = INFO Index: Makefile.am =================================================================== --- Makefile.am (revision 113887) +++ Makefile.am (working copy) @@ -304,19 +304,7 @@ -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) lib_gnu_awt_xlib_la_LINK = $(LIBLINK) -## Build property files into the library. -property_files = \ -classpath/resource/org/ietf/jgss/MessagesBundle.properties \ -classpath/resource/java/util/iso4217.properties \ -classpath/resource/gnu/java/awt/peer/gtk/font.properties \ -classpath/resource/gnu/regexp/MessagesBundle_it.properties \ -classpath/resource/gnu/regexp/MessagesBundle_fr.properties \ -classpath/resource/gnu/regexp/MessagesBundle.properties \ -classpath/resource/META-INF/services/org.xml.sax.driver \ -classpath/resource/META-INF/services/javax.xml.parsers.SAXParserFactory \ -classpath/resource/META-INF/services/javax.xml.parsers.DocumentBuilderFactory \ -classpath/resource/META-INF/services/javax.xml.parsers.TransformerFactory - +## Note that property_files is defined in sources.am. propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files))) $(propertyo_files): %.lo: classpath/resource/%