davsclaus commented on code in PR #29857:
URL: https://github.com/apache/camel/pull/29857#discussion_r4577875118


##########
dsl/camel-jbang/camel-jbang-plugin-test/src/main/java/org/apache/camel/dsl/jbang/core/commands/test/TestPluginExporter.java:
##########
@@ -194,6 +199,53 @@ public void addSourceFiles(Path buildDir, String 
packageName, Printer printer) t
 
     }
 
+    /**
+     * Scans Citrus test files in the given directory using the Citrus code 
analyzer to detect required modules and
+     * dependencies. Supports YAML, XML and Groovy test sources.
+     */
+    private Set<String> detectDependenciesFromTestSources(Path testDir) {
+        Set<String> deps = new HashSet<>();
+        DelegatingCodeAnalyzer analyzer = new DelegatingCodeAnalyzer();
+        try (Stream<Path> paths = Files.list(testDir)) {
+            paths.filter(this::isTestSource)
+                    .filter(this::isAnalyzerSupported)
+                    .forEach(path -> {
+                        try {
+                            CodeAnalyzer.ScanResult result = 
analyzer.scan(path);
+                            for (String module : result.modules()) {
+                                deps.add(asCitrusDependency(module));
+                            }
+                            for (String dependency : result.dependencies()) {
+                                deps.add(asScannedDependency(dependency));
+                            }
+                        } catch (IOException e) {

Review Comment:
   Keeping `IOException` on purpose: the earlier review round narrowed this 
catch so that a `CitrusRuntimeException` (e.g. a missing catalog) surfaces 
instead of silently dropping the detected dependencies. Resolving; reopen if 
you see it differently.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to