From 5c30446bd0ac60ffcc3a51408aebb74be024dab7 Mon Sep 17 00:00:00 2001 From: Albert Zaharovits Date: Tue, 19 Feb 2019 02:17:05 +0200 Subject: [PATCH] Fix libs:ssl-config project setup (#39074) The build script file for the `:libs:elasticsearch-ssl-config` and `:libs:ssl-config-tests` projects was incorrectly named `eclipse.build.gradle` while the expected name was `eclipse-build.gradle`. In addition, this also adds a missing snippet in the `build.gradle` conf file, that fixes the project setup for Eclipse users. --- libs/ssl-config/build.gradle | 14 ++++++++++++++ .../{eclipse.build.gradle => eclipse-build.gradle} | 2 +- .../{eclipse.build.gradle => eclipse-build.gradle} | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) rename libs/ssl-config/src/main/{eclipse.build.gradle => eclipse-build.gradle} (72%) rename libs/ssl-config/src/test/{eclipse.build.gradle => eclipse-build.gradle} (81%) diff --git a/libs/ssl-config/build.gradle b/libs/ssl-config/build.gradle index 0b8eac5486c..85693780a8b 100644 --- a/libs/ssl-config/build.gradle +++ b/libs/ssl-config/build.gradle @@ -34,9 +34,23 @@ dependencies { testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}" } +if (isEclipse) { + // in eclipse the project is under a fake root, we need to change around the source sets + sourceSets { + if (project.path == ":libs:ssl-config") { + main.java.srcDirs = ['java'] + main.resources.srcDirs = ['resources'] + } else { + test.java.srcDirs = ['java'] + test.resources.srcDirs = ['resources'] + } + } +} + forbiddenApisMain { replaceSignatureFiles 'jdk-signatures' } + forbiddenPatterns { exclude '**/*.key' exclude '**/*.pem' diff --git a/libs/ssl-config/src/main/eclipse.build.gradle b/libs/ssl-config/src/main/eclipse-build.gradle similarity index 72% rename from libs/ssl-config/src/main/eclipse.build.gradle rename to libs/ssl-config/src/main/eclipse-build.gradle index 58b2d707712..be8b9d5b3b0 100644 --- a/libs/ssl-config/src/main/eclipse.build.gradle +++ b/libs/ssl-config/src/main/eclipse-build.gradle @@ -1,2 +1,2 @@ -// this is just shell gradle file for eclipse to have separate projects for geo src and tests +// this is just shell gradle file for eclipse to have separate projects for ssl-config src and tests apply from: '../../build.gradle' diff --git a/libs/ssl-config/src/test/eclipse.build.gradle b/libs/ssl-config/src/test/eclipse-build.gradle similarity index 81% rename from libs/ssl-config/src/test/eclipse.build.gradle rename to libs/ssl-config/src/test/eclipse-build.gradle index f8265e3dfed..aca207a09b7 100644 --- a/libs/ssl-config/src/test/eclipse.build.gradle +++ b/libs/ssl-config/src/test/eclipse-build.gradle @@ -1,5 +1,5 @@ -// this is just shell gradle file for eclipse to have separate projects for geo src and tests +// this is just shell gradle file for eclipse to have separate projects for ssl-config src and tests apply from: '../../build.gradle' dependencies { testCompile project(':libs:elasticsearch-ssl-config') -} +}