google-code-export / wro4j

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

import-once not working #711

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey guys,

the 'import-once' statement is still not working with wro4j 1.6.3 and neither 
lesscss 1.3.3 nor less4j 1.0.3. Once I change '@import' to '@import-once' the 
compiler throws the following exception:

ERROR PreProcessorExecutor - Cannot ignore missing resource:  
ro.isdc.wro.model.resource.Resource@28f16811[CSS,/less/{insert file or 
directory here}/-once,true]

Obviously the @import statement is found and matched and the compiler tries to 
locate the following '-once' instead of parsing futher.

My less file structure is:

less/
  project.less
  bootstrap-2.3.2/*
  project/
    main.less
    components/*

To have autocompletion etc I would like to use 'import-once' in every component 
to include less mixins and variables. At present, this is not working at all.

Original issue reported on code.google.com by r8jed05j...@googlemail.com on 30 Apr 2013 at 9:07

GoogleCodeExporter commented 9 years ago
The @import-once statement is processed only by LessCssImportPreProcessor (with 
alias: "lessCssImport") which extends the CssImportPreProcessor. 

Original comment by alex.obj...@gmail.com on 30 Apr 2013 at 9:13

GoogleCodeExporter commented 9 years ago
Marking this issue as invalid, since the assumption that the correct processor 
is used is not met.

Feel free to reopen if you don't agree.

Original comment by alex.obj...@gmail.com on 30 Apr 2013 at 9:18

GoogleCodeExporter commented 9 years ago
Sorry guys, 

I forgot to mention: lessCssImport doesn't work either. Same error message:

0    ERROR PreProcessorExecutor - Cannot ignore missing resource:  
ro.isdc.wro.model.resource.Resource@7dbeb971[CSS,/less/project/components/X/-onc
e,true]

Property file:

preProcessors=lessCssImport
postProcessors=less4j

Original comment by r8jed05j...@googlemail.com on 30 Apr 2013 at 9:39

GoogleCodeExporter commented 9 years ago
Could you attach the sample less file?

Original comment by alex.obj...@gmail.com on 30 Apr 2013 at 9:45

GoogleCodeExporter commented 9 years ago
I've attached a simple test case using the configuration stated before (wro4j 
1.6.3, less4j 1.0.3). 

Property file:
managerFactoryClassName=org.meri.wro4j.nogroups.ConfigurationFreeManagerFactory
preProcessors=lessCssImport
postProcessors=less4j

Same error message:

0    ERROR PreProcessorExecutor - Cannot ignore missing resource:  
ro.isdc.wro.model.resource.Resource@49c2de5c[CSS,/lesstest/-once,true]
0    ERROR ExceptionHandlingProcessorDecorator - Failed to process the 
resource: 
ro.isdc.wro.model.resource.Resource@36f8008d[CSS,/lesstest/testcase.less,true] 
using processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@27058d3f. 
Reason: /X/src/main/lesstest/-once (No such file or directory)

Original comment by r8jed05j...@googlemail.com on 30 Apr 2013 at 10:08

Attachments:

GoogleCodeExporter commented 9 years ago
Where can I see the implementation of 
org.meri.wro4j.nogroups.ConfigurationFreeManagerFactory ?

Original comment by alex.obj...@gmail.com on 30 Apr 2013 at 10:12

GoogleCodeExporter commented 9 years ago
Could you try the ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory 
instead?

Original comment by alex.obj...@gmail.com on 30 Apr 2013 at 10:14

GoogleCodeExporter commented 9 years ago
Same result using

managerFactoryClassName=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactor
y

-
...
[INFO] wroManagerFactory class: 
ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory
...
0    ERROR PreProcessorExecutor - Cannot ignore missing resource:  
ro.isdc.wro.model.resource.Resource@62f19a7[CSS,/lesstest/components/-once,true]
1    ERROR ExceptionHandlingProcessorDecorator - Failed to process the 
resource: 
ro.isdc.wro.model.resource.Resource@2e5509a2[CSS,/lesstest/components/component.
less,true] using processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@5fc1fc8d. 
Reason: /X/lesstest/components/-once (No such file or directory)
1    ERROR ExceptionHandlingProcessorDecorator - Failed to process the 
resource: 
ro.isdc.wro.model.resource.Resource@50eb8271[CSS,/lesstest/testcase.less,true] 
using processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@5fc1fc8d. 
Reason: The processor: 
ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor@5fc1fc8d 
failed

Original comment by r8jed05j...@googlemail.com on 30 Apr 2013 at 10:24

GoogleCodeExporter commented 9 years ago
Ok, thanks for reporting. Will investigate the issue and hopefully will fix it 
for next release.

Original comment by alex.obj...@gmail.com on 30 Apr 2013 at 11:10

GoogleCodeExporter commented 9 years ago
Fixed in branch 1.6.x.

The cause of the problem: the lessCssImport alias was wrongly associated with 
CssImportPreProcessor instead of LessCssImportPreProcessor. The workaround 
until the next release is available is to override the lessCssImport alias 
explicitly with the LessCssImportPreProcessor.

Original comment by alex.obj...@gmail.com on 30 Apr 2013 at 4:31

GoogleCodeExporter commented 9 years ago

Original comment by alex.obj...@gmail.com on 8 Jun 2013 at 9:46