davsclaus commented on code in PR #26660:
URL: https://github.com/apache/camel/pull/26660#discussion_r4060629718
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/IntegrationLauncher.java:
##########
@@ -56,8 +56,12 @@ private IntegrationLauncher() {
*/
public static JsonObject run(Path directory, List<String> files, String
name, boolean dev, List<String> extraArgs) {
List<String> cmd = new ArrayList<>(LauncherHelper.getCamelCommand());
- List<String> sources = files == null || files.isEmpty() ?
sourceFiles(directory) : files;
- cmd.addAll(runArguments(sources, name, dev, extraArgs));
+ // no files given: the whole directory is the app (camel run
--source-dir), so a file the agent adds later,
+ // a bean file, a Java class under src/main/java, is part of it and
reloaded in dev mode (CAMEL-24861);
+ // with files given only those run, for a directory that holds several
apps
+ boolean sourceDir = files == null || files.isEmpty();
+ List<String> sources = sourceDir ? sourceFiles(directory) : files;
+ cmd.addAll(sourceDir ? sourceDirArguments(name, dev, extraArgs) :
runArguments(sources, name, dev, extraArgs));
JsonObject result = new JsonObject();
if (sources.isEmpty()) {
result.put("directory", directory.toString());
Review Comment:
Fixed: the guard is skipped when the directory is the app (`!sourceDir &&
sources.isEmpty()`), with a comment saying why; `camel run --source-dir` finds
a class under src/main/java itself.
--
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]