GithubHelp home page GithubHelp logo

Comments (2)

softprops avatar softprops commented on August 17, 2024

Hi @sroebuck. Thanks for trying out the plugin. You are almost there :)

First, a quick note on best practices.

You should be noticing a change in how newer sbt plugins are developed and how keys are exposed. The collective plugin community and (with Marks input) have decided on a new design based on best practices.

The old design used configs for namespaces which was kind of bastardizing what configs are for. So you should see less of this

myplugin:mykey

and more of

 somekey(for someTaskKey)

While I agree thats less than ideal you should start seeing a new repl syntax for task dependent keys in upcoming sbt releases.

Another part of the best practices doc is on reusing exisiting keys. There is no targetDirectory in the less plugin but there is a resourceManaged key defined by sbt but scoped to the less task. Checkout the readme for a full list of keys I use.

Keys are also used within provided scopes rather than custom scopes now. Below is want you want to use

In your build file, add

 (resourceManaged in (Compile, LessKeys.less)) <<= (crossTarget in Compile)(_ / "webapp_managed" / "css")

which should result in the following repl behavior

 > compile:resource-managed(for less)
 [info] /Users/dougtangren/Desktop/tests/lesstest/target/scala-2.9.1/webapp_managed/css
 > less
 [info] Compiling 2 less files to /Users/dougtangren/Desktop/tests/lesstest/target/scala-2.9.1/webapp_managed/css
 [success] Total time: 1 s, completed Oct 2, 2011 7:46:36 PM

Since changing the default location or where less css files are written to is probably a common question I'll add that to the readme as well.

Have fun!

from less-sbt.

melezov avatar melezov commented on August 17, 2024

Just wanted to thank for the explanation, and confirm that the following combo is now working perfectly:

 temporaryWarPath <<= (sourceDirectory in Compile)(_ / "webapp"),
(resourceManaged in (Compile, LessKeys.less)) <<= webappResources(_.get.head / "static" / "less")

from less-sbt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.