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