Skip to content

Commit 568dcc1

Browse files
committed
8334391: JDK build should exclude *-files directories for Java source
Reviewed-by: erikj
1 parent a091e2f commit 568dcc1

File tree

8 files changed

+21
-22
lines changed

8 files changed

+21
-22
lines changed

make/CompileInterimLangtools.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,15 @@ define SetupInterimModule
9595
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
9696
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
9797
$(TOPDIR)/src/$1/share/classes, \
98-
EXCLUDES := sun javax/tools/snippet-files, \
98+
EXCLUDES := sun, \
9999
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
100100
$(TOPDIR)/src/$1/share/classes/javax/tools/ToolProvider.java \
101101
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/Main.java \
102102
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryContext.java \
103103
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryModuleFinder.java \
104104
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java \
105105
Standard.java, \
106+
EXCLUDE_PATTERNS := -files, \
106107
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java \
107108
$($1.interim_EXTRA_FILES), \
108109
COPY := .gif .png .xml .css .svg .js .js.template .txt .woff .woff2 javax.tools.JavaCompilerTool, \

make/CompileJavaModules.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
113113
DISABLED_WARNINGS := $(DISABLED_WARNINGS_java), \
114114
EXCLUDES := $(EXCLUDES), \
115115
EXCLUDE_FILES := $(EXCLUDE_FILES), \
116+
EXCLUDE_PATTERNS := -files, \
116117
KEEP_ALL_TRANSLATIONS := $(KEEP_ALL_TRANSLATIONS), \
117118
JAVAC_FLAGS := \
118119
$(DOCLINT) \

make/common/JavaCompilation.gmk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ endef
152152
# INCLUDE_FILES "com/sun/SolarisFoobar.java" means only compile this file!
153153
# EXCLUDE_FILES "com/sun/SolarisFoobar.java" means do not compile this particular file!
154154
# "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
155+
# EXCLUDE_PATTERNS Exclude files matching any of these substrings
155156
# EXTRA_FILES List of extra source files to include in compilation. Can be used to
156157
# specify files that need to be generated by other rules first.
157158
# HEADERS path to directory where all generated c-headers are written.
@@ -332,6 +333,20 @@ define SetupJavaCompilationBody
332333
$1_INCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, $$(addsuffix /%, $$($1_INCLUDES))))
333334
endif
334335

336+
ifneq ($$($1_EXCLUDE_PATTERNS), )
337+
# We must not match the exclude pattern against the src roots, so first
338+
# strip the src prefixes from the absolute file paths in SRCS.
339+
$1_SRCS_WITHOUT_ROOTS := $$(foreach i, $$($1_SRC), \
340+
$$(patsubst $$i/%,%, $$(filter $$i/%, $$($1_SRCS))))
341+
$1_EXCLUDE_PATTERNS_WITHOUT_ROOTS := $$(call containing, \
342+
$$($1_EXCLUDE_PATTERNS), $$($1_SRCS_WITHOUT_ROOTS))
343+
# The add back all possible src prefixes; this will generate more paths
344+
# than really exists, but it does not matter since we will use this as
345+
# input to filter-out.
346+
$1_EXCLUDE_PATTERN += $$(foreach i, $$($1_SRC), $$(addprefix $$i/, \
347+
$$($1_EXCLUDE_PATTERNS_WITHOUT_ROOTS)))
348+
endif
349+
335350
# Apply include/exclude patterns to java sources
336351
ifneq ($$($1_EXCLUDE_PATTERN), )
337352
$1_SRCS := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_SRCS))

make/common/native/Paths.gmk

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,9 @@ define SetupSourceFiles
128128
# Extract the C/C++ files.
129129
ifneq ($$($1_EXCLUDE_PATTERNS), )
130130
# We must not match the exclude pattern against the src root(s).
131-
$1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
132-
$$(foreach i, $$($1_SRC), $$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
133-
$$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
134-
$1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
131+
$1_SRCS_WITHOUT_ROOTS := $$(foreach i, $$($1_SRC), \
132+
$$(patsubst $$i/%,%, $$(filter $$i/%, $$($1_SRCS))))
133+
$1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
135134
$$($1_SRCS_WITHOUT_ROOTS))
136135
endif
137136
ifneq ($$($1_EXCLUDE_FILES), )

make/modules/java.base/Java.gmk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ CLEAN += intrinsic.properties
4141
EXCLUDE_FILES += \
4242
$(TOPDIR)/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java
4343

44-
EXCLUDES += java/lang/doc-files \
45-
java/lang/classfile/snippet-files \
46-
java/lang/classfile/components/snippet-files \
47-
java/lang/foreign/snippet-files
48-
4944
# Exclude BreakIterator classes that are just used in compile process to generate
5045
# data files and shouldn't go in the product
5146
EXCLUDE_FILES += sun/text/resources/BreakIteratorRules.java

make/modules/java.compiler/Java.gmk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,4 @@
3232
DOCLINT += -Xdoclint:all/protected \
3333
'-Xdoclint/package:java.*,javax.*'
3434

35-
EXCLUDES += javax/tools/snippet-files
36-
3735
################################################################################

make/modules/java.desktop/Java.gmk

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ DOCLINT += -Xdoclint:all/protected \
3131
COPY += .gif .png .wav .txt .xml .css .pf
3232
CLEAN += iio-plugin.properties cursors.properties
3333

34-
EXCLUDES += \
35-
java/awt/doc-files \
36-
javax/swing/doc-files \
37-
javax/swing/text/doc-files \
38-
javax/swing/plaf/synth/doc-files \
39-
javax/swing/undo/doc-files \
40-
sun/awt/X11/doc-files \
41-
#
42-
4334
EXCLUDE_FILES += \
4435
javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
4536
javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \

make/modules/jdk.jdi/Java.gmk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ EXCLUDES += \
3131
com/sun/tools/example/debug/bdi \
3232
com/sun/tools/example/debug/event \
3333
com/sun/tools/example/debug/gui \
34-
com/sun/jdi/doc-files \
3534
#
3635

3736
EXCLUDE_FILES += jdi-overview.html

0 commit comments

Comments
 (0)