diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java index 727702534b3b..c2d361b220ee 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationParser.java @@ -69,6 +69,7 @@ public static InputStream openStream(URI uri) throws IOException { public static final String NAME_KEY = "name"; public static final String TYPE_KEY = "type"; public static final String MODULE_KEY = "module"; + public static final String GLOB_KEY = "module"; private final Map> seenUnknownAttributesByType = new HashMap<>(); private final boolean strictSchema; diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourceConfigurationParser.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourceConfigurationParser.java index 4ce18cd6345c..7e261b60fc5a 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourceConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourceConfigurationParser.java @@ -172,18 +172,18 @@ private void parsePatternEntry(Object data, BiConsumer resourceRegist } private void parseGlobEntry(Object data, GlobPatternConsumer resourceRegistry) { - EconomicMap glob = asMap(data, "Elements of 'globs' list must be a glob descriptor objects"); - checkAttributes(glob, "resource and resource bundle descriptor object", Collections.singletonList("glob"), List.of(CONDITIONAL_KEY, MODULE_KEY)); - TypeResult resolvedConfigurationCondition = conditionResolver.resolveCondition(parseCondition(glob)); + EconomicMap globObject = asMap(data, "Elements of 'globs' list must be a glob descriptor objects"); + checkAttributes(globObject, "resource and resource bundle descriptor object", Collections.singletonList(GLOB_KEY), List.of(CONDITIONAL_KEY, MODULE_KEY)); + TypeResult resolvedConfigurationCondition = conditionResolver.resolveCondition(parseCondition(globObject)); if (!resolvedConfigurationCondition.isPresent()) { return; } - Object moduleObject = glob.get(MODULE_KEY); + Object moduleObject = globObject.get(MODULE_KEY); String module = moduleObject == null ? "" : asString(moduleObject); - Object valueObject = glob.get("glob"); - String value = asString(valueObject, "glob"); + Object valueObject = globObject.get(GLOB_KEY); + String value = asString(valueObject, GLOB_KEY); resourceRegistry.accept(resolvedConfigurationCondition.get(), module, value); } } diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java index c86c07aa22fe..4ed83f7ac643 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ResourcesFeature.java @@ -25,6 +25,7 @@ package com.oracle.svm.hosted; +import static com.oracle.svm.core.configure.ConfigurationFiles.Options.TreatAllReachableConditionsAsReached; import static com.oracle.svm.core.jdk.Resources.RESOURCES_INTERNAL_PATH_SEPARATOR; import java.io.IOException; @@ -534,7 +535,6 @@ public List isIncluded(Module module, String resourceNam } private List getConditionsFromGlobTrie(Module module, String resourceName) { - // TODO append / if it is a directory String pattern = GlobUtils.transformToTriePath(resourceName, module == null ? "" : module.getName()); List types = CompressedGlobTrie.getAdditionalContentIfMatched(ImageSingletons.lookup(GlobTrieNode.class), pattern); if (types == null) { @@ -542,7 +542,7 @@ private List getConditionsFromGlobTrie(Module module, St } return types.stream() - .map(UnresolvedConfigurationCondition::create) + .map(type -> UnresolvedConfigurationCondition.create(type, TreatAllReachableConditionsAsReached.getValue())) .map(conditionResolver::resolveCondition) .map(TypeResult::get) .toList();