Class IdeDetection

java.lang.Object
net.neoforged.moddevgradle.internal.utils.IdeDetection

public final class IdeDetection extends Object
Utilities for trying to detect in which IDE Gradle is running.
  • Method Details

    • isIntelliJ

      public static boolean isIntelliJ()
      Returns:
      true if IntelliJ is running Gradle. This is true both during sync and execution of other Gradle tasks.
    • isIntelliJSync

      public static boolean isIntelliJSync()
      Returns:
      true if IntelliJ is syncing its project model with Gradle.
    • isEclipse

      public static boolean isEclipse()
      Returns:
      true if running under Eclipse (either Task execution or otherwise)
    • getIntellijProjectDir

      @Nullable public static @Nullable File getIntellijProjectDir(org.gradle.api.Project project)
      Try to find the IntelliJ project directory that belongs to this Gradle project. There are scenarios where this is impossible, since IntelliJ allows adding Gradle builds to IntelliJ projects in a completely different directory.