Search in sources :

Example 1 with ConfigurationFile

use of com.oracle.svm.core.configure.ConfigurationFile in project graal by oracle.

the class ConfigurationWithOriginsResultWriter method writeToDirectory.

@Override
public List<Path> writeToDirectory(Path directoryPath) throws IOException {
    List<Path> writtenPaths = new ArrayList<>();
    for (ConfigurationFile configFile : ConfigurationFile.values()) {
        if (configFile.canBeGeneratedByAgent()) {
            Path filePath = directoryPath.resolve(configFile.getFileName(CONFIG_WITH_ORIGINS_FILE_SUFFIX));
            try (JsonWriter writer = new JsonWriter(filePath)) {
                rootNode.writeJson(writer, configFile);
            }
            writtenPaths.add(filePath);
        }
    }
    return writtenPaths;
}
Also used : Path(java.nio.file.Path) ArrayList(java.util.ArrayList) ConfigurationFile(com.oracle.svm.core.configure.ConfigurationFile) JsonWriter(com.oracle.svm.configure.json.JsonWriter)

Example 2 with ConfigurationFile

use of com.oracle.svm.core.configure.ConfigurationFile in project graal by oracle.

the class ConfigurationResultWriter method writeToDirectory.

@Override
public List<Path> writeToDirectory(Path directoryPath) throws IOException {
    List<Path> writtenPaths = new ArrayList<>();
    for (ConfigurationFile configFile : ConfigurationFile.values()) {
        if (configFile.canBeGeneratedByAgent()) {
            Path filePath = directoryPath.resolve(configFile.getFileName());
            try (JsonWriter writer = new JsonWriter(filePath)) {
                processor.getConfiguration(configFile).printJson(writer);
                /* Add an extra EOF newline */
                writer.newline();
            }
            writtenPaths.add(filePath);
        }
    }
    return writtenPaths;
}
Also used : Path(java.nio.file.Path) ArrayList(java.util.ArrayList) ConfigurationFile(com.oracle.svm.core.configure.ConfigurationFile) JsonWriter(com.oracle.svm.configure.json.JsonWriter)

Aggregations

JsonWriter (com.oracle.svm.configure.json.JsonWriter)2 ConfigurationFile (com.oracle.svm.core.configure.ConfigurationFile)2 Path (java.nio.file.Path)2 ArrayList (java.util.ArrayList)2