mmizutani / sbt-play-gulp

Gulp asset pipeline for Play Framework
Other
37 stars 12 forks source link

Gulp not working in Play Sub Projects #15

Open venkatzifo opened 8 years ago

venkatzifo commented 8 years ago

When i include your plugin in the root project it checks for the UI Folder in the root project and also in the sub projects. Is there anyway i could enable the plugin only for root project or only only for one sub project???

almothafar commented 8 years ago

I think Its gulp code thing not even an issue, i'm not sure what kind of sub projects you are talking about but i guess you mean folders inside UI ?

Have you tried to play around gulp.devDirs=["ui/app"] in application.conf file?

venkatzifo commented 8 years ago

No Almothafar, We were talking about PLAY MODULES...Not the Sub projects inside UI...

Some thing like the below link...

https://github.com/anjanpathak/playmodules

If we go with Play Modules then gulp actually checks whether UI folder exists in each module. But we placed it only inside the Root Folder (not in each folder inside the "modules").

Is it possible to have the UI folder only inside the Project's root directory ???

Could you PLEASE help me with this????

Thanks in ADVANCE!!!!!!!!!

modules

almothafar commented 8 years ago

How you know that, what the issue you are facing still not understand full view of what you are talking about, the gulp currently read all files only under UI folder.

venkatzifo commented 8 years ago

There is a module concept in play framework where we can split our code base into different modules(sub projects). We were trying to do that by having two folders . i.e sub projects (application and common) with UI folder in root project structure of a play application and trying to run it with activator run.

We got error saying that there is no UI folder inside the module -> application and module -> common folders. This is what the issue we were facing and trying to solve.

almothafar commented 8 years ago

The plugin support only single "UI" folder in the root, if you want UI folders inside the sub projects I think it will not work, I see the code working like that, unless maybe to try to set only single path in application.conf like only /module/application, i'm sure this is not you want, but you may need to check source to see what I want to say.

Currently the plugin create files inside dist folder and copy it into public in production, a point could be helpful.

Could be a feature not a bug or case to handle not to solve, i think it will be helpful if you can make a simple working (compile-able ) project mock your current structure so we might be able to help or solve together.

mmizutani commented 8 years ago

@venkatzifo

What you refer to as an example of Play modules is actually a Play multi project. From https://github.com/anjanpathak/playmodules/blob/master/build.sbt,

lazy val root = project.in(file(".")).aggregate(web, portal).dependsOn(web, portal)
lazy val web = project.in(file("modules/web"))
lazy val portal = project.in(file("modules/portal"))

you can see that anjanpathak"s playmodules app consists of the root skeleton project and the two sub projects inside the modules folder. The name of the root folder 'modules' is arbitrary and does not imply that this app is powered with Play modules.

If you set up a Play multi project where the root project is not a skeleton but an actual Play app and sub projects are extracted into a sub folder, then you will encounter the problem that not only the main project but also the sub projects load sbt plugins. If you want to separate your Play app into the main project and, say, two sub projects, you will probably need to create a root skeleton project and three sub projects (main sub project and two sub projects) and load this plugin only in the plugins.sbt file of the main sub project, not in the plugins.sbt file of the root skeleton project:

// <root>/build.sbt
lazy val root = project.in(file(".")).aggregate(main, web, portal)
lazy val main = project.in(file("main")).dependsOn(web, portal)
lazy val web = project.in(file("modules/web"))
lazy val portal = project.in(file("modules/portal"))
// <root>/main/project/plugins.sbt
addSbtPlugin("com.github.mmizutani" % "sbt-play-gulp" % "0.1.1")