在Clojure中自动完成任务

时间:2016-07-16 19:07:19

标签: clojure clojurescript leiningen

我的 project.clj

中有以下内容
:aliases {
        "start-server" ["ring" "server-headless"]
        "build-site" ["run" "-m" "cjohansen-no.web/export"]
        "build-html" ["run" "-m" "cjohansen-no.web/export-pages"]
        "build-prod" ["do" ["build-site"] ["cljsbuild" "once" "prod"]]
        "build-js" ["cljsbuild" "auto" "dev"]
        "watch-stuff" [ "do" ["start-server"] ["auto" "build-html"]]
        "build-dev" ["do" ["build-site"] ["build-js"] ["watch-stuff"]]
            }
  :clean-targets [:target-path "./build/js/out"
                  :compile-path "classes"
                  :output-paths "./build/js/output"
                  "build/js/main.js.map"
                  ]
  :auto {"build-html" {:file-pattern #"\.(clj|hiccup)$" :paths ["src" "resources"]}}
  :clean-non-project-classes true
  :cljsbuild {
    :builds [{
      :id "dev"
      :source-paths ["src/cljs"]
      ; :figwheel {
      ;   :http-server-root "build"
      ;   :css-dirs ["resources/public/css"]
      ; }
      :compiler {
             :main scripts.core,
             :output-to "build/js/main.js",
             :output-dir "build/js/out",
             :optimizations :none,
             :source-map true,
             :source-map-timestamp true,
             :recompile-dependents false
           }
      },
      {
        :id "prod"
        :source-paths ["src/cljs"]
        :compiler {
               :main scripts.core,
               :output-to "build/js/main.js",
               :output-dir "build/js/output"
               :optimizations :simple,
               :source-map "build/js/main.js.map",
               :asset-path "js/out"
               :pretty-print true
             }
        }
      ]
  }

我正在尝试通过使用别名来自动化我的构建,但似乎没有完全一起...

运行lein build-dev除了运行[lien-auto]插件和响铃服务器的“watch-stuff”之外,其他所有内容都会运行,但它似乎无法运行。

在构建输出中,最后发生的事情是

  

在编译ClojureScript之前注意更改...   从[“src / cljs”]编译“build / js / main.js”...   警告:测试已经引用:cljs.core / test被替换为:> scripts.core / test在第5行src / cljs / scripts / core.cljs   在4.54秒内成功编译了“build / js / main.js”。

有什么能阻止这个吗?如何在clojure中自动执行此操作?

更新

我一直在移动东西,似乎在某些情况下,特定任务通常会进入其进程....不确定这是否会导致之后执行的任务被暂停...是吗?

e.g。如果“ring”“server-headless”在“build-site”构建站点运行之前运行...

我如何完成任务并继续下一个任务?

P.S。 Gulp和Grunt从未如此努力叹息

0 个答案:

没有答案