When I split my routes file like this:
...
GET /assets/*file controllers.Assets.at(path="/public", file)
-> /api/v1 api.Routes
...
and only change something in api.Routes, a recompilation throws me the following errors:
...
[error] /home/felix/projects/wust/app/views/includes.scala.html:26: value Assets is not a member of object controllers.routes
[error] <script src='@routes.Assets.at("main.js")'></script>
[error] ^
...
after a clean. Everything compiles correctly.
So I guess this is a bug?
Does api.routes contain any routes to any controllers in the controllers package? If so, then that's the reason, the reverse router from api.routes for the controllers package is overwriting the reverse router from routes for the controllers package, different routes files must address controllers in different packages.
Cool, good to know. Thanks!
This causes unexpected behavior during builds. Every build, different Reverse Route appears in the package, and integration tests using reverse routes fail randomly. If it would fail during compile time instead of silently overriding it would be much better
Most helpful comment
Does
api.routescontain any routes to any controllers in thecontrollerspackage? If so, then that's the reason, the reverse router fromapi.routesfor thecontrollerspackage is overwriting the reverse router fromroutesfor thecontrollerspackage, different routes files must address controllers in different packages.