8157511: JDK-8157348 broke gensrc of module infos with extra provides
authorerikj
Mon, 23 May 2016 11:21:50 +0200
changeset 37981 e0375f6012c1
parent 37980 b2d5f366a9ba
child 37982 cd251f56161f
8157511: JDK-8157348 broke gensrc of module infos with extra provides Reviewed-by: mchung
make/GensrcModuleInfo.gmk
--- a/make/GensrcModuleInfo.gmk	Sat May 21 18:23:28 2016 +0200
+++ b/make/GensrcModuleInfo.gmk	Mon May 23 11:21:50 2016 +0200
@@ -102,13 +102,23 @@
   $(foreach line, $(MODIFICATIONS), \
     $(eval split_line := $(subst /,$(SPACE),$(line))) \
     $(eval command := $(word 1, $(split_line))) \
-    $(eval package := $(patsubst %;,%,$(word 2, $(split_line)))) \
-    $(if $(call PackageExists, $(package)), \
-      $(eval to_module := $(patsubst %;,%,$(word 4, $(split_line)))) \
-      $(if $(to_module), \
-        $(eval ARGS += -$(command) $(package)/$(to_module)) \
+    $(if $(filter $(command), exports), \
+      $(eval package := $(patsubst %;,%,$(word 2, $(split_line)))) \
+      $(if $(call PackageExists, $(package)), \
+        $(eval to_module := $(patsubst %;,%,$(word 4, $(split_line)))) \
+        $(if $(to_module), \
+          $(eval ARGS += -$(command) $(package)/$(to_module)) \
+        , \
+          $(eval ARGS += -$(command) $(package)) \
+        ) \
+      ) \
+    , \
+      $(if $(filter $(command), provides), \
+        $(eval provider := $(patsubst %;,%,$(word 2, $(split_line)))) \
+        $(eval class := $(patsubst %;,%,$(word 4, $(split_line)))) \
+        $(eval ARGS += -$(command) $(provider)/$(class)) \
       , \
-        $(eval ARGS += -$(command) $(package)) \
+        $(error A module-info.extra in $(MODULE) contains invalid command $(command)) \
       ) \
     ) \
   )