davsclaus commented on code in PR #27847:
URL: https://github.com/apache/camel/pull/27847#discussion_r4275429002
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -2096,6 +2103,46 @@ static void writeCamelMainRunLogConfig(Path target,
String appName, String loggi
}
}
+ /**
+ * The reload pattern of dev mode with a source directory: every file
under it, except the data folders
+ * (--data-dir), whose files the routes read and write: a change there is
not a change of the sources, and reloading
+ * the routes for it restarts them, so they write again and reload again
(CAMEL-25670).
+ */
+ /**
+ * --data-dir only changes what dev mode watches in a source directory:
without one only the given files are
+ * watched, and their data folders are not, so the option has nothing to
leave out. Said when it is given on the
+ * command line; camel.jbang.dataDir in an application.properties is not,
as an example that declares its data
+ * folders also runs with its files (camel run --example).
+ */
+ private void warnDataDirWithoutSourceDir() {
+ if (dataDir != null && spec != null && spec.commandLine() != null
+ && spec.commandLine().getParseResult() != null
+ &&
spec.commandLine().getParseResult().hasMatchedOption("--data-dir")) {
+ printer().printErr("WARN: --data-dir is used with --source-dir:
without a source directory dev mode only"
Review Comment:
Fair, the wording was ambiguous. In 46311f0bca14 it reads: `WARN:
--data-dir=inbox has no effect without --source-dir: dev mode then only watches
the given files`.
_Claude Code on behalf of @davsclaus._
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -2096,6 +2103,46 @@ static void writeCamelMainRunLogConfig(Path target,
String appName, String loggi
}
}
+ /**
+ * The reload pattern of dev mode with a source directory: every file
under it, except the data folders
+ * (--data-dir), whose files the routes read and write: a change there is
not a change of the sources, and reloading
+ * the routes for it restarts them, so they write again and reload again
(CAMEL-25670).
+ */
+ /**
+ * --data-dir only changes what dev mode watches in a source directory:
without one only the given files are
+ * watched, and their data folders are not, so the option has nothing to
leave out. Said when it is given on the
+ * command line; camel.jbang.dataDir in an application.properties is not,
as an example that declares its data
+ * folders also runs with its files (camel run --example).
+ */
Review Comment:
Right, the new method had landed between `sourceDirReloadPattern`'s javadoc
and that method. Moved in 46311f0bca14, so each javadoc is on its own method
again.
_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]