Skip to content

Commit

Permalink
Banish build-eclipse (elastic#70696)
Browse files Browse the repository at this point in the history
Move it to `out` so we can be like the cool kids.
  • Loading branch information
nik9000 authored Mar 24, 2021
1 parent ac6b45b commit 7693aea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 343 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.ipr
*.iws
build-idea/
# Eclipse and Intellij put there build files in "out"
out/

# include shared intellij config
Expand All @@ -19,6 +20,7 @@ benchmarks/src/main/generated/*
.project
.classpath
.settings
# We don't use this any more, but we'll keep it around in gitignore for a while so we don't accidentally commit it
build-eclipse/

# netbeans files
Expand Down
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,17 @@ allprojects {
}

plugins.withType(JavaBasePlugin) {
eclipse.classpath.defaultOutputDir = file('build-eclipse')
eclipse.classpath.file.whenMerged { classpath ->
// give each source folder a unique corresponding output folder
/*
* give each source folder a unique corresponding output folder
* outside of the usual `build` folder. We can't put the build
* in the usual build folder because eclipse becomes *very* sad
* if we delete it. Which `gradlew clean` does all the time.
*/
int i = 0;
classpath.entries.findAll { it instanceof SourceFolder }.each { folder ->
i++;
folder.output = "build-eclipse/" + i
folder.output = 'out/eclipse/' + i
}

// Starting with Gradle 6.7 test dependencies are not exposed by eclipse
Expand Down
Loading

0 comments on commit 7693aea

Please sign in to comment.