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.
173 stars 57 forks source link

The output from Gradle 4.8+ isn't colorised #416

Closed entonio closed 5 years ago

entonio commented 5 years ago

In my projects, if I specify Gradle 4.8 or higher in NB's Preferences as the version to use, the build output in the console is black where red is expected.

kelemen commented 5 years ago

stderr is red, while stdout is black. I'm guessing that whatever you are using to print in the logs changes behaviour with the Gradle version. That is, it prints to stderr in older version, while it prints to stdout now.

entonio commented 5 years ago

My setup is simply:

And the colours in NB's Output pane, which I have with the standard settings, seem to be:

Does nobody else have this issue?

entonio commented 5 years ago

(I mean standard javac errors, though it applies to all. Could gradle have started printing javac errors to stderr?)

kelemen commented 5 years ago

If you were to explicity write something to System.out and System.err, how would it display?

kelemen commented 5 years ago

from the build script of course.

entonio commented 5 years ago

Adding System.err.println("Test stderr") in the main body of build.gradle:

entonio commented 5 years ago

Here is a sample project, one just the project, and the other with the files added by the process: Colours.zip Colours+.gradle.zip

kelemen commented 5 years ago

It seems this is an issue in Gradle and was already fixed in Gradle 5.1. I have checked it, and it does indeed seems to be fixed in Gradle 5.1. See the logic in bf5a22ec60f1091fd255c494b7804a6135da1853.

entonio commented 5 years ago

You're correct. I apologise for having brought it up here. I had originally tested it with 5.1.1 and was convinced the problem was there as well. I must have become confused in the middle of all the NB + java + plugin + grade juggling. I have reverted to NB 8.2 on Java 8 + this 1.4.x using Java 8 + Gradle 4.6 because NB 10 on Java 11 + this 2.0.x using Java 8 + Gradle 4.8+ seems to use a lot more CPU and be slower (I have to use Java 8 for compilation because the CheckerFramework only supports Java 8 as of yet).