lein-garden icon indicating copy to clipboard operation
lein-garden copied to clipboard

lein-garden 0.2.5 and higher results in error message when compiling css

Open jborden opened this issue 10 years ago • 3 comments
trafficstars

When I try to compile a css file from a a file using lein-garden version 0.2.5 or 0.2.6, I receive the following message:

$ lein25 garden once
 Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: liberteriat.core/main in this context, compiling:(/private/var/folders/fj/61h6zcld4pxf_tm48pjxvv600000gn/T/form-init5526322326835505919.clj:1:597)
...
Caused by: java.lang.RuntimeException: Unable to resolve var: liberteriat.core/main in this context
    at clojure.lang.Util.runtimeException(Util.java:221)
    at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:698)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:6723)

Input file (src/styles/liberteriat/core.clj):

(ns liberteriat.core
  (:require [garden.def :refer [defstylesheet defstyles]]
                [garden.stylesheet :refer [at-media]]))

(defstyles main
  [:.center-content {:width "960px" :margin "0 auto"}]
  [:body {:min-width "960px"
          :background-color (:body-background colorscheme-2)
          :margin 0
          :padding 0
          :text-align "center !important"
          :font-family "Helvetica,Arial,sans-serif"}]
  [:#main-content {:margin-top "4.0em"}]
  #_ [:canvas {:margin-top "4.0em !important"}]
  [:.highscore {:color "white"}]
  [:h2 {:color "white"
        :font-family "Helvetica,Arial,sans-serif"
        :font-size "1.5em"
        :margin-top "1.0em"}]
  [:h1 {:color "white"
        :font-family "Helvetica,Arial,sans-serif"
        :font-size "2.0em"
        :margin-top "1.0em"
        :margin-bottom "1.0em"}]
  [:.app-store-large-icon-default {:float      "right"
                                   :margin-top "1em"}])

project.clj:

(defproject liberteriat "0.1.0-SNAPSHOT"
  :description "The Liberteriat"
  :url "http://example.com/FIXME"
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "0.0-3308"]
                 [compojure "1.3.4"]
                 [ring/ring-json "0.3.1"]
                 [hiccup "1.0.5"]
                 [garden "1.2.5"]
                 [korma "0.4.0"]
                 [mysql/mysql-connector-java "5.1.33"]
                 [org.clojure/java.jdbc "0.3.5"]
                 [lein-swank "1.4.5"]
                 [com.cemerick/valip "0.3.2"]
                 [ring-cors "0.1.6"]
                 [org.clojure/tools.nrepl "0.2.7"]
                 ;;[org.clojure/data.xml "0.0.8"]
                 ;;[clj-tagsoup "0.3.0"]
                 [enlive "1.1.5"]
                 ]
  :plugins [[lein-ring "0.8.12"]
            [lein-cljsbuild "1.0.6"]
            [lein-garden "0.2.4"]
            [cider/cider-nrepl "0.9.0-SNAPSHOT"]]
  :ring {:handler liberteriat.handler/app}
  :profiles
  {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
                        [ring-mock "0.1.5"]]}}
  :cljsbuild {:builds {:dev {:source-paths ["src/cljs"]
                             :compiler {:output-to "resources/public/js/main.js"
                                        :optimizations :whitespace
                                        :pretty-print true}}}}
  :garden {:builds [{
                     :id "main"
                     :source-paths ["src/styles"]
                     :stylesheet liberteriat.core/main
                     :compiler {:output-to "resources/public/css/main.css"
                                :pretty-print? true}}]})

This will compile fine with version 0.2.1 to 0.2.4

jborden avatar Jul 02 '15 23:07 jborden

This may have something to do with the newest version of Clojure. Are you able to verify this will work for 1.6.x?

noprompt avatar Jul 03 '15 05:07 noprompt

I did try it with Clojure 1.6.0... same results.

jborden avatar Jul 03 '15 13:07 jborden

I can confirm that this is still an issue. Using 0.2.4 works :)

hkjels avatar Aug 13 '15 12:08 hkjels