How to import external routes in Akeneo 4.0

  akeneo, php, symfony, symfony4

I’m building a custom bundle for Akeneo v4.0. I’m trying to import routes from that bundle to the rest of the app. So far I’ve done:

# config/bundles.php

return [
    JBieliauskasMyServerBundleMyServerBundle::class => ['dev' => true, 'test' => true],
# src/MyServerBundle/Resources/config/routing.yml
  path: /my-server
# config/routes/routes.yml
  resource: "@MyServerBundle/Resources/config/routing.yml"
  prefix: /

Then I run:

$ bin/console cache:clear
$ bin/console debug:router | grep my_server

and nothing shows up. What am I missing?

I know that src/Kernel.php is looking for routes using a glob pattern, but I don’t understand it:

protected function configureRoutes(RouteCollectionBuilder $routes): void 
    // ...
    $this->loadRoutesConfiguration($routes, $this->getProjectDir() . '/config', $this->environment);

// ...

private function loadRoutesConfiguration(RouteCollectionBuilder $routes, string $confDir, string $environment): void
    // ...
    $routes->import($confDir . '/{routes}/*.yml', '/', 'glob');

So it should detect the file config/routes/routes.yml, no?

Source: Symfony Questions