X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FCompilePGraphs.java;h=adc4f47f517fd3c8150027c003cb7c0b5b1e9002;hb=c2ab38c94029486a379c79a7b38604f1c03afa44;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..adc4f47f5 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<>(); @@ -249,6 +258,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 +290,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; }