From cc2ba19b7cd863e975ea2b12c27d84a359250fc1 Mon Sep 17 00:00:00 2001 From: Ben Liblit Date: Wed, 25 Jul 2018 16:57:28 -0500 Subject: [PATCH] Categorize Eclipse sources as main vs. test This leverages new Eclipse 4.8 (Photon) features that distinguish main code from test code: . An eventual fix to might mean that Buildship starts doing this automatically, but for now we can do it ourselves. If using an older Eclipse release, this change does nothing useful, but neither does it cause any harm. --- build.gradle | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build.gradle b/build.gradle index ddd540066..131707f73 100644 --- a/build.gradle +++ b/build.gradle @@ -164,3 +164,21 @@ allprojects { options.addStringOption('Xdoclint:none', '-quiet') } } + + +//////////////////////////////////////////////////////////////////////// +// +// Eclipse IDE integration +// + +// workaround for +allprojects { + apply plugin: 'eclipse' + + eclipse.classpath.file.whenMerged { + entries.each { + if (it in org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry && it.entryAttributes['gradle_used_by_scope'] == 'test') + it.entryAttributes['test'] = true + } + } +}