davsclaus opened a new pull request, #27384:
URL: https://github.com/apache/camel/pull/27384

   https://issues.apache.org/jira/browse/CAMEL-25349
   
   ## Problem
   
   `camel run . --dev` never reloaded a route file when it was saved, and a new 
route file in the directory was not loaded. The directory was expanded by 
`RunHelper.dirToFiles` to names like `./orders.camel.yaml`, which became the 
dev-mode reload pattern. `RouteWatcherReloadStrategy` matches the pattern 
against `orders.camel.yaml` (file name, path relative to the folder, compacted 
path), so nothing matched. `camel run --source-dir=. --dev` worked.
   
   ## Change
   
   - A single directory argument (`camel run .` or `camel run mycode`) now runs 
the directory as `--source-dir` with the `jbang` and `main` runtimes: changed 
files are reloaded and new files are loaded in dev mode.
   - A directory with a `pom.xml` (an existing Maven project), and the 
`spring-boot` and `quarkus` runtimes (which export the files), keep running the 
files in the directory.
   - `RunHelper.dirToFiles` names the files of the current directory without a 
leading `./`; a file list of another directory keeps the directory (used by 
export, dependency list, SBOM and the Kubernetes plugin too).
   - Docs: the running page says a directory runs as `--source-dir`; the 4.23 
upgrade guide notes that route files in subfolders are now loaded too.
   
   ## Tests
   
   - New `RunDirectoryTest` (5 tests): which directories run as source-dir, and 
the file names `dirToFiles` produces.
   - `DevTest`, `RunExistingProjectTest` pass.
   - End to end with the installed CLI: `camel run . --dev` in a folder with 
`a.camel.yaml`; editing it reloads the route, and adding `b.camel.yaml` starts 
route b. Before the fix neither happened. Plain `camel run .` still starts both 
routes.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01DDRLJAyf8cDXSg8iX785My


-- 
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