RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

A few changes to make plovr work as a play framework plugin #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I recently created a plugin (http://code.google.com/p/play-plovr/) so that 
plovr can be used to dynamically compile javascript files in the play! 
framework (http://www.playframework.org/).  The Play framework dynamically 
compiles java files, so it seemed a good fit to plug in plovr to compile 
javascript files instead of running a separate server.

Looking through the plovr code it seemed that the easiest way to accomplish 
this was for me to subclass the CompilerRequestHandler and InputFileHandler 
classes and issue doGet calls (with a mocked-up HttpExchange).  In order to 
implement this approach, I needed to make both of those classes public and 
non-final.  Would you be willing to make CompilerRequestHandler and 
InputFileHandler public and non-final in your code, or is there a better way 
(perhaps by making doGet public instead of protected)?

Also, I added two functions to Manifest.java:

public Set<File> getDependencies() {
  // alternatively, just return dependencies without making a copy?
  return ImmutableSet.copyOf(dependencies);
}

public List<JsInput> getRequiredInputs() {
  // alternatively, just return requiredInputs without making a copy?
  return ImmutableList.copyOf(requiredInputs);
}

Would you be willing to add these functions?

Thanks for a terrific tool!  I'm much more productive.

-dallan

Original issue reported on code.google.com by dallan on 16 Dec 2010 at 7:12

GoogleCodeExporter commented 8 years ago
Hi dallan, I would love to make it possible for plovr to integrate better with 
play! I should have time to take care of this over the holidays.

Cheers,
Michael

Original comment by bolinf...@gmail.com on 21 Dec 2010 at 6:24

GoogleCodeExporter commented 8 years ago
Thank you!  Feel free to let me know if you have any questions or if I can help 
in any way.  dallan at gmail

Original comment by dallan on 27 Dec 2010 at 12:12

GoogleCodeExporter commented 8 years ago
Fixed in 
http://code.google.com/p/plovr/source/detail?r=fe3136c9fb0f31cf2d0c7471b4cc9bea1
b45cc06

FYI, ImmutableSet.copyOf(set) is constant time -- it does an instanceof check 
to see whether set is an ImmutableSet, and if so, returns it directly rather 
than making a copy. I decided to leave the extra copyOf() call in there in case 
it is ever removed from the constructor.

Original comment by bolinf...@gmail.com on 2 Jan 2011 at 10:52

GoogleCodeExporter commented 8 years ago
Thank you!  

BTW, thank-you for the explanation of how you incorporated closure-library into 
plovr. I've been wondering how to do that.

Also, I'm going to be merging my plovr extension for the Play! framework into 
the already-existing googleclosure module: 
http://www.playframework.org/modules/googleclosure

Original comment by dallan on 6 Jan 2011 at 4:37