diff --git a/build.gradle b/build.gradle index 559bf2f9c28..38be8951a45 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,5 @@ -if (project.name != 'x-plugins') { - throw new GradleException('You must checkout x-plugins to a directory named x-plugins') -} -if (project.projectDir.parentFile.name != 'extra-plugins') { - throw new GradleException('You must place the x-plugins checkout in a directory named extra-plugins') -} -if (project.rootProject.projectDir != project.projectDir.parentFile.parentFile) { - throw new GradleException('You must place the extra-plugins directory inside the root of an elasticsearch checkout') +if (project.projectDir.name != 'x-plugins') { + throw new GradleException('You must checkout x-plugins in a directory named x-plugins next to elasticsearch') } /* diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle new file mode 100644 index 00000000000..fede2f180e7 --- /dev/null +++ b/buildSrc/settings.gradle @@ -0,0 +1,6 @@ +File elasticsearchDir = new File(settingsDir, '../../elasticsearch') +if (elasticsearchDir.exists() == false) { + throw new GradleException('Elasticsearch must be checked out as a sibling directory of x-plugins') +} + +project(':').projectDir = new File(elasticsearchDir, 'buildSrc') diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000000..651d9aca508 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +project(':').projectDir = new File('../elasticsearch') +apply from: '../elasticsearch/settings.gradle'