package org.simantics.graph.compiler.tests; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.simantics.graph.compiler.ExternalFileLoader; import org.simantics.graph.compiler.GraphCompiler; import org.simantics.graph.compiler.GraphCompilerPreferences; import org.simantics.graph.compiler.internal.ltk.FileSource; import org.simantics.graph.compiler.internal.ltk.ISource; import org.simantics.graph.representation.TransferableGraph1; public class TestCompiler { public static void main(String[] args) throws Exception { Collection sources = new ArrayList(); File dir = new File("d:/apros6/org.simantics.layer0/graph"); for(File f : dir.listFiles()) if(f.getName().endsWith(".pgraph")) sources.add(new FileSource(f)); GraphCompiler.compile("1.0", sources, Collections.emptyList(), new ExternalFileLoader() { @Override public byte[] load(String fileName) throws IOException { throw new FileNotFoundException(); } }, new GraphCompilerPreferences()); } }