Search in sources :

Example 1 with AgentMetaInfProcessor

use of com.oracle.svm.agent.ignoredconfig.AgentMetaInfProcessor in project graal by oracle.

the class NativeImageAgent method ignoreConfigFromClasspath.

private static void ignoreConfigFromClasspath(JvmtiEnv jvmti, ConfigurationSet ignoredConfigSet) {
    String classpath = Support.getSystemProperty(jvmti, "java.class.path");
    String sep = Support.getSystemProperty(jvmti, "path.separator");
    if (sep == null) {
        if (Platform.includedIn(Platform.LINUX.class) || Platform.includedIn(Platform.DARWIN.class)) {
            sep = ":";
        } else if (Platform.includedIn(Platform.WINDOWS.class)) {
            sep = "[:;]";
        } else {
            warn("Running on unknown platform. Not omitting existing config from classpath.");
            return;
        }
    }
    AgentMetaInfProcessor processor = new AgentMetaInfProcessor(ignoredConfigSet);
    for (String cpEntry : classpath.split(sep)) {
        try {
            NativeImageMetaInfWalker.walkMetaInfForCPEntry(Paths.get(cpEntry), processor);
        } catch (NativeImageMetaInfWalker.MetaInfWalkException e) {
            warn("Failed to walk the classpath entry: " + cpEntry + " Reason: " + e);
        }
    }
}
Also used : AgentMetaInfProcessor(com.oracle.svm.agent.ignoredconfig.AgentMetaInfProcessor) NativeImageMetaInfWalker(com.oracle.svm.driver.metainf.NativeImageMetaInfWalker)

Aggregations

AgentMetaInfProcessor (com.oracle.svm.agent.ignoredconfig.AgentMetaInfProcessor)1 NativeImageMetaInfWalker (com.oracle.svm.driver.metainf.NativeImageMetaInfWalker)1