Skip to content
This repository was archived by the owner on Mar 15, 2021. It is now read-only.

Commit 62d6129

Browse files
committed
#3 #5 #7 #8 Upgrade dependencies, cleanup JavaScript files, update changelog
- upgrade Maven dependencies and libraries - use JDK6 - move JavaScript files to src/main/javascript - clean JavaScript code and remove unsupported parameters
1 parent 31cf9f4 commit 62d6129

File tree

10 files changed

+10026
-9564
lines changed

10 files changed

+10026
-9564
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# LessCSS Compiler Changelog
22

3+
## 2.0.0
4+
Features:
5+
* Added support for `HTTP`, `HTTPS`, `FTP` and `classpath` protocols
6+
* Added support for Source maps
7+
8+
[See documentation](http://lesscss-compiler.projects.gabrys.biz/2.0.0/)
9+
310
## 1.2.2
411
Bugs:
512
* Fixed support for `data-uri` function

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
# About
22
[![License BSD 3-Clause](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg)](http://lesscss-compiler.projects.gabrys.biz/license.txt)
3-
[![Build Status](https://travis-ci.org/gabrysbiz/lesscss-compiler.svg?branch=develop)](https://travis-ci.org/gabrysbiz/lesscss-compiler)
3+
[![Build Status](https://travis-ci.org/gabrysbiz/lesscss-compiler.svg?branch=feature%2F2.0)](https://travis-ci.org/gabrysbiz/lesscss-compiler)
44

5-
The LessCSS Compiler is a Java library which compiles [Less](http://lesscss.org/) source files to the [CSS](http://www.w3.org/Style/CSS/) code.
5+
The LessCSS Compiler is a Java library which compiles [Less](http://lesscss.org/) source files to [CSS](http://www.w3.org/Style/CSS/) code.
66

77
From [Less](http://lesscss.org/) website:
88
> Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables,
99
> mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable
1010
> and extendable.
1111
1212
# Compatibility
13-
The compiler is compatible with version [1.7.5](https://github.com/less/less.js/releases/tag/v1.7.5).
13+
The compiler is compatible with version [1.7.5](https://github.com/less/less.js/releases/tag/v1.7.5).
1414
The library is based on the official [Less](http://lesscss.org/) JavaScript compiler adapted to the
1515
[Rhino](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino) engine.
1616

17-
Restrictions:
18-
* cannot fetch sources from Internet, e.g. `@import (less) "http://example.org/style.less"`
19-
2017
# Requirements
2118
The compiler to run requires:
22-
* Java 5.0 or higher
19+
* Java 6.0 or higher
2320
* Third-Party Dependencies ([see list](http://lesscss-compiler.projects.gabrys.biz/LATEST/dependencies.html))
2421

2522
# Download
@@ -33,14 +30,5 @@ library by [Marcel Overdijk](https://github.com/marceloverdijk).
3330
# Usage
3431
How to compile a source file:
3532
```
36-
// create compiler & source file
37-
LessCompiler compiler = new LessCompilerImpl();
38-
File source = new File("/less/file.less");
39-
40-
// compile file with default options
41-
String cssCode = compiler.compile(source);
42-
43-
// set custom option: minify CSS code
44-
CompilerOptions options = new CompilerOptionsBuilder().setMinified(true).create();
45-
String cssMinifiedCode = compiler.compile(source, options);
33+
// TODO
4634
```

pom.xml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
<groupId>biz.gabrys.lesscss</groupId>
77
<artifactId>compiler</artifactId>
8-
<version>1.2.3-SNAPSHOT</version>
8+
<version>2.0.0-SNAPSHOT</version>
99
<name>LessCSS Compiler</name>
10-
<description>A Java library which compiles Less source files to the CSS code.</description>
10+
<description>A Java library which compiles Less source files to CSS code.</description>
1111
<url>http://lesscss-compiler.projects.gabrys.biz/LATEST/</url>
1212

1313
<inceptionYear>2015</inceptionYear>
@@ -76,8 +76,7 @@
7676
<dependency>
7777
<groupId>org.mozilla</groupId>
7878
<artifactId>rhino</artifactId>
79-
<!-- latest compatible with JDK 1.5 -->
80-
<version>1.7R5</version>
79+
<version>1.7.7.1</version>
8180
</dependency>
8281

8382
<dependency>
@@ -86,15 +85,30 @@
8685
<version>4.12</version>
8786
<scope>test</scope>
8887
</dependency>
88+
<dependency>
89+
<groupId>org.assertj</groupId>
90+
<artifactId>assertj-core</artifactId>
91+
<!-- latest compatible with JDK 1.6 -->
92+
<version>1.7.1</version>
93+
<scope>test</scope>
94+
</dependency>
8995
<dependency>
9096
<groupId>org.mockito</groupId>
9197
<artifactId>mockito-core</artifactId>
92-
<version>1.10.19</version>
98+
<version>2.7.2</version>
9399
<scope>test</scope>
94100
</dependency>
95101
</dependencies>
96102

97103
<build>
104+
<resources>
105+
<resource>
106+
<directory>src/main/resources</directory>
107+
</resource>
108+
<resource>
109+
<directory>src/main/javascript</directory>
110+
</resource>
111+
</resources>
98112
<pluginManagement>
99113
<plugins>
100114
<plugin>
@@ -107,7 +121,7 @@
107121
</plugin>
108122
<plugin>
109123
<artifactId>maven-compiler-plugin</artifactId>
110-
<version>3.6.0</version>
124+
<version>3.6.1</version>
111125
</plugin>
112126
<plugin>
113127
<artifactId>maven-deploy-plugin</artifactId>
@@ -139,11 +153,11 @@
139153
</plugin>
140154
<plugin>
141155
<artifactId>maven-resources-plugin</artifactId>
142-
<version>3.0.1</version>
156+
<version>3.0.2</version>
143157
</plugin>
144158
<plugin>
145159
<artifactId>maven-site-plugin</artifactId>
146-
<version>3.5.1</version>
160+
<version>3.6</version>
147161
</plugin>
148162
<plugin>
149163
<artifactId>maven-source-plugin</artifactId>
@@ -173,7 +187,7 @@
173187
<plugin>
174188
<groupId>org.jacoco</groupId>
175189
<artifactId>jacoco-maven-plugin</artifactId>
176-
<version>0.7.7.201606060606</version>
190+
<version>0.7.8</version>
177191
<configuration>
178192
<rules>
179193
<rule>
@@ -191,8 +205,8 @@
191205
<plugin>
192206
<artifactId>maven-compiler-plugin</artifactId>
193207
<configuration>
194-
<source>1.5</source>
195-
<target>1.5</target>
208+
<source>1.6</source>
209+
<target>1.6</target>
196210
<showDeprecation>true</showDeprecation>
197211
<showWarnings>true</showWarnings>
198212
</configuration>

src/main/java/biz/gabrys/lesscss/compiler/LessCompilerImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public LessCompilerImpl() {
9696
* @throws SyntaxException if a syntax error occurred during source file compilation.
9797
* @since 1.0
9898
*/
99+
@Override
99100
public String compile(final File source) throws CompilerException {
100101
return compile(source, new CompilerOptions());
101102
}
@@ -107,6 +108,7 @@ public String compile(final File source) throws CompilerException {
107108
* @throws SyntaxException if a syntax error occurred during source file compilation.
108109
* @since 1.0
109110
*/
111+
@Override
110112
public String compile(final File input, final CompilerOptions options) throws CompilerException {
111113
synchronized (mutex) {
112114
if (compiler == null) {
@@ -149,8 +151,8 @@ private void initialize() throws InitializationException {
149151
console = new ByteArrayOutputStream();
150152
global.setOut(new PrintStream(console, false, CHARSET));
151153

152-
final URL lessFile = LessCompilerImpl.class.getResource("/less/less-rhino-1.7.5.js");
153-
final URL lesscFile = LessCompilerImpl.class.getResource("/less/lessc-rhino-1.7.5.js");
154+
final URL lessFile = LessCompilerImpl.class.getResource("/biz/gabrys/lesscss/compiler2/less-rhino-1.7.5.js");
155+
final URL lesscFile = LessCompilerImpl.class.getResource("/biz/gabrys/lesscss/compiler2/lessc-rhino-1.7.5.js");
154156

155157
final Collection<InputStream> streams = new ArrayList<InputStream>();
156158
streams.add(lessFile.openConnection().getInputStream());

0 commit comments

Comments
 (0)