tuplejump / play-yeoman

Play + Yeoman integration sbt and play plugins
Apache License 2.0
237 stars 58 forks source link

Yoeman.scala in play-yeoman uses hard-coded directories instead of settings #23

Closed samzilverberg closed 10 years ago

samzilverberg commented 10 years ago

Base dir is hard-coded to "ui". Other sub dirs too: "dist", ".tmp", "app". would be better if it used the "yeomanDirectory" sbt setting for the base dir and perhaps have more sbt setting to override the sub dirs (especially for dist)

milliondreams commented 10 years ago

I am not sure if this is possible as the sbt settings won't be available in the application at runtime. We probably should devise some other way of configuring this, in Globals perhaps?

Anyone has any ideas on this, please chime in!

samzilverberg commented 10 years ago

I thought of a couple of ways, but sadly none can reuse the settings defined for sbt.

  1. at first i thought of a yeoman.conf that would be included in application.conf and used by the Yeoman controller. I thought this could be also used by sbt but after googling for this kind of external config file and going over some sbt docs I'm pretty sure it's not possible :(
  2. like the play controller handles it, in routes: GET /*file controllers.Assets.at(path="/public", file) just replace Assets with Yeoman and path with "/ui" or whatever
  3. just have it as some field in Yeoman and by extending this class and overriding this field one would have the controller he wants.

I guess it could be ok to have different settings for sbt and for the app yeoman related stuff. One configuration is for the build process (and sbt console) and the other is for the runtime and assets. They don't necessarily have to be the same. Actually in my project they are not exactly the same. The grunfile is in the yeomanDir sbt settings at "/frontend" but my assets are in a subdir "/frontend/public".

what do you think?

By the way I ended up doing something like 3. I copied the Yeoman controller code and made the changes needed so it would work for my project which has a different project structure.

milliondreams commented 10 years ago

Will it help if we make it configurable in conf/application.conf?

samzilverberg commented 10 years ago

yeah sure.

diwa-zz commented 10 years ago

+1 on this because we don't use yo and our boilerplate has different directory names

raulraja commented 10 years ago

+1