<commit_before>;; Copyright © 2016, JUXT LTD.

(set-env!
 :target-path "target/dev"
 :source-paths #{"sass" "src" "resources"}
 :asset-paths #{"assets"}
 :dependencies
 '[[io.dominic/boot-cljs "1.7.228-3" :scope "test"]
   [adzerk/boot-cljs-repl "0.3.0" :scope "test"]
   [adzerk/boot-reload "0.4.0" :scope "test"]
   [deraen/boot-less "0.5.0"]
   [mathias/boot-sassc "0.1.5" :scope "test"]
   [org.clojure/clojure "1.8.0"]
   [org.clojure/tools.nrepl "0.2.12"]
   [org.clojure/tools.logging "0.3.1"]
   [org.slf4j/jcl-over-slf4j "1.7.13"]
   [org.slf4j/jul-to-slf4j "1.7.13"]
   [org.slf4j/log4j-over-slf4j "1.7.13"]
   [ch.qos.logback/logback-classic "1.1.3" :exclusions [org.slf4j/slf4j-api]]
   ;; Needed for start-repl in cljs repl
   [com.cemerick/piggieback "0.2.1" :scope "test"]
   [org.clojure/clojurescript "1.7.170"]
   [weasel "0.7.0" :scope "test"];; Websocket Server
   [io.dominic/boot-snippets "0.1.0" :scope "test"]])

(require '[adzerk.boot-cljs :refer [cljs]]
         '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
         '[adzerk.boot-reload :refer [reload]]
         '[boot.pod :as pod]
         '[clojure.java.shell :as sh]
         '[mathias.boot-sassc :refer [sass]]
         '[io.dominic.boot-snippets :refer [with-env]])

(def server-deps
  '[[aleph "0.4.1-beta3"]
    [bidi "1.24.0"]
    [hiccup "1.0.5"]
    [org.omcljs/om "1.0.0-alpha28"]
    [yada "1.1.0-20160126.014942-13"]

    [com.stuartsierra/component "0.3.1"]
    
    [reloaded.repl "0.2.1"]
    [prismatic/schema "1.0.4"]
    [org.clojure/core.async "0.2.374"]
    [org.clojure/tools.reader "0.10.0"]

    [org.clojure/tools.logging "0.3.1"]
    [org.slf4j/jcl-over-slf4j "1.7.13"]
    [org.slf4j/jul-to-slf4j "1.7.13"]
    [org.slf4j/log4j-over-slf4j "1.7.13"]
    [ch.qos.logback/logback-classic "1.1.3"
     :exclusions [org.slf4j/slf4j-api]]

    [org.clojure/tools.namespace "0.2.10"]])

(deftask server
  "Develop the server backend"
  []
  (let [p (pod/make-pod
           {:dependencies (concat server-deps
                                  @@(resolve 'boot.repl/*default-dependencies*))
            :directories #{"src" "resources" "dev"}
            :middleware @@(resolve 'boot.repl/*default-middleware*)})]

    (pod/with-eval-in p
      (require '[boot.pod :as pod])
      (require '[boot.repl])
      (require '[clojure.tools.namespace.repl :as repl])
      (apply repl/set-refresh-dirs (-> pod/env :directories))

      (boot.repl/launch-nrepl {:init-ns 'user :port 5700 :server true
                               :middleware (:middleware pod/env)}))
    identity)) ;; Return identity so that composition works

(deftask frontend
  "Simple alias to run frontend application"
  []<commit_msg>Update server task to auto-start the system<commit_after>;; Copyright © 2016, JUXT LTD.

(set-env!
 :target-path "target/dev"
 :source-paths #{"sass" "src" "resources"}
 :asset-paths #{"assets"}
 :dependencies
 '[[io.dominic/boot-cljs "1.7.228-3" :scope "test"]
   [adzerk/boot-cljs-repl "0.3.0" :scope "test"]
   [adzerk/boot-reload "0.4.0" :scope "test"]
   [deraen/boot-less "0.5.0"]
   [mathias/boot-sassc "0.1.5" :scope "test"]
   [org.clojure/clojure "1.8.0"]
   [org.clojure/tools.nrepl "0.2.12"]
   [org.clojure/tools.logging "0.3.1"]
   [org.slf4j/jcl-over-slf4j "1.7.13"]
   [org.slf4j/jul-to-slf4j "1.7.13"]
   [org.slf4j/log4j-over-slf4j "1.7.13"]
   [ch.qos.logback/logback-classic "1.1.3" :exclusions [org.slf4j/slf4j-api]]
   ;; Needed for start-repl in cljs repl
   [com.cemerick/piggieback "0.2.1" :scope "test"]
   [org.clojure/clojurescript "1.7.170"]
   [weasel "0.7.0" :scope "test"];; Websocket Server
   [io.dominic/boot-snippets "0.1.0" :scope "test"]])

(require '[adzerk.boot-cljs :refer [cljs]]
         '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
         '[adzerk.boot-reload :refer [reload]]
         '[boot.pod :as pod]
         '[clojure.java.shell :as sh]
         '[mathias.boot-sassc :refer [sass]]
         '[io.dominic.boot-snippets :refer [with-env]])

(def server-deps
  '[[aleph "0.4.1-beta3"]
    [bidi "1.24.0"]
    [hiccup "1.0.5"]
    [org.omcljs/om "1.0.0-alpha28"]
    [yada "1.1.0-20160126.014942-13"]

    [com.stuartsierra/component "0.3.1"]
    
    [reloaded.repl "0.2.1"]
    [prismatic/schema "1.0.4"]
    [org.clojure/core.async "0.2.374"]
    [org.clojure/tools.reader "0.10.0"]

    [org.clojure/tools.logging "0.3.1"]
    [org.slf4j/jcl-over-slf4j "1.7.13"]
    [org.slf4j/jul-to-slf4j "1.7.13"]
    [org.slf4j/log4j-over-slf4j "1.7.13"]
    [ch.qos.logback/logback-classic "1.1.3"
     :exclusions [org.slf4j/slf4j-api]]

    [org.clojure/tools.namespace "0.2.10"]])

(deftask server
  "Develop the server backend"
  []
  (let [p (pod/make-pod
           {:dependencies (concat server-deps
                                  @@(resolve 'boot.repl/*default-dependencies*))
            :directories #{"src" "resources" "dev"}
            :middleware @@(resolve 'boot.repl/*default-middleware*)})]

    (pod/with-eval-in p
      (require '[boot.pod :as pod])
      (require '[boot.repl])
      (require '[clojure.tools.namespace.repl :as repl])
      (apply repl/set-refresh-dirs (-> pod/env :directories))

      (boot.repl/launch-nrepl {:init-ns 'user :port 5600 :server true
                               :middleware (:middleware pod/env)})
      ;; Auto-start the system
      (require 'dev) ;; Set the init-system (stateful at namespace level)
      (require 'reloaded.repl)
      (reloaded.repl/go))
    identity)) ;; Return identity so that composition works

(deftask frontend
  "Simple alias to run frontend application"
  []
{'fraction_non_alphanumeric': 0.1921911214120164, 'fraction_numerical': 0.056338028169014086, 'mean_word_length': 2.6571056062581486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3452155', 'n_tokens_mistral': 2501, 'n_tokens_neox': 2409, 'n_words': 407}