google-code-export / wro4j

Automatically exported from code.google.com/p/wro4j
1 stars 1 forks source link

Less4jProcessor doesn't process properly imports on windows platform #861

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Root cause:
Less4jProcessor.computeRelativeResourceUri returns path with backslashes on 
windows

Reported on github:
https://github.com/alexo/wro4j/issues/175

Original issue reported on code.google.com by alex.obj...@gmail.com on 25 Mar 2014 at 1:48

GoogleCodeExporter commented 9 years ago
Fixed in branch 1.7.x

Original comment by alex.obj...@gmail.com on 3 Apr 2014 at 7:27

GoogleCodeExporter commented 9 years ago
Great! 1.7.5 incomming too? :-)

Original comment by br...@noerremark.dk on 3 Apr 2014 at 7:37

GoogleCodeExporter commented 9 years ago
@brian, could you help with some tests? 
Before releasing 1.7.5 I need someone with windows platform to run tests on 
latest changes in branch 1.7.x. 

Original comment by alex.obj...@gmail.com on 3 Apr 2014 at 8:12

GoogleCodeExporter commented 9 years ago
Yeah, would love to, but I don't know how to build myself. You can send me 
binaries, and I can test it in our application.

Original comment by br...@noerremark.dk on 3 Apr 2014 at 8:23

GoogleCodeExporter commented 9 years ago
You can either checkout the project and run:

mvn clean test

Or use the latest snapshot (1.7.5-SNAPSHOT) version which is available on nexus 
snapshot repository: 
https://oss.sonatype.org/content/repositories/snapshots/ro/isdc/wro4j/

Original comment by alex.obj...@gmail.com on 3 Apr 2014 at 8:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hm, my config may be wrong, but here is what I have:

INFO  [WrapperSimpleAppMain] [WroFilter] wro4j version: 1.7.5-SNAPSHOT
INFO   | jvm 1    | main    | 2014/04/03 15:30:43.351 | INFO  
[WrapperSimpleAppMain] [WroFilter] wro4j configuration: 
ro.isdc.wro.config.jmx.WroConfiguration@bd1a97[
  cacheUpdatePeriod=0
  modelUpdatePeriod=0
  resourceWatcherUpdatePeriod=0
  resourceWatcherAsync=false
  gzipEnabled=false
  debug=true
  ignoreMissingResources=false
  disableCache=true
  cacheGzippedContent=false
  jmxEnabled=true
  wroManagerClassName=ro.isdc.wro.extensions.manager.ExtensionsConfigurableWroManagerFactory
  encoding=UTF-8
  mbeanName=DesktopWroFilter
  header=<null>
  connectionTimeout=2000
  parallelPreprocessing=false
  ignoreEmptyGroup=true
  ignoreFailingProcessor=false
  minimizeEnabled=true
]

...

DEBUG [hybrisHTTP34] [AbstractProcessorsFilter] processing resource: 
/assets/bootstrap/core.less
DEBUG [hybrisHTTP34] [ProxyFactory] genericType: interface 
ro.isdc.wro.config.ReadOnlyContext
DEBUG [hybrisHTTP34] [ProxyFactory] interfaces set: [interface 
ro.isdc.wro.config.ReadOnlyContext]
DEBUG [hybrisHTTP34] [ProviderFinder] searching for providers of type : 
interface ro.isdc.wro.model.resource.locator.support.LocatorProvider
DEBUG [hybrisHTTP34] [ProviderFinder] using java.util.ServiceLoader to 
lookupProviders
DEBUG [hybrisHTTP34] [ProviderFinder] searching for providers of type : 
interface ro.isdc.wro.util.provider.ConfigurableProvider
DEBUG [hybrisHTTP34] [ProviderFinder] using java.util.ServiceLoader to 
lookupProviders
DEBUG [hybrisHTTP34] [ProviderFinder] found provider: 
ro.isdc.wro.util.provider.DefaultConfigurableProvider@3f41e93b
DEBUG [hybrisHTTP34] [ProviderFinder] found provider: 
ro.isdc.wro.extensions.support.spi.DefaultConfigurableProvider@708b8b96
DEBUG [hybrisHTTP34] [BaseWroManagerFactory] Trying to use SmartWroModelFactory 
as default model factory
DEBUG [hybrisHTTP34] [ProviderFinder] searching for providers of type : 
interface ro.isdc.wro.model.resource.locator.support.LocatorProvider
DEBUG [hybrisHTTP34] [ProviderFinder] using java.util.ServiceLoader to 
lookupProviders
DEBUG [hybrisHTTP34] [ProviderFinder] searching for providers of type : 
interface ro.isdc.wro.util.provider.ConfigurableProvider
DEBUG [hybrisHTTP34] [ProviderFinder] using java.util.ServiceLoader to 
lookupProviders
DEBUG [hybrisHTTP34] [ProviderFinder] found provider: 
ro.isdc.wro.util.provider.DefaultConfigurableProvider@5564253
DEBUG [hybrisHTTP34] [ProviderFinder] found provider: 
ro.isdc.wro.extensions.support.spi.DefaultConfigurableProvider@80b56a1
DEBUG [hybrisHTTP34] [ProxyFactory] genericType: interface 
ro.isdc.wro.config.ReadOnlyContext
DEBUG [hybrisHTTP34] [ProxyFactory] interfaces set: [interface 
ro.isdc.wro.config.ReadOnlyContext]
DEBUG [hybrisHTTP34] [AbstractProcessorsFilter] Using 
ro.isdc.wro.extensions.processor.css.Less4jProcessor@1348488 processor
DEBUG [hybrisHTTP34] [WroRuntimeException] No locator is capable of handling 
uri: \assets\ext\bootstrap-3.0.3\less\variables.less
DEBUG [hybrisHTTP34] [AbstractProcessorsFilter] RuntimeException occured
ro.isdc.wro.WroRuntimeException: No locator is capable of handling uri: 
\assets\ext\bootstrap-3.0.3\less\variables.less
    at ro.isdc.wro.model.resource.locator.factory.AbstractUriLocatorFactory.locate(AbstractUriLocatorFactory.java:37)
    at ro.isdc.wro.model.resource.locator.factory.InjectableUriLocatorFactoryDecorator.locate(InjectableUriLocatorFactoryDecorator.java:35)
    at ro.isdc.wro.model.resource.locator.factory.InjectableUriLocatorFactoryDecorator.locate(InjectableUriLocatorFactoryDecorator.java:35)
    at ro.isdc.wro.extensions.processor.css.Less4jProcessor$RelativeAwareLessSource.computeRelative(Less4jProcessor.java:70)
    at ro.isdc.wro.extensions.processor.css.Less4jProcessor$RelativeAwareLessSource.relativeSource(Less4jProcessor.java:63)
        ...

---

Both core.less and variables.less exist at the locations and WroFilter is doing 
it correct.

Original comment by br...@noerremark.dk on 4 Apr 2014 at 7:03

GoogleCodeExporter commented 9 years ago
That means that the issue is still not fixed in latest snapshot. I have an idea 
and will try to fix it today. I will need your help to test it again later.

Original comment by alex.obj...@gmail.com on 4 Apr 2014 at 7:06

GoogleCodeExporter commented 9 years ago
I would love to, just say when you are ready.

Original comment by br...@noerremark.dk on 4 Apr 2014 at 7:08

GoogleCodeExporter commented 9 years ago
Please, do now and let me know if that works.

Original comment by alex.obj...@gmail.com on 4 Apr 2014 at 7:30

GoogleCodeExporter commented 9 years ago
Now I got:

[Less4jProcessor] Failed to compile less resource: 
ro.isdc.wro.model.resource.Resource@bf5ba53[CSS,/assets/bootstrap/core.less,true
].
[Less4jProcessor] 19:2 Could not find mixin named "#gradient.vertical"..

But core.less works as part of a group?

Original comment by br...@noerremark.dk on 4 Apr 2014 at 11:41

GoogleCodeExporter commented 9 years ago
The mixin would be found if you would use less4j as postProcessor. When used as 
preProcessor, each resource has to be processed individually.

Assuming that, I'm marking this issue as fixed and will release new version 
shortly.
Let me know if that is ok with you.

Original comment by alex.obj...@gmail.com on 4 Apr 2014 at 11:45

GoogleCodeExporter commented 9 years ago
But I use Less4jFilter?

Original comment by br...@noerremark.dk on 4 Apr 2014 at 1:41

GoogleCodeExporter commented 9 years ago
If you are using Less4jFilter, then the less4j processor will be applied only 
on requested resource (including the resources it imports). Less4jFilter 
doesn't care about groups or wro model at all.

Original comment by alex.obj...@gmail.com on 4 Apr 2014 at 1:43

GoogleCodeExporter commented 9 years ago
This is an import, and in the original issue that led to The filter, imports 
was needed?

Original comment by br...@noerremark.dk on 4 Apr 2014 at 1:51

GoogleCodeExporter commented 9 years ago
Could we use https://gitter.im/alexo/wro4j to chat? I'm not sure I understand 
you correctly.

Original comment by alex.obj...@gmail.com on 4 Apr 2014 at 1:54