Skip to content

Commit 72399f0

Browse files
committed
Build: Fix detection of Eclipse Compiler Server (#31838)
It looks like Eclipse's compiler server recently changed something so our "eclipse detector" stopped working for it. I've updated the detector so it ought to work now.
1 parent 1a01724 commit 72399f0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ Map<String, String> buildMetadataMap = buildMetadataValue.tokenize(';').collectE
115115
allprojects {
116116
project.ext {
117117
// for ide hacks...
118-
isEclipse = System.getProperty("eclipse.launcher") != null || gradle.startParameter.taskNames.contains('eclipse') || gradle.startParameter.taskNames.contains('cleanEclipse')
118+
isEclipse = System.getProperty("eclipse.launcher") != null || // Detects gradle launched from Eclipse's IDE
119+
System.getProperty("eclipse.application") != null || // Detects gradle launched from the Eclipse compiler server
120+
gradle.startParameter.taskNames.contains('eclipse') || // Detects gradle launched from the command line to do eclipse stuff
121+
gradle.startParameter.taskNames.contains('cleanEclipse')
119122
isIdea = System.getProperty("idea.active") != null || gradle.startParameter.taskNames.contains('idea') || gradle.startParameter.taskNames.contains('cleanIdea')
120123

121124
// for BWC testing
@@ -440,7 +443,7 @@ allprojects {
440443

441444
File licenseHeaderFile;
442445
String prefix = ':x-pack';
443-
446+
444447
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
445448
prefix = prefix.replace(':', '_')
446449
}
@@ -449,7 +452,7 @@ allprojects {
449452
} else {
450453
licenseHeaderFile = new File(project.rootDir, 'buildSrc/src/main/resources/license-headers/oss-license-header.txt')
451454
}
452-
455+
453456
String lineSeparator = Os.isFamily(Os.FAMILY_WINDOWS) ? '\\\\r\\\\n' : '\\\\n'
454457
String licenseHeader = licenseHeaderFile.getText('UTF-8').replace(System.lineSeparator(), lineSeparator)
455458
task copyEclipseSettings(type: Copy) {

0 commit comments

Comments
 (0)