Resources.gmk revision 0
1879N/A# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A# This code is free software; you can redistribute it and/or modify it 0N/A# under the terms of the GNU General Public License version 2 only, as 0N/A# published by the Free Software Foundation. Sun designates this 0N/A# particular file as subject to the "Classpath" exception as provided 0N/A# by Sun in the LICENSE file that accompanied this code. 0N/A# This code is distributed in the hope that it will be useful, but WITHOUT 0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A# version 2 for more details (a copy is included in the LICENSE file that 0N/A# accompanied this code). 0N/A# You should have received a copy of the GNU General Public License version 0N/A# 2 along with this work; if not, write to the Free Software Foundation, 1472N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A# CA 95054 USA or visit www.sun.com if you need additional information or 0N/A# have any questions. 1879N/A# Generic mechanism for installing properties files, resource bundles, 1879N/A# FILES_properties should be defined. 1879N/A# FILES_compiled_properties should be defined. 1879N/A# If COMPILED_PROPERTIES_SUPERCLASS is defined, ALL the FILES_properties 1879N/A# files will be compiled into java with this super class. 0N/A# You can add locales to LOCALE_SUFFIXES explicitly, or use the 0N/A# LOCALE_SET_DEFINITION variable to add some pre-defined locale lists. 0N/A# The LOCALE_SET_DEFINITION can have the value: jre, plugin, or jdk. 0N/A# Resource bundles to be installed are identified using the following variables. 0N/A# Note that only the file name of the base bundle is given; localized versions 0N/A# are added automatically. For Java files, use a format suitable for inclusion 0N/A# in the FILES_java list; dito for properties, all relative paths. 0N/A# NEW_RESOURCE_BUNDLES_JAVA - new resource bundles implemented in 0N/A# Java, not localized 0N/A# NEW_RESOURCE_BUNDLES_PROPERTIES - new resource bundles implemented as 0N/A# properties files, not localized 0N/A# RESOURCE_BUNDLES_JAVA - resource bundles implemented in 0N/A# RESOURCE_BUNDLES_PROPERTIES - new resource bundles implemented as 0N/A# properties files, localized 0N/A# The following variable is now used for most .properties files in the JDK. 0N/A# These properties files are converted into java and compiled with javac. 0N/A# The resulting .class files are usually smaller and are always faster to load. 0N/A# The relative path to the properties file becomes a relative path to a 0N/A# RESOURCE_BUNDLES_COMPILED_PROPERTIES - resource bundles implemented as 0N/A# properties files, localized 0N/A# NEW_RESOURCE_BUNDLES_COMPILED_PROPERTIES - same as above, not localized 0N/A# Other properties files to be installed are identified using the variable: 0N/A# Compile properties files into java source? 0N/A # Add all properties files to the compiled properties list (all or nothing) 0N/A# Determine the locale suffixes needed beyond the base bundle 0N/A# Java files get tacked onto the standard list of files to compile 0N/A# Add to java sources list 0N/A# Compiled properties files are translated to .java. 0N/A# The .java files are generated into GENSRCDIR. 0N/A# Add to java sources list 0N/A# Compile Properties tool 0N/A# Strip Properties tool 0N/A# Process and strip all non-compiled properties files (in a batch mode) 0N/A# To efficiently strip properties we use one run of StripProperties. 0N/A# This macro gathers an option for use later. 0N/A@
$(ECHO) "# Adding to strip properties list: $@" 0N/A# Constructs command line options file 0N/A# Strip the properties files 0N/A# Creates files in CLASSDESTDIR 0N/A# In some cases, we move files from package to resources subdir 0N/A# To efficiently compile properties into java sources we use one run 0N/A# of compileproperties. This macro gathers an option for use later. 0N/A# Note: The properties file and java source name can be different 0N/A# locales, e.g. zh_TW and zh_HK. The java source filename 0N/A# determines the name of the class. 0N/A@
$(ECHO) "# Adding to compile properties list: $? -> $@" 0N/A# Create HK java file from zh_TW (explicit resource bundles only) 0N/A$(CAT) $< |
$(SED) -e
'/class/s/_zh_TW/_zh_HK/' > $@
0N/A# Explicit resource bundles 0N/A# Compile of zh_HK properties just uses the zh_TW properties files 0N/A# Simple delivery of zh_HK properties files just copies zh_TW properties files 0N/A# List of java files converted from properties files needed 0N/A# Constructs command line options file 0N/A# Make sure all are compiled, one compiler run 0N/A# Make sure the build rule creates all the properties