Caio
(Fernandes)
February 15, 2016, 11:42am
1
Using Buildship 1.0.9 , Gradle 2.11 and Eclipse 4.5.1 with the following script:
eclipse {
project {
buildCommand 'edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder'
natures 'ch.acanda.eclipse.pmd.builder.PMDNature'
}
}
When a import a project, only buildCommand
works but the nature
a specificated is not included in the .project
file. I alread tried natures << 'ch.acanda.eclipse.pmd.builder.PMDNature'
and natures = ['ch.acanda.eclipse.pmd.builder.PMDNature']
but the result is always the same. Is it normal ? Thanks.
Lance_Java
(Lance Java)
February 15, 2016, 11:46am
2
What version of gradle are you running? This feature requires 2.9+
Buildship 1.0.7 is now available - with support for custom natures and build commands
Buildship 1.0.7 is based on Gradle 2.9 which offers a pack of enhancements .
Buildship now automatically configures custom project natures and custom build commands defined in the build script:
apply plugin: 'eclipse'
eclipse {
project {
natures << 'some.extra.eclipse.nature'
buildCommand << 'some.extra.build.command'
}
}
Note that this feature is only supported for projects using…
st_oehme
(Stefan Oehme)
February 16, 2016, 2:40pm
3
Hey @Caio
Buildship only adds a nature if it is handled by the current Eclipse installation. So make sure that PMD is installed and the nature id is correct.
Cheers,
Stefan
Caio
(Fernandes)
February 17, 2016, 3:45pm
4
Indeed. I made a few tests and custom natures are only added to .project
file if you have the plugin installed and the nature declared. Thank you!