Skip to content

Conversation

erwan
Copy link
Contributor

@erwan erwan commented Sep 14, 2011

Here is a pull request to be able to use LessCss with Rhino (Javascript for the JDK). The advantage is that over NodeJS is that you can embedd rhino.jar in a repository, and as soon as there is Java installed on a machine you can compile less files to css.

In particular, you can make it an ant task that will not require you to have NodeJS or anything else installed on your machine.

Example:

<!-- Compile LessCSS -->
<macrodef name="lessjs">
    <attribute name="input" />
    <attribute name="output" />
    <sequential>
        <java jar="./${dir.build.tools}/${tool.rhino}" fork="true" output="@{output}">
            <arg path="./${dir.build.tools}/${tool.less}" />
            <arg path="@{input}" />
        </java>
        <echo>Lessjs: generated @{output}</echo>
    </sequential>
</macrodef>

<target name="compilecss">
    <lessjs input="./public/css/main.less" output="./public/css/main.css" />
</target>

(Note: new request created after a merge)

@marceloverdijk
Copy link

+1

I don't know the actual quality of the provided code (I'm not a Javascript guy) but 'native' Rhino support in LESS JS compiler would be great.
I'm working on a Maven plugin under the Codehaus Mojo umbrella and I'm also using Rhino.
There have been few Java projects provding Java compilation already but each is different but all of them have to do stuff to resolve imports. I'm now also experimenting myself using Rhino and EnvJs but off course I would prefer better integration as proposed by erwan.

How does this project about such integration, and what timeframes should we think then?

@cloudhead
Copy link
Member

A lot of people are using LESS with java, I think this is a good addition.

cloudhead pushed a commit that referenced this pull request Sep 15, 2011
@cloudhead cloudhead merged commit 7739fb1 into less:master Sep 15, 2011
@marceloverdijk
Copy link

Great news. When are you planning for a new a release containing this?

stefanklug pushed a commit to stefanklug/carto that referenced this pull request Sep 13, 2015
Add style folding optimization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants