kelemen / netbeans-gradle-project

This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
170 stars 57 forks source link

Gradle 5 - leftShift(Closure) method deprecated #379

Closed aplatypus closed 6 years ago

aplatypus commented 6 years ago

The first line of our gradle build files prints the file's name to the Gradle output (see below) Gradle 4.6 is reporting an error on the leftShift { } closures before our first line.

We've looked at the stack trace and it must be coming from the gradle plugin or some contained script some place. Before our build file even gets read.

You need to set:

To see the message.


The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

[tmacs/foundation/build.gradle]
kelemen commented 6 years ago

I don't use the "<<" operator (I never liked it in the first place). I have also checked the sources of the plugin it never uses it (searched for "<<" and the only match was a bit shift in the code). So, I would guess that it might be in one of the plugins you are using.

aplatypus commented 6 years ago

Thanks, yes I agree the << isn't a good look. It ought to be possible to identify the plugin.

kelemen commented 6 years ago

I have found this issue about identifying the culprit: https://discuss.gradle.org/t/way-to-find-root-cause-of-a-gradle-deprecation-warning-is-arcane-knowledge/18838/18 There they claim that "--stacktrace" will have the complete stack trace printed (I have verified this behaviour using Gradle 4.0.2 and it seems to work).

aplatypus commented 6 years ago

I found the cause of this message this week. It was coming from the release plugin. I had v2.4. v2.7 resolves that error.

plugins
{
    id 'net.researchgate.release' version '2.7.0'
    id "base"                           //    To add "clean" task
      :
}