Does eclipseProject task automatically add checkstyleNature to project?

I have Checkstyle plugin configured inside Eclipse.

When I import some projects as “Existing Gradle Projects”, checkstyle doesn’t activate on them automatically.

I have to right click on each project and do “Activate Checkstyle here”.

From a very old 2010 post, I found that we can configure eclipseProject task to add checkstyleNature in .project file like :slight_smile:

 eclipseProject {
  natures 'net.sf.eclipsecs.core.CheckstyleBuilder'
  buildCommand 'net.sf.eclipsecs.core.CheckstyleNature'
 } 

Do we still need to do this? Or does Buildship takes care of it automatically ? If so, then why is it not working for me? Am I missing some obvious step ?

Thanks!

There’s no built-in support for checkstyle, you have to configure the custom natures/build commands in your build script like you suggested:

 eclipse {
  project {
    natures 'net.sf.eclipsecs.core.CheckstyleBuilder'
    buildCommand 'net.sf.eclipsecs.core.CheckstyleNature'
  }
 }