ApplicationImpl.isRunningFromSources() to determine if IDE is running from sources... clion/144.2303
authorAnton Makeev <Anton.Makeev@jetbrains.com>
Fri, 18 Dec 2015 17:35:11 +0000 (18:35 +0100)
committerAnton Makeev <Anton.Makeev@jetbrains.com>
Fri, 18 Dec 2015 17:38:35 +0000 (18:38 +0100)
platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java

index e2c19e6b3afb349a03c13e66fbbee972f81a7976..6eaf3dd4f3c0c51def72f90c467783a9587cedc1 100644 (file)
@@ -103,6 +103,7 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
   private final boolean myTestModeFlag;
   private final boolean myHeadlessMode;
   private final boolean myCommandLineMode;
+  private final boolean myIsRunningFromSources;
 
   private final boolean myIsInternal;
   private final String myName;
@@ -195,6 +196,8 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
     myTestModeFlag = isUnitTestMode;
     myHeadlessMode = isHeadless;
     myCommandLineMode = isCommandLine;
+    
+    myIsRunningFromSources = new File(PathManager.getHomePath(), ".idea").isDirectory();
 
     myDoNotSave = isUnitTestMode || isHeadless;
 
@@ -354,6 +357,10 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
     return myCommandLineMode;
   }
 
+  public boolean isRunningFromSources() {
+    return myIsRunningFromSources;
+  }
+
   @NotNull
   @Override
   public Future<?> executeOnPooledThread(@NotNull final Runnable action) {