From 1b1566275a5d4a6e60ed7682120fc16ea9c6366f Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Fri, 3 Jan 2025 22:41:43 +0100 Subject: [PATCH] Use TomlParser --- src/main/java/org/openrewrite/maven/ResourceParser.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/openrewrite/maven/ResourceParser.java b/src/main/java/org/openrewrite/maven/ResourceParser.java index c212a2fe..b5496f68 100644 --- a/src/main/java/org/openrewrite/maven/ResourceParser.java +++ b/src/main/java/org/openrewrite/maven/ResourceParser.java @@ -184,6 +184,8 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { propertiesPaths.add(path); } else if (protoParser.accept(path)) { protoPaths.add(path); + } else if (tomlParser.accept(path)) { + tomlPaths.add(path); } else if (kotlinParser.accept(path)) { kotlinPaths.add(path); } else if (groovyParser.accept(path)) { @@ -225,6 +227,11 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { alreadyParsed.addAll(protoPaths); } + if (!tomlPaths.isEmpty()) { + sourceFiles = Stream.concat(sourceFiles, (Stream) tomlParser.parse(tomlPaths, baseDir, ctx)); + alreadyParsed.addAll(tomlPaths); + } + if (!kotlinPaths.isEmpty()) { sourceFiles = Stream.concat(sourceFiles, (Stream) kotlinParser.parse(kotlinPaths, baseDir, ctx)); alreadyParsed.addAll(kotlinPaths);