From 93a019765dd8031b3ee13b9f76c0a7af6afc3eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 6 Oct 2024 17:24:42 -0300 Subject: [PATCH 1/7] Fix incorrect properties --- antlr4-wrapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index 7a82734022..6153c751db 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -32,10 +32,10 @@ - + - + From ca71d765538dc00d971050a504a4d2a72b458053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 6 Oct 2024 19:48:30 -0300 Subject: [PATCH 2/7] Include up-to-date-check to Antlr4 cpd - Prevent unnecessary re-runs --- antlr4-wrapper.xml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index 6153c751db..4036aa009a 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -15,6 +15,7 @@ --> + @@ -40,6 +41,20 @@ + + + + + + + + + + + + + @@ -72,7 +87,9 @@ tofile="${parser-file}"/> - + + From e3cd599da22e039b282323af44a2d1775a337474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 6 Oct 2024 19:58:43 -0300 Subject: [PATCH 3/7] Add @Generated annotations to cpd Antlr languages --- antlr4-wrapper.xml | 78 +++++++++++++++++++++++++++++++++++++++++++++- pmd-cs/pom.xml | 1 + pmd-dart/pom.xml | 1 + pmd-go/pom.xml | 1 + pmd-lua/pom.xml | 1 + pom.xml | 8 +++++ 6 files changed, 89 insertions(+), 1 deletion(-) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index 4036aa009a..b17002f40a 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -12,7 +12,14 @@ See AntlrGeneratedParserBase + It also uses the following maven properties: + - ant.contrib.jar: Location of the ant-contrib jar --> + + + + + @@ -55,6 +62,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -87,7 +163,7 @@ tofile="${parser-file}"/> - + diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 0eec39f809..f4879ed0e7 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -30,6 +30,7 @@ + diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 496115127b..f772795832 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -30,6 +30,7 @@ + diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 4df297ebc9..cf47e5217c 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -30,6 +30,7 @@ + diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index f3a24be6d3..c8adda151f 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -30,6 +30,7 @@ + diff --git a/pom.xml b/pom.xml index 8f0474ab59..0f41e68e7d 100644 --- a/pom.xml +++ b/pom.xml @@ -122,6 +122,9 @@ ${project.build.directory}/generated-sources/javacc ${project.basedir}/../javacc-wrapper.xml + 1.0b3 + ${settings.localRepository}/ant-contrib/ant-contrib/${ant-contrib.version}/ant-contrib-${ant-contrib.version}.jar + ${project.build.directory}/generated-sources/antlr4 ${project.basedir}/../antlr4-wrapper.xml @@ -167,6 +170,11 @@ ant ${ant.version} + + ant-contrib + ant-contrib + ${ant-contrib.version} + From 31018611c65db4f699c0f745a5a65de540214e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 6 Oct 2024 20:07:37 -0300 Subject: [PATCH 4/7] Add missing lexer properties --- antlr4-wrapper.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index b17002f40a..da0ed3799e 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -48,6 +48,9 @@ + + + From f68130eaf9e95c836b682ef068736e9edd209cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 6 Oct 2024 20:07:47 -0300 Subject: [PATCH 5/7] Annotate Antlr generated classes for PMD languages --- antlr4-wrapper.xml | 4 +++- pmd-kotlin/pom.xml | 1 + pmd-swift/pom.xml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index da0ed3799e..0832bd9bc0 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -179,7 +179,9 @@ public class ${lexer-name}'/> - + + diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 40f19513de..5e9dbf2e80 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -43,6 +43,7 @@ + diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 023fa8dd39..0c50cdc818 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -42,6 +42,7 @@ + From ab1976382af7be6b424a5500a2ce5dc84e645238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 12 Oct 2024 17:28:18 -0300 Subject: [PATCH 6/7] Remove ant.contrib.jar property --- antlr4-wrapper.xml | 9 +-------- pmd-cs/pom.xml | 1 - pmd-dart/pom.xml | 1 - pmd-go/pom.xml | 1 - pmd-kotlin/pom.xml | 1 - pmd-lua/pom.xml | 1 - pmd-swift/pom.xml | 1 - pom.xml | 1 - 8 files changed, 1 insertion(+), 15 deletions(-) diff --git a/antlr4-wrapper.xml b/antlr4-wrapper.xml index 0832bd9bc0..c3e4527f9f 100644 --- a/antlr4-wrapper.xml +++ b/antlr4-wrapper.xml @@ -11,15 +11,8 @@ - root-node-name: name of the root node without prefix (eg "TopLevel"), will be made to implement RootNode See AntlrGeneratedParserBase - - It also uses the following maven properties: - - ant.contrib.jar: Location of the ant-contrib jar --> - - - - - + diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index f4879ed0e7..0eec39f809 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -30,7 +30,6 @@ - diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index f772795832..496115127b 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -30,7 +30,6 @@ - diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index cf47e5217c..4df297ebc9 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -30,7 +30,6 @@ - diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 5e9dbf2e80..40f19513de 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -43,7 +43,6 @@ - diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index c8adda151f..f3a24be6d3 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -30,7 +30,6 @@ - diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 0c50cdc818..023fa8dd39 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -42,7 +42,6 @@ - diff --git a/pom.xml b/pom.xml index 0f41e68e7d..871775ff54 100644 --- a/pom.xml +++ b/pom.xml @@ -123,7 +123,6 @@ ${project.basedir}/../javacc-wrapper.xml 1.0b3 - ${settings.localRepository}/ant-contrib/ant-contrib/${ant-contrib.version}/ant-contrib-${ant-contrib.version}.jar ${project.build.directory}/generated-sources/antlr4 ${project.basedir}/../antlr4-wrapper.xml From f834b8744de723ec38a41de0f73990521b79abf4 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 13 Oct 2024 12:26:31 +0200 Subject: [PATCH 7/7] [doc] Update release notes (#5258) --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 197b7a4aec..98d61841ae 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -49,6 +49,7 @@ The old rule names still work but are deprecated. * [#4965](https://github.com/pmd/pmd/pull/4965): \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) * [#5225](https://github.com/pmd/pmd/pull/5225): \[java] Fix #5067: CloseResource: False positive for FileSystems.getDefault() - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef) * [#5241](https://github.com/pmd/pmd/pull/5241): Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) +* [#5258](https://github.com/pmd/pmd/pull/5258): Ignore generated antlr classes in coverage reports - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) {% endtocmaker %}