]> gerrit.simantics Code Review - simantics/fmil.git/commitdiff
Removed Simantics DB requirement from FMIL 80/1580/1
authorMiro Richard Eklund <miro.eklund@semantum.fi>
Thu, 15 Mar 2018 11:29:42 +0000 (13:29 +0200)
committerMiro Richard Eklund <miro.eklund@semantum.fi>
Thu, 15 Mar 2018 11:29:42 +0000 (13:29 +0200)
Change-Id: Icc124d075cbc1fcd9d0f16202b695dc2cbb00016

org.simantics.fmil.core/META-INF/MANIFEST.MF
org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java

index 29e24d24a46e90854abaf4f4dde952796a1eeddb..ba74f08f862b006d899cafbbf1ccb749177998eb 100644 (file)
@@ -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
index b2928b9474c9bfc9974cb876dbdc56fca8e32ff8..41ebf95522967d70ede8c7bc856f4e6f636ec2f7 100644 (file)
@@ -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;