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