< prev index next >

make/gensrc/GensrcCommonLangtools.gmk

Print this page
rev 52919 : 8189861: Refactor CacheFind
Reviewed-by: sgehwolf
   1 #
   2 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  47 # Param 1 - Variable to add generated file name to
  48 # Param 2 - Name of version.properties file including packages from the src
  49 #           root.
  50 define SetupVersionProperties
  51   $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2):
  52         $(MKDIR) -p $$(@D)
  53         $(PRINTF) "jdk=$(VERSION_NUMBER)\nfull=$(VERSION_STRING)\nrelease=$(VERSION_SHORT)\n" \
  54             > $$@
  55 
  56   $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2)
  57 endef
  58 
  59 ################################################################################
  60 # Finds all properties files in the module source and creates a rule that runs
  61 # CompileProperties on them into the gensrc dir.
  62 # Param 1 - Variable to add targets to
  63 # Param 2 - Extra properties files to process
  64 define SetupCompileProperties
  65   # Lookup the properties that need to be compiled into resource bundles.
  66   PROPSOURCES := $2 \
  67       $$(shell $(FIND) $(TOPDIR)/src/$(MODULE)/share/classes -name "*.properties")
  68 
  69   # Filter out any excluded translations
  70   PROPSOURCES := $$(call FilterExcludedTranslations, $$(PROPSOURCES), .properties)
  71 
  72   # Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
  73   # to .../langtools/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
  74   # Strip away prefix and suffix, leaving for example only:
  75   # "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
  76   PROPJAVAS := $$(patsubst $(TOPDIR)/src/%, \
  77       $(SUPPORT_OUTPUTDIR)/gensrc/%, \
  78       $$(patsubst %.properties, %.java, \
  79       $$(subst /share/classes,, $$(PROPSOURCES))))
  80 
  81   # Generate the package dirs for the to be generated java files. Sort to remove
  82   # duplicates.
  83   PROPDIRS := $$(sort $$(dir $$(PROPJAVAS)))
  84 
  85   # Now generate a sequence of:
  86   # "-compile ...javac_zh_CN.properties ...javac_zh_CN.java java.util.ListResourceBundle"
  87   # suitable to be fed into the CompileProperties command.


   1 #
   2 # Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  47 # Param 1 - Variable to add generated file name to
  48 # Param 2 - Name of version.properties file including packages from the src
  49 #           root.
  50 define SetupVersionProperties
  51   $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2):
  52         $(MKDIR) -p $$(@D)
  53         $(PRINTF) "jdk=$(VERSION_NUMBER)\nfull=$(VERSION_STRING)\nrelease=$(VERSION_SHORT)\n" \
  54             > $$@
  55 
  56   $$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/$$(strip $2)
  57 endef
  58 
  59 ################################################################################
  60 # Finds all properties files in the module source and creates a rule that runs
  61 # CompileProperties on them into the gensrc dir.
  62 # Param 1 - Variable to add targets to
  63 # Param 2 - Extra properties files to process
  64 define SetupCompileProperties
  65   # Lookup the properties that need to be compiled into resource bundles.
  66   PROPSOURCES := $2 \
  67       $$(call FindFiles, $(TOPDIR)/src/$(MODULE)/share/classes, *.properties)
  68 
  69   # Filter out any excluded translations
  70   PROPSOURCES := $$(call FilterExcludedTranslations, $$(PROPSOURCES), .properties)
  71 
  72   # Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
  73   # to .../langtools/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
  74   # Strip away prefix and suffix, leaving for example only:
  75   # "<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN"
  76   PROPJAVAS := $$(patsubst $(TOPDIR)/src/%, \
  77       $(SUPPORT_OUTPUTDIR)/gensrc/%, \
  78       $$(patsubst %.properties, %.java, \
  79       $$(subst /share/classes,, $$(PROPSOURCES))))
  80 
  81   # Generate the package dirs for the to be generated java files. Sort to remove
  82   # duplicates.
  83   PROPDIRS := $$(sort $$(dir $$(PROPJAVAS)))
  84 
  85   # Now generate a sequence of:
  86   # "-compile ...javac_zh_CN.properties ...javac_zh_CN.java java.util.ListResourceBundle"
  87   # suitable to be fed into the CompileProperties command.


< prev index next >