public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch: FYI: finding resource files
@ 2006-05-18 18:55 Tom Tromey
  2006-05-18 18:57 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2006-05-18 18:55 UTC (permalink / raw)
  To: Java Patch List

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  <tromey@redhat.com>
	* 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/%

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-18 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-18 18:55 Patch: FYI: finding resource files Tom Tromey
2006-05-18 18:57 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).