From: Miro Richard Eklund Date: Thu, 15 Mar 2018 11:29:42 +0000 (+0200) Subject: Removed Simantics DB requirement from FMIL X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=9ba84c98437ab341db5db70813cb210237c2ca66;p=simantics%2Ffmil.git Removed Simantics DB requirement from FMIL Change-Id: Icc124d075cbc1fcd9d0f16202b695dc2cbb00016 --- diff --git a/org.simantics.fmil.core/META-INF/MANIFEST.MF b/org.simantics.fmil.core/META-INF/MANIFEST.MF index 29e24d2..ba74f08 100644 --- a/org.simantics.fmil.core/META-INF/MANIFEST.MF +++ b/org.simantics.fmil.core/META-INF/MANIFEST.MF @@ -7,6 +7,6 @@ Bundle-Vendor: Semantum Oy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", org.simantics.utils;bundle-version="1.1.0", - org.simantics;bundle-version="1.0.0", - org.slf4j.api + org.slf4j.api, + gnu.trove3;bundle-version="3.0.3" Export-Package: org.simantics.fmil.core diff --git a/org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java b/org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java index b2928b9..41ebf95 100644 --- a/org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java +++ b/org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -14,7 +15,6 @@ import java.util.UUID; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; -import org.simantics.Simantics; import org.simantics.fmil.core.ExecEnvironment.ARCHType; import org.simantics.fmil.core.ExecEnvironment.OSType; import org.simantics.utils.FileUtils; @@ -34,8 +34,8 @@ public class FMIL { */ private static int OK = 0; private static int ERROR = 1; - private static String UNSATISFIED_LINK = "Method not found. DLL might not be loaded properly."; - private static String TEMP_FMU_DIRECTORY_NAME = "fmil"; + private static String UNSATISFIED_LINK = "Method not found. DLL might not be loaded properly."; + public static final String TEMP_FMU_DIRECTORY_NAME = "fmil"; public static String TEMP_FMU_COMMON_DIRECTORY; public static String LOCK_FILE_NAME = "fmil.lock"; @@ -93,13 +93,15 @@ public class FMIL { } /** - * Static: initialize fmu temp folder + * Static: initialize fmu temp folder from current working directory */ static { - File dir = Simantics.getTemporaryDirectory(TEMP_FMU_DIRECTORY_NAME); - TEMP_FMU_COMMON_DIRECTORY = dir.getAbsolutePath(); + TEMP_FMU_COMMON_DIRECTORY = Paths.get(".").toAbsolutePath().normalize().toString(); + } + + public static void setTempFMUCommonDir(File dir) { + TEMP_FMU_COMMON_DIRECTORY = dir.getAbsolutePath(); } - private String fmuDir; private int id;