How to add options to the javac build in the JDK 8 repo?

Joe Darcy joe.darcy at oracle.com
Tue Aug 13 21:31:13 UTC 2013


A follow-up, the build incantation to embed a comma seems to be 
"(COMMA)". Therefore, I will upgrade this to a code review request:

diff -r a4b0be7341ef makefiles/CompileJavaClasses.gmk
--- a/makefiles/CompileJavaClasses.gmk    Tue Aug 13 19:10:54 2013 +0100
+++ b/makefiles/CompileJavaClasses.gmk    Tue Aug 13 14:24:21 2013 -0700
@@ -291,6 +291,7 @@

  $(eval $(call SetupJavaCompilation,BUILD_JDK,\
                  SETUP:=GENERATE_JDKBYTECODE,\
+ 
FLAGS:=-Xlint:-unchecked(COMMA)-deprecation(COMMA)auxiliaryclass(COMMA)classfile(COMMA)divzero(COMMA)empty(COMMA)fallthrough(COMMA)finally(COMMA)try(COMMA)varargs 
-Werror,\
          SRC:=$(JDK_TOPDIR)/src/share/classes \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
               $(MACOSX_SRC_DIRS) \

Thanks,

-Joe


On 08/13/2013 11:09 AM, Joe Darcy wrote:
> Hello build gurus,
>
> In in effort to have javac help us maintain good code quality in the 
> jdk 8 repo, I'd like to turn on selected lint warnings and make them 
> errors. In particular, the set of javac options I want to try out is
>
> -Xlint:-unchecked,-deprecation,auxiliaryclass,classfile,divzero,empty,fallthrough,finally,try,varargs 
> -Werror
>
> That is, treat as an error any of the auxiliaryclass,classfile, ... 
> lint categories. The jdk repo's code should already be clean on these 
> categories and I'd like to get it clean on other categories before JDK 
> 8 ships.
>
> In any case, how does one get these javac options added to the build? 
> I've tried
>
> --- a/makefiles/CompileJavaClasses.gmk    Tue Aug 13 10:12:03 2013 -0700
> +++ b/makefiles/CompileJavaClasses.gmk    Tue Aug 13 11:07:01 2013 -0700
> @@ -291,6 +291,7 @@
>
>  $(eval $(call SetupJavaCompilation,BUILD_JDK,\
>                  SETUP:=GENERATE_JDKBYTECODE,\
> + 
> FLAGS:=-Xlint:-unchecked,-deprecation,auxiliaryclass,classfile,divzero,empty,fallthrough,finally,try,varargs 
> -Werror,\
>          SRC:=$(JDK_TOPDIR)/src/share/classes \
> $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes \
>               $(MACOSX_SRC_DIRS) \
>
> (as well as trying ADD_JAVAC_FLAGS instead of FLAGS), but get an error 
> like
>
> CompileJavaClasses.gmk:292: *** Internal makefile error: Too many 
> arguments to SetupJavaCompilation, please update JavaCompilation.gmk.  
> Stop.
>
> Thanks,
>
> -Joe




More information about the build-dev mailing list