From 5a167ae0319535a417205115bfcf97a7bac0dc0c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 21 Nov 2016 23:44:57 +0100 Subject: [PATCH] Update scripts. --- frontend/scripts/build-main | 2 ++ frontend/scripts/build-main.clj | 23 +++++++++++++++++++++++ frontend/scripts/build-tests.clj | 1 - frontend/scripts/build-worker.clj | 1 - frontend/scripts/dist-main.clj | 1 - frontend/scripts/dist-view.clj | 1 - frontend/scripts/figwheel.clj | 6 ++---- frontend/scripts/watch-main | 2 ++ frontend/scripts/watch-main.clj | 18 ++++++++++++++++++ frontend/scripts/watch-tests.clj | 1 - frontend/scripts/watch-worker.clj | 1 - 11 files changed, 47 insertions(+), 10 deletions(-) create mode 100755 frontend/scripts/build-main create mode 100644 frontend/scripts/build-main.clj create mode 100755 frontend/scripts/watch-main create mode 100644 frontend/scripts/watch-main.clj diff --git a/frontend/scripts/build-main b/frontend/scripts/build-main new file mode 100755 index 000000000..f584caf69 --- /dev/null +++ b/frontend/scripts/build-main @@ -0,0 +1,2 @@ +#!/bin/sh +lein trampoline run -m clojure.main scripts/build-main.clj \ No newline at end of file diff --git a/frontend/scripts/build-main.clj b/frontend/scripts/build-main.clj new file mode 100644 index 000000000..4ab8a9f74 --- /dev/null +++ b/frontend/scripts/build-main.clj @@ -0,0 +1,23 @@ +(require '[cljs.build.api :as b]) + +(println "Building ...") + +(let [start (System/nanoTime)] + (b/build + (b/inputs "src") + {:main 'uxbox.main + :parallel-build false + :output-to "resources/public/js/main.js" + :source-map "resources/public/js/main.js.map" + :output-dir "resources/public/js/main" + :closure-defines {"uxbox.config.url" "https://test.uxbox.io/api" + "uxbox.config.viewurl" "https://test.uxbox.io/view/"} + :optimizations :advanced + :externs ["externs/main.js"] + :static-fns true + :elide-asserts true + :pretty-print false + :language-in :ecmascript6 + :language-out :ecmascript5 + :verbose true}) + (println "... done. Elapsed" (/ (- (System/nanoTime) start) 1e9) "seconds")) diff --git a/frontend/scripts/build-tests.clj b/frontend/scripts/build-tests.clj index 7fd811afc..3b0024082 100644 --- a/frontend/scripts/build-tests.clj +++ b/frontend/scripts/build-tests.clj @@ -7,7 +7,6 @@ (b/inputs "src" "test") {:main 'uxbox.tests.main :parallel-build false - :warnings {:ns-var-clash false} :output-to "out/tests.js" :source-map "out/tests.js.map" :output-dir "out/tests" diff --git a/frontend/scripts/build-worker.clj b/frontend/scripts/build-worker.clj index 35986eceb..5d9697d7d 100644 --- a/frontend/scripts/build-worker.clj +++ b/frontend/scripts/build-worker.clj @@ -7,7 +7,6 @@ (b/inputs "src") {:main 'uxbox.worker :parallel-build false - :warnings {:ns-var-clash false} :output-to "resources/public/js/worker.js" :source-map "resources/public/js/worker.js.map" :output-dir "resources/public/js/worker" diff --git a/frontend/scripts/dist-main.clj b/frontend/scripts/dist-main.clj index 63636b7d9..e87322745 100644 --- a/frontend/scripts/dist-main.clj +++ b/frontend/scripts/dist-main.clj @@ -7,7 +7,6 @@ (b/inputs "src") {:main 'uxbox.main :parallel-build false - :warnings {:ns-var-clash false} :output-to "dist/js/main.js" :source-map "dist/js/main.js.map" :output-dir "dist/js/main" diff --git a/frontend/scripts/dist-view.clj b/frontend/scripts/dist-view.clj index cfb1278b6..9d3f98a65 100644 --- a/frontend/scripts/dist-view.clj +++ b/frontend/scripts/dist-view.clj @@ -7,7 +7,6 @@ (b/inputs "src") {:main 'uxbox.view :parallel-build false - :warnings {:ns-var-clash false} :output-to "dist/js/view.js" :source-map "dist/js/view.js.map" :output-dir "dist/js/view/" diff --git a/frontend/scripts/figwheel.clj b/frontend/scripts/figwheel.clj index 3992d424a..bb77ce6e6 100644 --- a/frontend/scripts/figwheel.clj +++ b/frontend/scripts/figwheel.clj @@ -2,8 +2,8 @@ '[figwheel-sidecar.repl-api :as ra]) (def options - {;; "uxbox.config.url" "http://127.0.0.1:6060/api" - "uxbox.config.url" "https://test.uxbox.io/api" + {"uxbox.config.url" "http://127.0.0.1:6060/api" + ;; "uxbox.config.url" "https://test.uxbox.io/api" }) (ra/start-figwheel! @@ -21,7 +21,6 @@ {:main 'uxbox.main :parallel-build false :optimizations :none - :warnings {:ns-var-clash false} :closure-defines options :language-in :ecmascript6 :language-out :ecmascript5 @@ -37,7 +36,6 @@ {:main 'uxbox.view :parallel-build false :optimizations :none - :warnings {:ns-var-clash false} :closure-defines options :language-in :ecmascript6 :language-out :ecmascript5 diff --git a/frontend/scripts/watch-main b/frontend/scripts/watch-main new file mode 100755 index 000000000..c3864506d --- /dev/null +++ b/frontend/scripts/watch-main @@ -0,0 +1,2 @@ +#!/bin/sh +lein trampoline run -m clojure.main scripts/watch-main.clj diff --git a/frontend/scripts/watch-main.clj b/frontend/scripts/watch-main.clj new file mode 100644 index 000000000..d1b19a167 --- /dev/null +++ b/frontend/scripts/watch-main.clj @@ -0,0 +1,18 @@ +(require '[cljs.build.api :as b]) + +(b/watch + (b/inputs "src") + {:main 'uxbox.main + :parallel-build false + :output-to "resources/public/js/main.js" + :output-dir "resources/public/js/main" + :closure-defines {"uxbox.config.url" "https://test.uxbox.io/api" + "uxbox.config.viewurl" "https://test.uxbox.io/view/"} + :optimizations :advanced + :externs ["externs/main.js"] + :static-fns true + :elide-asserts true + :pretty-print false + :language-in :ecmascript6 + :language-out :ecmascript5 + :verbose true}) diff --git a/frontend/scripts/watch-tests.clj b/frontend/scripts/watch-tests.clj index 092eba68a..35e1a2a4c 100644 --- a/frontend/scripts/watch-tests.clj +++ b/frontend/scripts/watch-tests.clj @@ -3,7 +3,6 @@ (b/watch (b/inputs "src" "test") {:main 'uxbox.tests.main :parallel-build false - :warnings {:ns-var-clash false} :output-to "out/tests.js" :source-map "out/tests.js.map" :output-dir "out/tests" diff --git a/frontend/scripts/watch-worker.clj b/frontend/scripts/watch-worker.clj index d581c7c97..fc8307658 100644 --- a/frontend/scripts/watch-worker.clj +++ b/frontend/scripts/watch-worker.clj @@ -4,7 +4,6 @@ (b/inputs "src") {:main 'uxbox.worker :parallel-build false - :warnings {:ns-var-clash false} :output-to "resources/public/js/worker.js" :source-map "resources/public/js/worker.js.map" :output-dir "resources/public/js/worker"