Skip to content

Commit

Permalink
[GR-53605] Outline the check for collecting embedded resources inform…
Browse files Browse the repository at this point in the history
…ation

PullRequest: graal/18055
  • Loading branch information
petalex committed Jul 4, 2024
2 parents 08b5c19 + 367fa64 commit 247c680
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static EmbeddedResourcesInfo singleton() {
}

public void declareResourceAsRegistered(Module module, String resource, String source) {
if (!ResourcesFeature.Options.GenerateEmbeddedResourcesFile.getValue()) {
if (!ImageSingletons.lookup(ResourcesFeature.class).collectEmbeddedResourcesInfo()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package com.oracle.svm.hosted;

import static com.oracle.svm.core.jdk.Resources.RESOURCES_INTERNAL_PATH_SEPARATOR;
Expand Down Expand Up @@ -141,7 +140,7 @@
* @see NativeImageResourceFileAttributesView
*/
@AutomaticallyRegisteredFeature
public final class ResourcesFeature implements InternalFeature {
public class ResourcesFeature implements InternalFeature {

static final String MODULE_NAME_ALL_UNNAMED = "ALL-UNNAMED";

Expand Down Expand Up @@ -389,6 +388,10 @@ private static ResourcesRegistryImpl resourceRegistryImpl() {
return (ResourcesRegistryImpl) ImageSingletons.lookup(ResourcesRegistry.class);
}

protected boolean collectEmbeddedResourcesInfo() {
return Options.GenerateEmbeddedResourcesFile.getValue();
}

@Override
public void beforeAnalysis(BeforeAnalysisAccess access) {
/* load and parse resource configuration files */
Expand Down

0 comments on commit 247c680

Please sign in to comment.