make/common/SetupJavaCompilers.gmk
branchihse-errorprone-branch
changeset 56846 1186bac4e290
parent 50892 a5557f24b4d4
child 57056 85a97ef23187
equal deleted inserted replaced
56844:16c07e1567e7 56846:1186bac4e290
    65     FLAGS := $(BOOT_JDK_SOURCETARGET) -XDignore.symbol.file=true -XDstringConcat=inline \
    65     FLAGS := $(BOOT_JDK_SOURCETARGET) -XDignore.symbol.file=true -XDstringConcat=inline \
    66         $(DISABLE_WARNINGS) -Xlint:-options, \
    66         $(DISABLE_WARNINGS) -Xlint:-options, \
    67     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
    67     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
    68     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
    68     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
    69 
    69 
       
    70 ifneq ($(ERRORPRONE_JAR), )
       
    71   # Extra flags needed to run bootstrap javac with the errorprone static code
       
    72   # analysis tool as -Xplugin.
       
    73 
       
    74   ERRORPRONE_JAVA_FLAGS := \
       
    75           --add-exports jdk.compiler.interim/com.sun.tools.javac.api=ALL-UNNAMED \
       
    76           --add-exports jdk.compiler.interim/com.sun.tools.javac.util=ALL-UNNAMED \
       
    77           --add-exports jdk.compiler.interim/com.sun.tools.javac.tree=ALL-UNNAMED \
       
    78           --add-exports jdk.compiler.interim/com.sun.tools.javac.main=ALL-UNNAMED \
       
    79           --add-exports jdk.compiler.interim/com.sun.tools.javac.code=ALL-UNNAMED \
       
    80           --add-exports jdk.compiler.interim/com.sun.tools.javac.processing=ALL-UNNAMED \
       
    81           --add-exports jdk.compiler.interim/com.sun.tools.javac.parser=ALL-UNNAMED \
       
    82           --add-exports jdk.compiler.interim/com.sun.tools.javac.comp=ALL-UNNAMED \
       
    83           --add-opens=jdk.compiler.interim/com.sun.tools.javac.comp=ALL-UNNAMED \
       
    84           #
       
    85 
       
    86   ERRORPRONE_JAVAC_FLAGS := \
       
    87           '-Xplugin:ErrorProne -XepDisableAllChecks -Xep:CollectionIncompatibleType:ERROR' \
       
    88           -XDcompilePolicy=byfile \
       
    89           #
       
    90 endif
       
    91 
    70 # The generate new bytecode javac setup uses the new compiler to compile for the
    92 # The generate new bytecode javac setup uses the new compiler to compile for the
    71 # new jdk. This new bytecode might only be possible to run using the new jvm.
    93 # new jdk. This new bytecode might only be possible to run using the new jvm.
    72 $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
    94 $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
    73     JVM := $(JAVA_JAVAC), \
    95     JVM := $(JAVA_JAVAC) $(ERRORPRONE_JAVA_FLAGS), \
    74     JAVAC := $(NEW_JAVAC), \
    96     JAVAC := $(NEW_JAVAC), \
    75     FLAGS := -source 12 -target 12 --doclint-format html5 \
    97     FLAGS := -source 12 -target 12 --doclint-format html5 \
    76         -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \
    98         -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS) \
       
    99         $(ERRORPRONE_JAVAC_FLAGS), \
       
   100     PROCESSORPATH := $(ERRORPRONE_JAR), \
    77     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
   101     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
    78     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
   102     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
    79 
   103 
    80 # The generate new bytecode javac setup uses the new compiler to compile for the
   104 # The generate new bytecode javac setup uses the new compiler to compile for the
    81 # new jdk. This new bytecode might only be possible to run using the new jvm.
   105 # new jdk. This new bytecode might only be possible to run using the new jvm.