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

   Part of item 6 of 
[CAMEL-26930](https://issues.apache.org/jira/browse/CAMEL-26930) (dev mode 
reload).
   
   ## Problem
   
   `camel dev > run.log` in the project folder reloads all the routes every 2 
seconds. With a source directory (`--source-dir`, `camel run .`, `camel dev`), 
the reload pattern is `*,!test/**` plus the data folders 
(`RunPipeline.sourceDirReloadPattern`). The log file the run writes into is a 
changed file on every scan, and so is anything else a run or a tool writes 
there: the build output in `target`, `.git` (a `git status` rewrites 
`.git/index`), and the `.camel-jbang` and `.camel` folders of the CLI and the 
file consumer. Agents redirect the output of a run to a file all the time.
   
   ## Change
   
   The reload pattern of a source directory also leaves out `*.log`, 
`target/**`, `.git/**`, `.camel/**` and `.camel-jbang/**`. `*` stays, as 
resource files such as XSLT or JSON templates in the source directory are 
reloaded on purpose (CAMEL-25670, CAMEL-26494). The excludes use the same 
mechanism as `test/**` and `--data-dir`, which matches a file name such as 
`*.log` in any folder.
   
   `camel-jbang-running.adoc` lists what dev mode does not watch.
   
   The other points of item 6 (the auto-detected `application.properties` not 
reloaded, only the first folder watched, `--exclude` with a source directory) 
are not in this PR.
   
   ## Tests
   
   - `RouteWatcherReloadDataDirTest.testTheFilesARunWritesAreNotWatched` 
(camel-core), with the pattern of the CLI: writing `run.log`, `logs/app.log`, 
`target/classes/Foo.class`, `.git/index` and `.camel/order-1.json` is no 
change, and the route file still is.
   - `RunTest.sourceDirReloadPatternLeavesTheDataDirsOut`, with the new 
excludes.
   - `RunExportGoldenTest`: the golden file `maven-main-mixed.maven.txt` has 
the new pattern.
   - camel-core `RouteWatcherReloadDataDirTest`: 9 tests pass. camel-jbang-run: 
303. camel-jbang-core: 3002 pass; 14 of the 259 serial tests failed with 
"Address already in use" on 8080, held by another `camel run` on the machine at 
the time (CI does not have it).
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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