Fix Eclipse project generation

The new plugin causes Eclipse to go a bit crazy. So we skip it
for Eclipse.

Relates to #22646
This commit is contained in:
Nik Everett 2017-01-19 13:09:27 -05:00
parent 9781b88a38
commit 3ea37ec817
2 changed files with 10 additions and 2 deletions

View File

@ -57,7 +57,7 @@ class MessyTestPlugin extends StandaloneTestPlugin {
project.sourceSets.test.output.dir(outputDir, builtBy: taskName)
// add each generated dir to the test classpath in IDEs
//project.eclipse.classpath.sourceSets = [project.sourceSets.test]
project.idea.module.singleEntryLibraries= ['TEST': [project.file(outputDir)]]
// Eclipse doesn't need this because it gets the entire module as a dependency
}
}

View File

@ -29,13 +29,21 @@ import org.gradle.api.tasks.Copy
/**
* A plugin to run tests that depend on other plugins or modules.
*
* This plugin will add the plugin-metadata and properties files for each
* This plugin will add the plugin-metadata and properties files for each
* dependency to the test source set.
*/
class TestWithDependenciesPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
if (project.isEclipse) {
/* The changes this plugin makes both break and aren't needed by
* Eclipse. This is because Eclipse flattens main and test
* dependencies into a single dependency. Because Eclipse is
* "special".... */
return
}
project.configurations.testCompile.dependencies.all { Dependency dep ->
// this closure is run every time a compile dependency is added
if (dep instanceof ProjectDependency && dep.dependencyProject.plugins.hasPlugin(PluginBuildPlugin)) {