Skip to content

Commit

Permalink
search only in root and subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
caumond committed Sep 9, 2023
1 parent d8fdcd5 commit 9729eb2
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 24 deletions.
47 changes: 26 additions & 21 deletions bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,33 @@
[babashka.fs :as fs]]
test {:doc "Test"
:task (run-process (fn []
(-> (p/process ["clj" "-M:runner"]
(to-out)))))}
(p/process ["clj" "-M:runner"]
(to-out))))}
lint {:doc "Lint"
:task (run-process (fn []
(-> (p/process ["clj-kondo"
"--lint"
"src/clj" "src/cljc"
;"resources"
"env/dev/src/clj" "env/dev/resources"
;"env/dev/src/cljc"
"test/clj" "test/cljc" "test/resources"]
(to-out)))))}
(p/process ["clj-kondo"
"--lint"
"src/clj" "src/cljc"
;"resources"
"env/dev/src/clj"
"env/dev/resources"
"env/test/resources"
;"env/test/src/clj"
;"env/test/src/cljc"
;"env/dev/src/cljc"
"test/clj" "test/cljc"
"test/resources"]
(to-out))))}
repl {:doc "Repl"
:task (run-process (fn []
(-> (p/process ["clj" "-M:repl"]
(to-out)))))}
#_(comment
test-frontend {:doc "Test frontend"
:task (run-process (fn []
(-> (p/process ["npm" "install"]
(to-out)))
(-> (p/process ["npx" "shadow-cljs" "compile" "karma-test"]
(to-out)))
(-> (p/process ["npx" "karma" "start" "--single-run"]
(to-out)))))})}}
(p/process ["clj" "-M:repl"]
(to-out))))}
;; (test-frontend {:doc "Test frontend"
;; :task (run-process (fn []
;; (-> (p/process ["npm" "install"]
;; (to-out)))
;; (-> (p/process ["npx" "shadow-cljs" "compile" "karma-test"]
;; (to-out)))
;; (-> (p/process ["npx" "karma" "start" "--single-run"]
;; (to-out)))))})
}}
3 changes: 2 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:aliases {:cljs-paths {:extra-paths []}
:repl {:extra-paths ["env/dev/src/clj" "env/dev/src/cljc" "env/dev/resources"
"test/clj" "test/cljc" "test/resources"]
:main-opts ["-m" "automaton-core.core"],
:main-opts ["-m" "automaton-core.repl-core"],
:jvm-opts ["-Dlog4j2.configurationFile=log4j2.xml"
"-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory"
"-Dclojure.spec.compile-asserts=true"],
Expand All @@ -32,6 +32,7 @@
:sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"},
org.clojure/tools.reader #:mvn{:version "1.3.6"}},
:extra-paths ["env/dev/src/clj" "env/dev/src/cljc" "env/dev/resources"
"env/test/resources"
"test/clj" "test/cljc" "test/resources"]
:jvm-opts ["-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory"
"-Dlog4j.configurationFile=log4j2-silent.xml"],
Expand Down
24 changes: 24 additions & 0 deletions env/dev/src/clj/automaton_core/repl_core.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(ns automaton-core.repl-core
"Gather all components to app
This core is for test only, if you need a repl running only automaton-core code"
(:require
[automaton-core.configuration.core]
[automaton-core.i18n.language.lang-core]
[automaton-core.repl :as core-repl]
[automaton-core.i18n.translate.translate-core]
[automaton-core.log :as log]
[mount.core :as mount]
[clojure.core.async :refer [go chan <!]]
[mount.tools.graph :as graph])
(:gen-class))

(defn -main
"Main entry point for repl"
[& _args]
(log/info "Start `automaton-core`")
(log/trace "Component dependencies: " (graph/states-with-deps))
(mount/start)
(core-repl/start-repl)
(let [c (chan 1)]
(go
(<! c))))
14 changes: 14 additions & 0 deletions env/test/resources/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{:env :dev
:app-name "automaton-core"
:archi {:dir "docs/archi/"}
:customer-materials {:dir "docs/customer_materials"
:tmp-html-dir "tmp/pdf/htmls"
:tmp-dir "tmp/pdf"}
:published-apps {:dir "tmp"
:code-subdir "code-pub"}
:documentation {:codox "docs/codox"
:code-stats "docs/code/stats.md"
:code-subdir "docs/code"}
:log {:spitted-edns "tmp/logs/spitted"}
:tests {:tmp-dirs "tmp/tests"}
:dev {:clj-nrepl-port 8010}}
2 changes: 1 addition & 1 deletion log4j2.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Configuration status="WARN" monitorInterval="1">
<Properties>
<Property name="basePath">logs/</Property>
<Property name="basePath">tmp/logs/</Property>
</Properties>

<Appenders>
Expand Down
4 changes: 3 additions & 1 deletion src/clj/automaton_core/adapters/build_config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
Useful to discover applications
Search in the local directory, useful for application repo
and in subdir, useful for monorepo
It is important not to search everywehere in the paths as `tmp` directories may contains unwanted `build_config.edn` files
Params:
* none
Returns the list of directories with `build_config.edn` in it"
([config-path]
(->> (files/search-files config-path
(str "**" build-config-filename))
(str "{*/" build-config-filename ",*/*/" build-config-filename "}"))
flatten
(filter (comp not nil?))))
([] (search-for-build-config "")))
Expand Down

0 comments on commit 9729eb2

Please sign in to comment.