Skip to content

Commit

Permalink
Fix Eclipse project generation
Browse files Browse the repository at this point in the history
The new plugin causes Eclipse to go a bit crazy. So we skip it
for Eclipse.

Relates to #22646
  • Loading branch information
nik9000 committed Jan 19, 2017
1 parent 9781b88 commit 3ea37ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 3ea37ec

Please sign in to comment.