From: "Rudolf Adamkovič" <rudolf@adamkovic.org>
To: 70797@debbugs.gnu.org
Subject: bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors
Date: Mon, 06 May 2024 00:14:04 +0200 [thread overview]
Message-ID: <m2fruvx5xv.fsf@adamkovic.org> (raw)
[-- 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
next reply other threads:[~2024-05-05 22:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-05 22:14 Rudolf Adamkovič [this message]
2024-05-11 8:56 ` bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2fruvx5xv.fsf@adamkovic.org \
--to=rudolf@adamkovic.org \
--cc=70797@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.