]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.graph.compiler/tests/org/simantics/graph/compiler/tests/TestCompiler.java
0abbbb495e3f385498ceaaffb140156241733cb3
[simantics/platform.git] / bundles / org.simantics.graph.compiler / tests / org / simantics / graph / compiler / tests / TestCompiler.java
1 package org.simantics.graph.compiler.tests;
2
3 import java.io.File;
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;
9
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;
16
17 public class TestCompiler {
18
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() {                                      
28                                         @Override
29                                         public byte[] load(String fileName) throws IOException {
30                                                 throw new FileNotFoundException();
31                                         }
32                                 },
33                                 new GraphCompilerPreferences());
34         }
35         
36 }