Support ontology install option trueWhenDeployed also during development 81/3781/2
authorAntti Villberg <antti.villberg@semantum.fi>
Tue, 14 Jan 2020 13:38:06 +0000 (15:38 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 14 Jan 2020 21:46:58 +0000 (21:46 +0000)
gitlab #444

Change-Id: I038de840b1b76b3638338542d23baae2ba2a903f

bundles/org.simantics.project/src/org/simantics/project/management/PlatformUtil.java

index af59dbfc164bdd60a859011597bd334a7b406e49..8f93d24ab293d937467e78ca233a0056c5462abe 100644 (file)
@@ -479,7 +479,18 @@ public class PlatformUtil {
 
        private static boolean isImmutable(Bundle bundle) {
                String immutable = (String) bundle.getHeaders().get("Immutable");
-               return immutable != null ? "true".equals(immutable) : true;
+               if(immutable == null)
+                       return true;
+               if("false".equals(immutable))
+                       return false;
+               if("trueWhenDeployed".equals(immutable)) {
+                       String installHint = System.getProperty("installOntologiesAsDeployed");
+                       if("true".equals(installHint))
+                               return true;
+                       else
+                               return false;
+               }
+               return true;
        }
 
        public static class TGInfo {