mloayzagahona / plovr

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

add support for multiple configs in plovr build mode #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As we discussed, it would probably be easy to add support for multiple config 
files in serve mode.  Would be a good feature to have (and necessary for us to 
use serve mode over here at yelp :p)

Original issue reported on code.google.com by onicho...@gmail.com on 20 Oct 2011 at 10:21

GoogleCodeExporter commented 9 years ago
this seems to work already.  all the plovr URLs have a config id in them 
somewhere, so if you run:

java -jar plovr.jar config1.js config2.js config3.js

then all of these do the right thing:

http://localhost:9810/compile?id=config1
http://localhost:9810/compile?id=config2
http://localhost:9810/compile?id=config3
http://localhost:9810/modules?id=config2
http://localhost:9810/module/config2/module_name
http://localhost:9810/list?id=config2&module=module_name

etc.

config id is retrieved here: 
http://code.google.com/p/plovr/source/browse/src/org/plovr/AbstractGetHandler.ja
va#48

Original comment by lexyee...@gmail.com on 28 Oct 2011 at 1:09

GoogleCodeExporter commented 9 years ago
I just updated the bug description: this was supposed to be about build mode, 
which currently accepts only a single config.

Should be easy enough to fix.

Originally it did not make sense before 
http://plovr.com/options.html#output-file existed because there would be no way 
to distinguish the outputs from the different configs.

Original comment by bolinf...@gmail.com on 28 Oct 2011 at 4:07

GoogleCodeExporter commented 9 years ago
Actually, I believe this is already working. Take a look at BuildCommand.java:

http://code.google.com/p/plovr/source/browse/src/org/plovr/cli/BuildCommand.java

There is a "for (String configFile: arguments) {" loop that will compile each 
config passed in.

Marking as fixed -- feel free to reopen if you see this is not working for you.

I recommend using the output-file config option 
(http://plovr.com/options.html#output-file) if you are building multiple 
configs at once, or else everything will be printed to stdout. Note this is not 
necessary if you are using module-output-path 
(http://plovr.com/options.html#module-output-path) because then plovr is 
already writing to files rather than standard out.

Original comment by bolinf...@gmail.com on 5 Nov 2011 at 2:34