eclipse / buildship

The Eclipse Plug-ins for Gradle project.
530 stars 169 forks source link

eclipse.classpath.file.whenMerged requires the java plugin #1256

Open Yay295 opened 1 year ago

Yay295 commented 1 year ago

I needed to modify Eclipse's classpath, so I was trying to use

apply plugin: 'eclipse'
eclipse.classpath.file.whenMerged {
    println 'is not printed'
    ...
}

but nothing was happening. After trying a lot of different things I happened to move that code after a apply plugin: 'java' statement I had in my script, and it started working.

apply plugin: 'java'
apply plugin: 'eclipse'
eclipse.classpath.file.whenMerged {
    println 'is printed'
    ...
}

Is it intentional that this only works with the Java plugin applied, and is there anywhere that Buildship's special handling of eclipse.classpath.file is documented?

Related: https://discuss.gradle.org/t/how-does-buildship-create-the-classpath-file-for-eclipse/26252 https://github.com/eclipse/buildship/issues/923 possibly https://github.com/eclipse/buildship/issues/1133