Subject: bug#70797: closed (Re: bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 22 Jun 2024 08:35:02 +0000

Your bug report

#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70797: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70797
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors
From: Eli Zaretskii <[email-masked]>
To: Rudolf (Rudy) Adamkovic <[email-masked]>
Cc: [email-masked]
Date: Sat, 22 Jun 2024 11:34:02 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Rudolf (Rudy) Adamkovic <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 13 Jun 2024 16:44:04 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >   . applying this fails compile-tests in the test suite, so I guess
> >     some adjustment there is also needed;
> 
> Oops!  In the new patch, attached below, I
> 
> - adjust the existing legacy Gradle/Kotlin tests and
> - add new tests for the non-legacy Gradle/Kotlin warnings/errors.
> 
> I also improved the commit message a bit.
> 
> >   . you removed the comment with the pointer to kotlin sources, which
> >     might be still useful for the legacy format (unless the URL is no
> >     longer valid), so please restore that if the pointer can still be
> >     useful
> 
> Smart!  All right, I did a bit of research, and documented
> 
> - the first and last Kotlin version that emits the current format,
> - the last Kotlin version that used the legacy format,
> - the official Git commit that removed the legacy format,
> - the public release date of the current format, and
> - the Kotlin class where the current format is defined.
> 
> All of it is packed into two short comments.

Thanks, installed on the master branch, and closing the bug.

P.S. Please in the future mention the bug number in the commit log
messages, when you know the number.  In the initial submission of a
patch, the number is usually not known, but if you resubmit, it
usually is known already.  (I added the bug number when installing the
changes.)

Subject: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors
From: Rudolf Adamkovič <[email-masked]>
To: [email-masked]
Date: Mon, 06 May 2024 00:14:04 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

>From 8ff95a02a321d730e2c3171b18ddb55f3a554d20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <[email-masked]>
Date: Thu, 2 May 2024 19:06:11 +0200
Subject: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle
 errors

The Compilation mode recognizes Kotlin/Gradle errors but only in the old
format.  The new format, which has been in wide use for about a year, is
not supported.  This patch adds support for the new format.

* etc/compilation.txt:
(symbols): Add a non-legacy Kotlin/Gradle warning and error.
* lisp/progmodes/compile.el:
(compilation-error-regexp-alist-alist): Rename 'gradle-kotlin' to
'gradle-kotlin-legacy' and add 'grade-kotlin' that matches errors and
warnings outputted by non-legacy Kotlin/Gradle.
---
 etc/compilation.txt       | 13 +++++++++++--
 lisp/progmodes/compile.el | 20 +++++++++++++++++---
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/etc/compilation.txt b/etc/compilation.txt
index 05f0829864c..e4e361ecfc7 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -186,13 +186,22 @@ Warning near line 10 file arrayclash.f: Module contains no executable
 Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit

-* Gradle with kotlin-gradle-plugin
+* Gradle with Kotlin plugin
 
-symbol: gradle-kotlin
+symbol: grade-kotlin
+
+e: file:///src/Test.kt:267:5 foo: bar
+w: file:///src/Test.kt:267:5 foo: bar
+
+
+* Gradle with Kotlin plugin (legacy)
+
+symbol: gradle-kotlin-legacy
 
 e: /src/Test.kt: (34, 15): foo: bar
 w: /src/Test.kt: (34, 15): foo: bar
 
+
 * Gradle Android resource linking
 
 symbol: gradle-android
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index b18eb81fee1..76a89bea4fc 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -258,10 +258,24 @@ compilation-error-regexp-alist-alist
      "\\(^Warning .*\\)? line[ \n]\\([0-9]+\\)[ \n]\\(?:col \\([0-9]+\\)[ \n]\\)?file \\([^ :;\n]+\\)"
      4 2 3 (1))
 
-    ;; Gradle with kotlin-gradle-plugin (see
-    ;; GradleStyleMessagerRenderer.kt in kotlin sources, see
-    ;; https://youtrack.jetbrains.com/issue/KT-34683).
     (gradle-kotlin
+     ,(rx bol
+          (| (group "w")                ; 1: warning
+             (group (in "iv"))          ; 2: info
+             "e")                       ; error
+          ": "
+          "file://"
+          (group                        ; 3: file
+           (? (in "A-Za-z") ":")
+           (+ (not (in "\n:"))))
+          ":"
+          (group (+ digit))             ; 4: line
+          ":"
+          (group (+ digit))             ; 5: column
+          " ")
+     3 4 5 (1 . 2))
+
+    (gradle-kotlin-legacy
      ,(rx bol
           (| (group "w")                ; 1: warning
              (group (in "iv"))          ; 2: info
-- 
2.39.3 (Apple Git-146)

-- 
"All you have to do is write one true sentence.  Write the truest
sentence that you know."  --- Ernest Miller Hemingway (1899-1961)

Rudolf Adamkovič <[email-masked]> [he/him]
Studenohorská 25, 84103 Bratislava, Slovakia, European Union