You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/12/02 12:54:09 UTC
[camel] branch main updated (f5238d8b37c -> c530c3fd701)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
from f5238d8b37c docs: fixed a typo in the HTML snipped used for documentation indexing
new d181cffc670 camel-jbang - Polished
new c530c3fd701 CAMEL-18788: camel-jbang - Run with --dev should use reload dir of the file in case its from another folder than current.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/camel/dsl/jbang/core/commands/Run.java | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
[camel] 01/02: camel-jbang - Polished
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d181cffc670607a38e5176f2bb752789a0f20bfa
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 2 13:48:04 2022 +0100
camel-jbang - Polished
---
.../src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index aaf62399eb6..382353b7ab5 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -83,7 +83,7 @@ class Run extends CamelCommand {
private static final String CLIPBOARD_GENERATED_FILE = ".camel-jbang/generated-clipboard";
private static final Pattern PACKAGE_PATTERN = Pattern.compile(
- "^\\s*package\\s+([a-zA-Z][\\.\\w]*)\\s*;.*$", Pattern.MULTILINE);
+ "^\\s*package\\s+([a-zA-Z][.\\w]*)\\s*;.*$", Pattern.MULTILINE);
private static final Pattern CLASS_PATTERN = Pattern.compile(
"^\\s*public class\\s+([a-zA-Z0-9]*)[\\s+|;].*$", Pattern.MULTILINE);
@@ -231,10 +231,6 @@ class Run extends CamelCommand {
}
}
- private int stop() {
- return 0;
- }
-
private Properties loadProfileProperties(File source) throws Exception {
Properties prop = new CamelCaseOrderedProperties();
RuntimeUtil.loadProperties(prop, source);
[camel] 02/02: CAMEL-18788: camel-jbang - Run with --dev should use reload dir of the file in case its from another folder than current.
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit c530c3fd701f051d3fae76cf2d4e54222939c734
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 2 13:53:56 2022 +0100
CAMEL-18788: camel-jbang - Run with --dev should use reload dir of the file in case its from another folder than current.
---
.../java/org/apache/camel/dsl/jbang/core/commands/Run.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
index 382353b7ab5..f67bdf16d8a 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java
@@ -502,7 +502,16 @@ class Run extends CamelCommand {
if (dev && sjReload.length() > 0) {
String reload = sjReload.toString();
main.addInitialProperty("camel.main.routesReloadEnabled", "true");
- main.addInitialProperty("camel.main.routesReloadDirectory", ".");
+ // use current dir, however if we run a file that are in another folder, then we should track that folder instead
+ String reloadDir = ".";
+ for (String r : reload.split(",")) {
+ String path = FileUtil.onlyPath(r);
+ if (path != null) {
+ reloadDir = path;
+ break;
+ }
+ }
+ main.addInitialProperty("camel.main.routesReloadDirectory", reloadDir);
main.addInitialProperty("camel.main.routesReloadPattern", reload);
main.addInitialProperty("camel.main.routesReloadDirectoryRecursive", isReloadRecursive(reload) ? "true" : "false");
// do not shutdown the JVM but stop routes when max duration is triggered