Skip to content
Snippets Groups Projects
Commit d6deb89c authored by Guillaume Delhumeau's avatar Guillaume Delhumeau
Browse files

XWIKI-11034: Use LESS4J for the implementation of LESSCompiler.

XWIKI-11394: Being able to overwrite a LESS file within a skin object.

* Fix.
parent f87fae3c
No related branches found
No related tags found
No related merge requests found
...@@ -36,8 +36,6 @@ public abstract class AbstractLESSSource extends LessSource ...@@ -36,8 +36,6 @@ public abstract class AbstractLESSSource extends LessSource
protected TemplateManager templateManager; protected TemplateManager templateManager;
protected Skin skin; protected Skin skin;
protected boolean useVelocity;
private String folder; private String folder;
......
...@@ -60,7 +60,7 @@ public String getContent(LESSResourceReference lessResourceReference, String ski ...@@ -60,7 +60,7 @@ public String getContent(LESSResourceReference lessResourceReference, String ski
LESSSkinFileResourceReference lessSkinFileResourceReference = LESSSkinFileResourceReference lessSkinFileResourceReference =
(LESSSkinFileResourceReference) lessResourceReference; (LESSSkinFileResourceReference) lessResourceReference;
Template template = templateManager.getTemplate(lessSkinFileResourceReference.getFileName(), Template template = templateManager.getTemplate("less/" + lessSkinFileResourceReference.getFileName(),
skinManager.getSkin(skin)); skinManager.getSkin(skin));
if (template == null) { if (template == null) {
throw new LESSCompilerException(String.format("The template [%s] does not exists.", throw new LESSCompilerException(String.format("The template [%s] does not exists.",
......
...@@ -18,7 +18,6 @@ org.xwiki.lesscss.internal.compiler.CachedIntegratedLESSCompiler ...@@ -18,7 +18,6 @@ org.xwiki.lesscss.internal.compiler.CachedIntegratedLESSCompiler
org.xwiki.lesscss.internal.compiler.DefaultIntegratedLESSCompiler org.xwiki.lesscss.internal.compiler.DefaultIntegratedLESSCompiler
org.xwiki.lesscss.internal.compiler.DefaultLESSCompiler org.xwiki.lesscss.internal.compiler.DefaultLESSCompiler
org.xwiki.lesscss.internal.compiler.DefaultLESSSkinFileCompiler org.xwiki.lesscss.internal.compiler.DefaultLESSSkinFileCompiler
org.xwiki.lesscss.internal.compiler.SkinDirectoryGetter
org.xwiki.lesscss.internal.resources.DefaultLESSResourceReader org.xwiki.lesscss.internal.resources.DefaultLESSResourceReader
org.xwiki.lesscss.internal.resources.DefaultLESSResourceReferenceSerializer org.xwiki.lesscss.internal.resources.DefaultLESSResourceReferenceSerializer
org.xwiki.lesscss.internal.resources.LESSObjectPropertyReader org.xwiki.lesscss.internal.resources.LESSObjectPropertyReader
......
...@@ -67,7 +67,7 @@ public void getContent() throws Exception ...@@ -67,7 +67,7 @@ public void getContent() throws Exception
{ {
// Mocks // Mocks
Template template = mock(Template.class); Template template = mock(Template.class);
when(templateManager.getTemplate("style.less", skin)).thenReturn(template); when(templateManager.getTemplate("less/style.less", skin)).thenReturn(template);
TemplateContent templateContent = mock(TemplateContent.class); TemplateContent templateContent = mock(TemplateContent.class);
when(template.getContent()).thenReturn(templateContent); when(template.getContent()).thenReturn(templateContent);
when(templateContent.getContent()).thenReturn("// My LESS file"); when(templateContent.getContent()).thenReturn("// My LESS file");
...@@ -115,7 +115,7 @@ public void getContentWhenException() throws Exception ...@@ -115,7 +115,7 @@ public void getContentWhenException() throws Exception
{ {
// Mocks // Mocks
Template template = mock(Template.class); Template template = mock(Template.class);
when(templateManager.getTemplate("file.less", skin)).thenReturn(template); when(templateManager.getTemplate("less/file.less", skin)).thenReturn(template);
Exception exception = new Exception("exception"); Exception exception = new Exception("exception");
when(template.getContent()).thenThrow(exception); when(template.getContent()).thenThrow(exception);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment