RC-Paves3-build / plovr

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

Equal resource subpaths raise IllegalArgumentException #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In a larger project we're relying on being able to override templates on a 
per-customer-basis.
The filesystem layout looks like:
base/foo/bar.soy
custom/foo/bar.soy
The soy-file in custom/ provides a customized template(under a custom 
namespace).
In js we then override the template to use like 'main.tmpl.bar = 
'custom.tmpl.bar', which worked nicely so far. 
However, using a current plovr build(based on @cabcfeaf75e6) prevents us from 
building(and serving) our source, raising the stacktrace shown below.

What steps will reproduce the problem?
1. create a plovr-based project with two folders('main', 'custom') which have 
the same subfolders & files (./foo/bar.soy for instance)
2. in the plovr-config's 'path' attr, add both folders {"paths":["main", 
"custom"]} 
3. try to build or serve the app

What is the expected output? What do you see instead?
Should ignore that the subpaths look equal and compile successful, maybe rather 
using absolute than relative paths as keys.

What version of the product are you using? On what operating system?
Fresh build @cabcfeaf75e6. Confirmed on Ubuntu 11.10 & Mac OS X Lion.

Please provide any additional information below.
Stacktrace:
java.lang.IllegalArgumentException: duplicate key: /foo/bar.soy
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115)
    at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72)
    at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:221)
    at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:207)
    at org.plovr.Manifest.getAllDependencies(Manifest.java:327)
    at org.plovr.Manifest.getJsInputByName(Manifest.java:261)
    at org.plovr.InputFileHandler.doGet(InputFileHandler.java:153)
        ...

Original issue reported on code.google.com by carsten.kraus on 8 Feb 2012 at 11:58

GoogleCodeExporter commented 8 years ago
Having a similar problem, but conflicting with the closure library itself: 
there's a deps.js file in our root.  Used to work fine, broken on the Feb '12 
release.

Original comment by amunroe-...@yelp.com on 23 Feb 2012 at 9:54

GoogleCodeExporter commented 8 years ago
See http://code.google.com/p/plovr/issues/detail?id=60 for a solution.

Original comment by carsten.kraus on 7 Mar 2012 at 5:43

GoogleCodeExporter commented 8 years ago
I believe that I have fixed this with a combination of the following changes:

http://code.google.com/p/plovr/source/detail?r=8079d6d7fc2a419846f6f41462d999d5b
b059c4b
http://code.google.com/p/plovr/source/detail?r=c962fdacd79b369ebc73fe2fb5de782d3
1dbfc52

It would be a big help if you could build plovr from head and verify that this 
fixes this issue.

Original comment by bolinf...@gmail.com on 2 May 2012 at 3:27

GoogleCodeExporter commented 8 years ago
Cool, just updated my working copy, build it and the problem disappeared.

Thanks!

Original comment by carsten.kraus on 2 May 2012 at 11:29

GoogleCodeExporter commented 8 years ago

Original comment by bolinf...@gmail.com on 2 May 2012 at 6:15