1 package org.simantics.graph.compiler.tests;
\r
4 import java.io.FileNotFoundException;
\r
5 import java.io.IOException;
\r
6 import java.util.ArrayList;
\r
7 import java.util.Collection;
\r
8 import java.util.Collections;
\r
10 import org.simantics.graph.compiler.ExternalFileLoader;
\r
11 import org.simantics.graph.compiler.GraphCompiler;
\r
12 import org.simantics.graph.compiler.GraphCompilerPreferences;
\r
13 import org.simantics.graph.representation.TransferableGraph1;
\r
14 import org.simantics.ltk.FileSource;
\r
15 import org.simantics.ltk.ISource;
\r
17 public class TestCompiler {
\r
19 public static void main(String[] args) throws Exception {
\r
20 Collection<ISource> sources = new ArrayList<ISource>();
\r
21 File dir = new File("d:/apros6/org.simantics.layer0/graph");
\r
22 for(File f : dir.listFiles())
\r
23 if(f.getName().endsWith(".pgraph"))
\r
24 sources.add(new FileSource(f));
\r
25 GraphCompiler.compile("1.0", sources,
\r
26 Collections.<TransferableGraph1>emptyList(),
\r
27 new ExternalFileLoader() {
\r
29 public byte[] load(String fileName) throws IOException {
\r
30 throw new FileNotFoundException();
\r
33 new GraphCompilerPreferences());
\r