X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FCompilePGraphs.java;h=7781fbeffdbe9d90cafd4b8e01346f27984c1f31;hb=refs%2Fchanges%2F86%2F1386%2F2;hp=10e23c65bbd72340277652d8c9618ab4f7032147;hpb=06ee0c4c71cd9e372969da1570e7fcac2c4397a5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/CompilePGraphs.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/CompilePGraphs.java index 10e23c65b..7781fbeff 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/CompilePGraphs.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/CompilePGraphs.java @@ -16,6 +16,8 @@ import java.util.Map; import java.util.Set; import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; import org.osgi.framework.Bundle; import org.simantics.Simantics; import org.simantics.databoard.Bindings; @@ -64,12 +66,15 @@ import org.simantics.ltk.Problem; import org.simantics.modeling.internal.Activator; import org.simantics.utils.FileUtils; import org.simantics.utils.datastructures.Pair; +import org.slf4j.LoggerFactory; /** * @author Antti Villberg */ public class CompilePGraphs { + private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(CompilePGraphs.class); + public static interface UserAgent { void reportProblems(CompilationResult result); } @@ -86,6 +91,10 @@ public class CompilePGraphs { } public static void compilePGraphs(Resource r, UserAgent userAgent) throws IOException, DatabaseException { + compilePGraphs(r, userAgent, new NullProgressMonitor()); + } + + public static void compilePGraphs(Resource r, UserAgent userAgent, IProgressMonitor monitor) throws IOException, DatabaseException { final Collection sources = new ArrayList<>(); Collection dependencies = new ArrayList<>(); @@ -143,6 +152,8 @@ public class CompilePGraphs { if (name == null) name = id; if (name.equals(thisOntology.first)) continue; + if (name.contains("ModelBroker")) + continue; URL tg = b.getEntry("/graph.tg"); if (tg == null) continue; File f = url2file(FileLocator.resolve(tg), b.getSymbolicName()); @@ -249,6 +260,9 @@ public class CompilePGraphs { } }); } + + // Delete index to get rid of floating old instances of the same ontology +// DatabaseIndexing.deleteAllIndexes(); } private static File extractLib(URL libURL, String libName) throws FileNotFoundException, IOException { @@ -278,7 +292,7 @@ public class CompilePGraphs { Logger.defaultLogError(e); } } else { - System.err.println("Unsupported URL protocol '" + url + "' for FastLZ native library file '" + fileName); + LOGGER.warn("Unsupported URL protocol"); } return null; }