annotate make/CopyIntoClasses.gmk @ 9991:1a6c78863ead

8038876: Remove use of ServiceLoader in finding class implementing sun.java2d.cmm.CMMServiceProvider Reviewed-by: bae, mchung
author prr
date Mon, 12 May 2014 09:32:23 -0700
parents 28b9b1940ff3
children 5a9976e5f0ca
rev   line source
ohair@5221 1 #
lana@9329 2 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
ohair@5221 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@5221 4 #
ohair@5221 5 # This code is free software; you can redistribute it and/or modify it
ohair@5221 6 # under the terms of the GNU General Public License version 2 only, as
ohair@5221 7 # published by the Free Software Foundation. Oracle designates this
ohair@5221 8 # particular file as subject to the "Classpath" exception as provided
ohair@5221 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@5221 10 #
ohair@5221 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@5221 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@5221 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@5221 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@5221 15 # accompanied this code).
ohair@5221 16 #
ohair@5221 17 # You should have received a copy of the GNU General Public License version
ohair@5221 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@5221 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@5221 20 #
ohair@5221 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@5221 22 # or visit www.oracle.com if you need additional information or have any
ohair@5221 23 # questions.
ohair@5221 24 #
ohair@5221 25
ohair@5221 26 # Copy icu and _dict files used by the text break iterator
ohair@5221 27
erikj@9386 28 COPY_PATTERNS := .icu _dict .dat _options .js aliasmap .spp .wav .css \
chegar@9717 29 .png .gif .xml .dtd .txt oqlhelp.html content-types.properties
ohair@5221 30
erikj@9386 31 # These directories should not be copied at all
erikj@9386 32 EXCLUDES += \
erikj@9386 33 com/sun/org/apache/xml/internal/security/resource/schema \
erikj@9386 34 java/awt/doc-files \
erikj@9386 35 java/lang/doc-files \
erikj@9386 36 javax/swing/doc-files \
erikj@9386 37 javax/swing/text/doc-files \
erikj@9386 38 javax/swing/plaf/synth/doc-files \
erikj@9386 39 javax/swing/undo/doc-files \
erikj@9386 40 sun/awt/X11/doc-files \
erikj@9386 41 sun/util/cldr/resources \
erikj@9386 42 #
ohair@5221 43
erikj@9386 44 # These files should never be included
erikj@9386 45 EXFILES += build.xml README.txt version.txt
ohair@5221 46
erikj@9386 47 # These icons are handled in GensrcIcons.gmk
erikj@9386 48 EXFILES += \
erikj@9386 49 sun/awt/X11/java-icon16.png \
erikj@9386 50 sun/awt/X11/java-icon24.png \
erikj@9386 51 sun/awt/X11/java-icon32.png \
erikj@9386 52 sun/awt/X11/java-icon48.png \
erikj@9386 53 $(wildcard $(JDK_TOPDIR)/src/share/classes/sun/awt/resources/*.png) \
erikj@9386 54 #
erikj@5507 55
erikj@5507 56 ifndef OPENJDK
erikj@9386 57 # Theses icons have closed replacements
erikj@9386 58 SWING_PLAF_MOTIF_RESOURCES_DIR := $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif
erikj@9386 59 EXFILES += \
erikj@9386 60 $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/icons/JavaCup32.png \
erikj@9386 61 $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/basic/icons/JavaCup16.png \
erikj@9386 62 $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.gif) \
erikj@9386 63 $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.png) \
erikj@9386 64 #
erikj@9386 65
erikj@9386 66 EXFILES += mib_core.txt
erikj@5507 67 endif
erikj@5507 68
erikj@8487 69 ifeq ($(ENABLE_JFR), true)
erikj@9386 70 JFR_CONFIGURATION_DIR_CLOSED := $(JDK_TOPDIR)/src/closed/share/classes/oracle/jrockit/jfr/settings
sla@7317 71 COPY_FILES += \
ihse@8330 72 $(JFR_CONFIGURATION_DIR_CLOSED)/jfc.xsd
sla@7317 73 endif
sla@7317 74
ihse@8845 75 SWING_BEANINFO_RESOURCES_SRC_DIR = $(JDK_TOPDIR)/make/data/swingbeaninfo/images
erikj@5507 76 SWING_BEANINFO_RESOURCES_SRC = $(wildcard $(SWING_BEANINFO_RESOURCES_SRC_DIR)/*.gif)
ihse@8330 77 OUT_BEANINFO_RESOURCES = $(patsubst $(SWING_BEANINFO_RESOURCES_SRC_DIR)%, \
ihse@8330 78 $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%, \
ihse@8330 79 $(SWING_BEANINFO_RESOURCES_SRC))
erikj@5507 80
erikj@5507 81 COPY_EXTRA += $(OUT_BEANINFO_RESOURCES)
erikj@5507 82
erikj@9386 83 # The exception handling of swing beaninfo
erikj@9386 84 # These resources violates the convention of having code and resources together under
erikj@9386 85 # $(JDK_TOPDIR)/src/.../classes directories
erikj@9386 86 $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: \
erikj@9386 87 $(JDK_TOPDIR)/make/data/swingbeaninfo/images/%.gif
erikj@9386 88 $(call install-file)
erikj@5507 89
ohair@5221 90 ##########################################################################################
ohair@5221 91 #
ohair@5221 92 # Copy the META-INF/services configuration files that are scattered around the source tree
ohair@5221 93 # into classes/META-INF/services. Be aware that META-INF directories that are located at a
ohair@5221 94 # source root (.../classes/META-INF) are automatically copied verbatim by the
sla@7317 95 # SetupJavaCompilation macro.
ohair@5221 96 #
ohair@5221 97 # Any other META-INF/services configuration file is found here and platform specific comments
ohair@5221 98 # are uncommented and the configuration file is stored in the output META-INF directory.
ohair@5221 99
ohair@5221 100 # Make sure the output directory is created.
ihse@8330 101 $(eval $(call MakeDir, $(JDK_OUTPUTDIR)/classes/META-INF/services))
ohair@5221 102 # Find all META-INF/services/* files
ihse@8330 103 ALL_META-INF_DIRS_share := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
ihse@8330 104 ALL_META-INF_DIRS_targetapi := $(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF)
ohair@5221 105 # Platform specific overrides shared
ihse@8330 106 ifneq ($(ALL_META-INF_DIRS_targetapi), )
ihse@8330 107 ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_targetapi) \
ihse@8330 108 $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes%,%,$(ALL_META-INF_DIRS_targetapi)), \
ihse@8330 109 $(ALL_META-INF_DIRS_share))
ohair@5221 110 else
ihse@8330 111 ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share)
ohair@5221 112 endif
ohair@5221 113
ihse@8330 114 SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS)))
erikj@5507 115
ohair@5221 116 # The number of services files are relatively few. If the increase in numbers, then
ohair@5221 117 # we have to use ListPathsSafelyNow here.
erikj@5507 118 # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy
ohair@5221 119 # The \n in the printf command is needed to make sed work on Solaris.
ihse@8330 120 OUT_SERVICES_FILES := $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
ihse@8330 121 $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
ihse@8330 122 OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES))
ohair@5221 123 # Exception handling for print services with no META-INF directory
ohair@5819 124 SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/*)
ihse@8330 125 OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
ihse@8330 126 $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/%, %, \
ihse@8330 127 $(SRC_SERVICES_FILES_PRINT)))
ihse@8330 128 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT))
ihse@8330 129 RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT))
ohair@5221 130
ohair@5221 131 # Now setup the dependency rules to generate a META-INF/services/... from the correct source.
ihse@8330 132 META-INF_RULES_SERVICES := $(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON), $(SRC_SERVICES_FILES))
ohair@5221 133 # Eval the newly created rules to incorporate them into the make tree.
ohair@5221 134 define addto_meta-inf_services
ihse@8330 135 $1
sla@7317 136 echo $(LOG_INFO) Installing META-INF/services/$$(@F)
erikj@5596 137 $(CAT) $$< | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $$@
ohair@5221 138 endef
ihse@8330 139 $(foreach i, $(META-INF_RULES_SERVICES), $(eval $(call addto_meta-inf_services, $i)))
ohair@5221 140 # Here is the generic rule, whose receipt the above rules will trigger.
ohair@5221 141
ohair@5221 142 COPY_EXTRA += $(OUT_SERVICES_FILES)
ohair@5221 143 COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT)
erikj@5507 144
erikj@9386 145 ################################################################################
erikj@5507 146
erikj@5507 147 JAVAX_SOUND_SRC := $(JDK_TOPDIR)/src/share/classes/com/sun/media/sound/services
erikj@5507 148
erikj@5507 149 JAVAX_SOUND_SRC_FILES := \
ihse@8330 150 javax.sound.midi.spi.MidiDeviceProvider \
ihse@8330 151 javax.sound.midi.spi.MidiFileReader \
ihse@8330 152 javax.sound.midi.spi.MidiFileWriter \
ihse@8330 153 javax.sound.midi.spi.SoundbankReader \
ihse@8330 154 javax.sound.sampled.spi.AudioFileReader \
ihse@8330 155 javax.sound.sampled.spi.AudioFileWriter \
ihse@8330 156 javax.sound.sampled.spi.FormatConversionProvider \
ihse@8330 157 javax.sound.sampled.spi.MixerProvider
erikj@5507 158
ihse@8330 159 COPY_EXTRA += $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, $(JAVAX_SOUND_SRC_FILES))
erikj@5507 160
ihse@8330 161 JAVAX_SOUND_RULES := $(foreach F, $(JAVAX_SOUND_SRC_FILES), $(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F)
erikj@5507 162
ihse@8330 163 $(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R)))
erikj@9386 164
erikj@9386 165 ################################################################################
erikj@9386 166
erikj@9386 167 CLEAN_FILES := $(wildcard \
erikj@9386 168 $(JDK_TOPDIR)/src/share/classes/com/sun/imageio/plugins/common/*.properties \
erikj@9386 169 $(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/*.properties \
erikj@9386 170 $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties \
erikj@9386 171 $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/ldap/jndiprovider.properties \
erikj@9386 172 $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource/*.properties \
erikj@9386 173 $(JDK_TOPDIR)/src/share/classes/com/sun/rowset/*.properties \
erikj@9386 174 $(JDK_TOPDIR)/src/share/classes/com/sun/tools/script/shell/*.properties \
erikj@9386 175 $(JDK_TOPDIR)/src/share/classes/javax/sql/rowset/*.properties \
erikj@9386 176 $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources/*.properties \
erikj@9386 177 $(JDK_TOPDIR)/src/share/classes/sun/rmi/rmic/resources/*.properties \
erikj@9386 178 $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources/*.properties \
erikj@9386 179 $(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources/*.properties \
erikj@9386 180 $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources/*.properties \
erikj@9386 181 $(JDK_TOPDIR)/src/share/classes/sun/tools/serialver/resources/*.properties \
erikj@9386 182 )
erikj@9386 183
erikj@9386 184 # Copy zh_HK files from zh_TW
erikj@9386 185
erikj@9386 186 $(JDK_OUTPUTDIR)/classes/%_zh_HK.properties: $(JDK_OUTPUTDIR)/classes/%_zh_TW.properties
erikj@9386 187 $(install-file)
erikj@9386 188
erikj@9386 189 COPY_EXTRA += $(patsubst $(JDK_TOPDIR)/src/share/classes/%, $(JDK_OUTPUTDIR)/classes/%, \
erikj@9386 190 $(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $(CLEAN_FILES))))