unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors
@ 2024-05-05 22:14 Rudolf Adamkovič
  2024-05-11  8:56 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Rudolf Adamkovič @ 2024-05-05 22:14 UTC (permalink / raw)
  To: 70797

[-- Attachment #1: Type: text/plain, Size: 13 bytes --]

Tags: patch


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-the-Compilation-mode-recognize-non-legacy-Kotli.patch --]
[-- Type: text/patch, Size: 2855 bytes --]

From 8ff95a02a321d730e2c3171b18ddb55f3a554d20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <rudolf@adamkovic.org>
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)


[-- Attachment #3: Type: text/plain, Size: 255 bytes --]

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

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
Studenohorská 25, 84103 Bratislava, Slovakia, European Union

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-22  8:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05 22:14 bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors Rudolf Adamkovič
2024-05-11  8:56 ` Eli Zaretskii
2024-05-25  7:46   ` Eli Zaretskii
2024-06-08 11:44     ` Eli Zaretskii
2024-06-09 21:40       ` Rudolf Adamkovič
2024-06-13 14:44   ` Rudolf Adamkovic
2024-06-22  8:34     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).