8069164: Fix langtools make build so that diagnostic framework can be used
Fix race condition between gensrc targets and output location of parseproperties task Reviewed-by: erikj, jlahoda
This commit is contained in:
parent
484ca4753c
commit
09d9213488
@ -40,6 +40,7 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS_LANGTOOLS, \
|
||||
ADD_JAVAC_FLAGS := -Xprefer:source, \
|
||||
SRC := $(LANGTOOLS_TOPDIR)/make/tools, \
|
||||
INCLUDES := compileproperties propertiesparser, \
|
||||
COPY := .properties, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes))
|
||||
|
||||
all: $(BUILD_TOOLS_LANGTOOLS)
|
||||
|
@ -25,19 +25,19 @@
|
||||
|
||||
include GensrcCommon.gmk
|
||||
|
||||
$(eval $(call SetupVersionProperties,JAVAC_VERSION,\
|
||||
$(eval $(call SetupVersionProperties,JAVAC_VERSION, \
|
||||
com/sun/tools/javac/resources/version.properties))
|
||||
|
||||
$(eval $(call SetupVersionProperties,JAVAH_VERSION,\
|
||||
$(eval $(call SetupVersionProperties,JAVAH_VERSION, \
|
||||
com/sun/tools/javah/resources/version.properties))
|
||||
|
||||
$(eval $(call SetupVersionProperties,JAVAP_VERSION,\
|
||||
$(eval $(call SetupVersionProperties,JAVAP_VERSION, \
|
||||
com/sun/tools/javap/resources/version.properties))
|
||||
|
||||
$(eval $(call SetupCompileProperties,COMPILE_PROPERTIES,\
|
||||
$(eval $(call SetupCompileProperties,COMPILE_PROPERTIES, \
|
||||
$(JAVAC_VERSION) $(JAVAH_VERSION) $(JAVAP_VERSION)))
|
||||
|
||||
$(eval $(call SetupParseProperties,PARSE_PROPERTIES,\
|
||||
$(eval $(call SetupParseProperties,PARSE_PROPERTIES, \
|
||||
com/sun/tools/javac/resources/compiler.properties))
|
||||
|
||||
all: $(COMPILE_PROPERTIES) $(PARSE_PROPERTIES)
|
||||
|
@ -63,7 +63,8 @@ endef
|
||||
# Param 2 - Extra properties files to process
|
||||
define SetupCompileProperties
|
||||
# Lookup the properties that need to be compiled into resource bundles.
|
||||
PROPSOURCES := $2 $$(shell $(FIND) $(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes -name "*.properties")
|
||||
PROPSOURCES := $2 \
|
||||
$$(shell $(FIND) $(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes -name "*.properties")
|
||||
|
||||
# Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
|
||||
# to .../langtools/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
|
||||
@ -74,7 +75,7 @@ define SetupCompileProperties
|
||||
$$(patsubst %.properties, %.java, \
|
||||
$$(subst /share/classes,, $$(PROPSOURCES))))
|
||||
|
||||
# Generate the package dirs for the tobe generated java files. Sort to remove
|
||||
# Generate the package dirs for the to be generated java files. Sort to remove
|
||||
# duplicates.
|
||||
PROPDIRS := $$(sort $$(dir $$(PROPJAVAS)))
|
||||
|
||||
@ -88,8 +89,8 @@ define SetupCompileProperties
|
||||
|
||||
# Now setup the rule for the generation of the resource bundles.
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_props: $$(PROPSOURCES)
|
||||
$(FIND) $$(@D) -name "*.java" $(FIND_DELETE)
|
||||
$(MKDIR) -p $$(@D) $$(PROPDIRS)
|
||||
$(FIND) $$(@D) -name "*.java" -a ! -name "*Properties.java" $(FIND_DELETE)
|
||||
$(ECHO) Compiling $$(words $$(PROPSOURCES)) properties into resource bundles for $(MODULE)
|
||||
$(TOOL_COMPILEPROPS_CMD) $$(PROPCMDLINE)
|
||||
$(TOUCH) $$@
|
||||
@ -102,11 +103,11 @@ endef
|
||||
# Param 1 - Variable to add targets to
|
||||
# Param 2 - Extra properties files to process
|
||||
define SetupParseProperties
|
||||
#property file to generate
|
||||
PARSEPROPSOURCES := $$(foreach var,$2,$$(addsuffix $$(var),$(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes/))
|
||||
# property files to process
|
||||
PARSEPROPSOURCES := $$(addprefix $(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes/, $2)
|
||||
|
||||
PARSEPROPALLDIRS := $$(patsubst $(LANGTOOLS_TOPDIR)/src/%, \
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/%, \
|
||||
PARSEPROPALLDIRS := $$(patsubst $(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes/%, \
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/%, \
|
||||
$$(dir $$(PARSEPROPSOURCES)))
|
||||
|
||||
PARSEPROPDIRS := $$(sort $$(PARSEPROPALLDIRS))
|
||||
@ -117,8 +118,8 @@ define SetupParseProperties
|
||||
|
||||
# Now setup the rule for the generation of the resource bundles.
|
||||
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props: $(PARSEPROPSOURCES)
|
||||
$(CP) -r $(LANGTOOLS_TOPDIR)/make/tools/propertiesparser/resources $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes/propertiesparser/resources
|
||||
$(MKDIR) -p $$(@D) $$(PARSEPROPDIRS)
|
||||
$(FIND) $$(@D) -name "*Properties.java" $(FIND_DELETE)
|
||||
$(ECHO) Parsing $$(words $$(PARSEPROPSOURCES)) properties into enum-like class for $(MODULE)
|
||||
$(TOOL_PARSEPROPS_CMD) $$(PARSEPROPCMDLINE)
|
||||
$(TOUCH) $$@
|
||||
|
@ -28,6 +28,8 @@ package com.sun.tools.javac.comp;
|
||||
import com.sun.source.tree.LambdaExpressionTree.BodyKind;
|
||||
import com.sun.tools.javac.code.*;
|
||||
import com.sun.tools.javac.comp.Resolve.ResolveError;
|
||||
import com.sun.tools.javac.resources.CompilerProperties;
|
||||
import com.sun.tools.javac.resources.CompilerProperties.Fragments;
|
||||
import com.sun.tools.javac.tree.*;
|
||||
import com.sun.tools.javac.util.*;
|
||||
import com.sun.tools.javac.util.DefinedBy.Api;
|
||||
@ -796,7 +798,7 @@ public class DeferredAttr extends JCTree.Visitor {
|
||||
case WRONG_MTHS:
|
||||
//note: as argtypes are erroneous types, type-errors must
|
||||
//have been caused by arity mismatch
|
||||
checkContext.report(tree, diags.fragment("incompatible.arg.types.in.mref"));
|
||||
checkContext.report(tree, diags.fragment(Fragments.IncompatibleArgTypesInMref));
|
||||
break;
|
||||
case ABSENT_MTH:
|
||||
case STATICERR:
|
||||
|
Loading…
Reference in New Issue
Block a user