-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Remove eclipse conditionals #44075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove eclipse conditionals #44075
Changes from 1 commit
1c4c5d0
780a0e1
daabd36
a42e03a
35c740e
cf35084
ae67138
2780333
ede9768
86c6894
253c681
dd30235
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -357,6 +357,41 @@ allprojects { | |
// this is *NOT* a path or a file. | ||
folder.output = "build-eclipse/" + i | ||
} | ||
|
||
// Eclipse now supports main and test source sets, but the Gradle and buildship tooling does not yet so we | ||
// edit the generated .classpath to correctly mark test vs non test code and dependencies | ||
// for more info: https://github.com/eclipse/buildship/issues/689 and https://github.com/gradle/gradle/issues/4802 | ||
Set<String> testOnlyProjectDependencies = new HashSet(); | ||
if (configurations.findByName("testCompile") != null) { | ||
testOnlyProjectDependencies.addAll( | ||
configurations.testCompile.getDependencies().findAll { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should use |
||
it instanceof ProjectDependency | ||
}.collect { | ||
it.dependencyProject.path | ||
} | ||
) | ||
} | ||
if (configurations.findByName("compile") != null) { | ||
testOnlyProjectDependencies.removeAll( | ||
configurations.compile.getDependencies().findAll { | ||
it instanceof ProjectDependency | ||
}.collect { | ||
it.dependencyProject.path | ||
} | ||
) | ||
} | ||
classpath.entries.each { | ||
if (it.hasProperty("entryAttributes")) { | ||
if (it.entryAttributes.containsKey("gradle_used_by_scope")) { | ||
it.entryAttributes['test'] = (it.entryAttributes['gradle_used_by_scope'] == 'test') | ||
} | ||
if (it.hasProperty("path") && it.path.startsWith("/:")) { | ||
if (testOnlyProjectDependencies.contains(it.path.substring(1))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we ditch the extra nested |
||
it.entryAttributes['test'] = true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
@@ -528,4 +563,4 @@ allprojects { | |
checkPart1.dependsOn check | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was mistakenly checked in. |
||
<projectDescription> | ||
<name>:libs:elasticsearch-core</name> | ||
<comment>Elasticsearch subproject :libs:elasticsearch-core</comment> | ||
<projects/> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments/> | ||
</buildCommand> | ||
</buildSpec> | ||
<linkedResources/> | ||
<filteredResources/> | ||
</projectDescription> |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be using
testCompileClasspath
instead oftestCompile
since the later is deprecated.