[2.0] modify package contents for ``play dist``

336 views
Skip to first unread message

Andi Balke

unread,
Mar 28, 2012, 11:32:09 AM3/28/12
to play-fr...@googlegroups.com
hi,

how can i configure what contents are included to the dist-package?

thx, andi

Ben McCann

unread,
Mar 28, 2012, 11:38:44 AM3/28/12
to play-fr...@googlegroups.com
You could unzip, add your own files, and then re-zip.  Personally I don't like that the package is zipped, and am going to work on making it so that you can optionally create an unzipped version.  I submitted a pull request, but it was suggested that I modify the way I was doing it, so I'll take another stab at it in the next couple of weeks.  Anyway, if I'm able to create an SBT plugin for creating an unzipped distribution then it will save you the first step of unzipping.

peter hausel

unread,
Mar 28, 2012, 12:42:52 PM3/28/12
to play-fr...@googlegroups.com
you can also override the disk sbt task or extend it and register a new one

Ike

unread,
Mar 28, 2012, 2:22:18 PM3/28/12
to play-fr...@googlegroups.com
Peter, that sounds more approachable than creating an sbt plugin. I still think that if we have a dist/zip target we should have a dist/unzipped one. I commented on Ben's closed Pull Request to that effect.

In the meantime, do you have a sample handy (maybe a gist) of overriding an sbt task like that?

Ben McCann

unread,
Mar 28, 2012, 2:30:46 PM3/28/12
to play-fr...@googlegroups.com
Btw, Peter, when you suggested I should move the ability to create either a zipped or unzipped distribution to being an SBT plugin, is it correct that all I need to do is move the code to live under src/sbt-plugin/src/main/scala ?

Thanks,
Ben


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/HyUg96kPFP8J.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

peter hausel

unread,
Mar 28, 2012, 5:02:26 PM3/28/12
to play-fr...@googlegroups.com
Hi Ben,

What I meant was more like creating a separate module/extension for custom commands, outside of the framework. 

As a generic strategy we try to move features from the core framework to plugins/extensions/modules as opposed to the other way around. 

Otherwise, if we add every single feature folks want/need, the core framework would be gigantic and monolithic in a month. It's a delicate balance and oftentimes one's extra feature is another person's feature bloat. (Please note, I am not talking about this particular feature but new features in general.)

Thanks,
Peter




On Wednesday, March 28, 2012 2:30:46 PM UTC-4, Ben McCann wrote:
Btw, Peter, when you suggested I should move the ability to create either a zipped or unzipped distribution to being an SBT plugin, is it correct that all I need to do is move the code to live under src/sbt-plugin/src/main/scala ?

Thanks,
Ben


On Wed, Mar 28, 2012 at 11:22 AM, Ike <ike...@gmail.com> wrote:
Peter, that sounds more approachable than creating an sbt plugin. I still think that if we have a dist/zip target we should have a dist/unzipped one. I commented on Ben's closed Pull Request to that effect.

In the meantime, do you have a sample handy (maybe a gist) of overriding an sbt task like that?


On Wednesday, March 28, 2012 12:42:52 PM UTC-4, peter hausel wrote:
you can also override the disk sbt task or extend it and register a new one

On Wednesday, March 28, 2012 11:38:44 AM UTC-4, Ben McCann wrote:
You could unzip, add your own files, and then re-zip.  Personally I don't like that the package is zipped, and am going to work on making it so that you can optionally create an unzipped version.  I submitted a pull request, but it was suggested that I modify the way I was doing it, so I'll take another stab at it in the next couple of weeks.  Anyway, if I'm able to create an SBT plugin for creating an unzipped distribution then it will save you the first step of unzipping.


On Wednesday, March 28, 2012 8:32:09 AM UTC-7, Andi Blake wrote:
hi,

how can i configure what contents are included to the dist-package?

thx, andi

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/HyUg96kPFP8J.

To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

Ben McCann

unread,
Mar 28, 2012, 6:34:07 PM3/28/12
to play-fr...@googlegroups.com
Sure, sounds good.  Thanks for clarifying.


To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/C7v7SIUaI3oJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

Ike

unread,
Mar 28, 2012, 8:59:52 PM3/28/12
to play-fr...@googlegroups.com
Hi Peter, I agree about the bloat and keeping new features as modules, but 'dist' is an existing build target/task, which is already part of the framework (I know you mentioned you were talking about new features in general).

I see a resistance to modifying its behavior and I was just curious to understand why. It's just not clear to me why generating a zip file is preferred over an expanded dir or why it would qualify as part of the framework vs. a module for the other one. It seems to me that it's a trivial addition and if the reason is that the core team is very busy with more important things that's fair enough. I'm not trying to impose a feature on the team, just looking for information/clarification.

Also, I'm curious as to why the layout generated by the 'stage' task is different than the one generated by 'dist'. I initially thought that 'stage' was just the expanded version of 'dist' but there's probably a technical reason for having these two setups. Otherwise it may make sense to generate 'stage' in the same simplified layout that 'dist' does, killing two birds with one stone. Any thoughts?

Thanks,

Ike

Ben McCann

unread,
Mar 29, 2012, 1:39:02 AM3/29/12
to play-fr...@googlegroups.com
I've been thinking about this and I'm having figuring out how to make this an SBT without a lot of code duplication and fragility.  There are a few options I see.  The first would be to create the zip and then unzip it, which seems like a pretty inefficient way to do this and is towards the bottom of my list.  Another would be to change the Play implementation to not zip by default and then make an SBT plug-in which zips it.  A third solution would be to move both the creation of a zipped and unzipped distribution into an SBT plugin.  Any preferences or suggestions on how I should do this?

Thanks


To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/CCrBJ8qink8J.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

peter hausel

unread,
Mar 30, 2012, 10:09:16 AM3/30/12
to play-fr...@googlegroups.com
Hi Ben,

Just to show how easy is to extend the build system, I implemented dist-unzip as a plugin:


after registering the plugin

you can do `play dist dist-unzip` (as a bonus I change the start script's execution bit on nix and create start.bat on windows)

Cheers,
Peter

Ben McCann

unread,
Mar 30, 2012, 12:27:41 PM3/30/12
to play-fr...@googlegroups.com
Very cool.  It would be nice if there were some way to do this without zipping and then unzipping all the files, which seems a bit wasteful.  Also, do you happen to know if there's a way to do this where I don't have to type two task names and can have dist-unzip automatically call dist-zip first?  (btw, you left out an s in SbtGoodiesTaks.scala)

Thanks for the script!

-Ben


To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/fVg198qeePkJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

peter hausel

unread,
Mar 30, 2012, 12:51:53 PM3/30/12
to play-fr...@googlegroups.com


On Friday, March 30, 2012 12:27:41 PM UTC-4, Ben McCann wrote:
Very cool.  It would be nice if there were some way to do this without zipping and then unzipping all the files, which seems a bit wasteful.

the zipping process is also moving files to the right places. That said, it should be fairly simple to create a new task which does this without zipping.I am using an SSD so for me the current solution is plenty fast. 

We are more flexible with pull requests in the play-plugins repo. Just saying:-)

 
 Also, do you happen to know if there's a way to do this where I don't have to type two task names and can have dist-unzip automatically call dist-zip first?  (btw, you left out an s in SbtGoodiesTaks.scala)
 
should be very easy to bundle the two tasks together. I will do that if I get some time over the weekend. (oh, and I will fix the typo too - thanks for the pointer)

Ike

unread,
Mar 30, 2012, 2:04:55 PM3/30/12
to play-fr...@googlegroups.com
Thanks Peter. This is a great example of extending sbt for us newbies and I love the bonus of setting the execute bit!

I also left you some feedback in the announcement thread.


On Friday, March 30, 2012 10:09:16 AM UTC-4, peter hausel wrote:
Hi Ben,

Reply all
Reply to author
Forward
0 new messages