diff --git a/build.gradle b/build.gradle index 614ff39be29..785db7ec0c4 100644 --- a/build.gradle +++ b/build.gradle @@ -169,6 +169,15 @@ idea { vcs = 'Git' } } +// Make sure gradle idea was run before running anything in intellij (including import). +File ideaMarker = new File(projectDir, '.local-idea-is-configured') +tasks.idea.doLast { + ideaMarker.setText('', 'UTF-8') +} +if (System.getProperty('idea.active') != null && ideaMarker.exists() == false) { + throw new GradleException('You must run gradle idea from the root of elasticsearch before importing into IntelliJ') +} + // eclipse configuration allprojects {