Skip to content
This repository was archived by the owner on Jan 9, 2019. It is now read-only.

Commit c434379

Browse files
author
Sandro Boehme
committed
Integrated less 1.7.0 and fixed sandroboehme/lesscss-maven-plugin#1. The next less.js release should have that fixed already. See less/less.js#1956.
1 parent 3ffb30c commit c434379

File tree

7 files changed

+576
-201
lines changed

7 files changed

+576
-201
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.lesscss</groupId>
55
<artifactId>lesscss</artifactId>
6-
<version>1.6.1-SNAPSHOT</version>
6+
<version>1.7.0.1.0-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<name>Official LESS CSS Compiler for Java</name>
99
<description>Official LESS CSS Compiler for Java</description>

src/main/java/org/lesscss/LessCompiler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public class LessCompiler {
6565

6666
private static final LessLogger logger = LessLoggerFactory.getLogger(LessCompiler.class);
6767

68-
private URL lessJs = LessCompiler.class.getClassLoader().getResource("META-INF/less-rhino-1.6.1.js");
69-
private URL lesscJs = LessCompiler.class.getClassLoader().getResource("META-INF/lessc-rhino-1.6.1.js");
68+
private URL lessJs = LessCompiler.class.getClassLoader().getResource("META-INF/less-rhino-1.7.0.js");
69+
private URL lesscJs = LessCompiler.class.getClassLoader().getResource("META-INF/lessc-rhino-1.7.0.js");
7070
private List<URL> customJs = Collections.emptyList();
7171
private List<String> options = Collections.emptyList();
7272
private Boolean compress = null;

src/main/resources/META-INF/less-rhino-1.6.1.js renamed to src/main/resources/META-INF/less-rhino-1.7.0.js

Lines changed: 559 additions & 190 deletions
Large diffs are not rendered by default.

src/main/resources/META-INF/lessc-rhino-1.6.1.js renamed to src/main/resources/META-INF/lessc-rhino-1.7.0.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* LESS.js v1.6.1 RHINO | Copyright (c) 2009-2014, Alexis Sellier <[email protected]> */
1+
/* LESS.js v1.7.0 RHINO | Copyright (c) 2009-2014, Alexis Sellier <[email protected]> */
22

33
/*global name:true, less, loadStyleSheet, os */
44

@@ -57,7 +57,8 @@ function formatError(ctx, options) {
5757
function writeError(ctx, options) {
5858
options = options || {};
5959
if (options.silent) { return; }
60-
print(formatError(ctx, options));
60+
var message = formatError(ctx, options);
61+
throw new Error(message);
6162
}
6263

6364
function loadStyleSheet(sheet, callback, reload, remaining) {

src/test/java/integration/LessExceptionIT.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@
1717
import static org.junit.Assert.assertTrue;
1818

1919
import org.junit.Test;
20+
import org.lesscss.LessException;
2021

2122
public class LessExceptionIT extends AbstractCompileIT {
2223

2324
@Test
2425
public void testException() throws Exception {
25-
String output = lessCompiler.compile("a { color: @linkColor; }");
26-
assertTrue(output.startsWith("NameError: variable @linkColor is undefined in"));
26+
try {
27+
lessCompiler.compile("a { color: @linkColor; }");
28+
} catch (LessException e) {
29+
String exceptionMsg = e.getMessage();
30+
assertTrue(exceptionMsg!=null && exceptionMsg.startsWith("NameError: variable @linkColor is undefined in"));
31+
}
2732
}
2833
}

src/test/java/org/lesscss/LessCompilerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class LessCompilerTest {
8080

8181
@Mock private URL lessJsFile;
8282
@Mock private URLConnection lessJsURLConnection;
83-
private static final String lessJsURLToString = "less-rhino-1.6.1.js";
83+
private static final String lessJsURLToString = "less-rhino-1.7.0.js";
8484
@Mock private InputStream lessJsInputStream;
8585
@Mock private InputStreamReader lessJsInputStreamReader;
8686

@@ -106,8 +106,8 @@ public void setUp() throws Exception {
106106

107107
@Test
108108
public void testNewLessCompiler() throws Exception {
109-
assertEquals(LessCompiler.class.getClassLoader().getResource("META-INF/less-rhino-1.6.1.js"), FieldUtils.readField(lessCompiler, "lessJs", true));
110-
assertEquals(LessCompiler.class.getClassLoader().getResource("META-INF/lessc-rhino-1.6.1.js"), FieldUtils.readField(lessCompiler, "lesscJs", true));
109+
assertEquals(LessCompiler.class.getClassLoader().getResource("META-INF/less-rhino-1.7.0.js"), FieldUtils.readField(lessCompiler, "lessJs", true));
110+
assertEquals(LessCompiler.class.getClassLoader().getResource("META-INF/lessc-rhino-1.7.0.js"), FieldUtils.readField(lessCompiler, "lesscJs", true));
111111
assertEquals(Collections.EMPTY_LIST, FieldUtils.readField(lessCompiler, "customJs", true));
112112
}
113113

src/test/resources/compatibility/css/functions.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
format: "rgb(32, 128, 64)";
1818
format-string: "hello world";
1919
format-multiple: "hello earth 2";
20-
format-url-encode: "red is %23ff0000";
20+
format-url-encode: 'red is %23ff0000';
2121
eformat: rgb(32, 128, 64);
2222
hue: 98;
2323
saturation: 12%;

0 commit comments

Comments
 (0)