[FIX #1731] Prepare configuration allowing to fail build

This commit is contained in:
Julien Eluard 2017-09-02 14:46:08 +02:00 committed by Roman Volosovskyi
parent bc73fbd83e
commit 99e04105ec
2 changed files with 16 additions and 3 deletions

View File

@ -42,7 +42,8 @@
:compiler {:output-to "target/android/app.js"
:main "env.android.main"
:output-dir "target/android"
:optimizations :none}}}}
:optimizations :none}
:warning-handlers [status-im.utils.build/warning-handler]}}}
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]
:timeout 240000}}
:test {:dependencies [[day8.re-frame/test "0.1.5"]]
@ -73,7 +74,8 @@
:optimizations :simple
:closure-defines {"goog.DEBUG" false}
:parallel-build true
:language-in :ecmascript5}}
:language-in :ecmascript5}
:warning-handlers [status-im.utils.build/warning-handler]}
:android
{:source-paths ["react-native/src" "src" "env/prod"]
:compiler {:output-to "index.android.js"
@ -84,4 +86,5 @@
:optimizations :simple
:closure-defines {"goog.DEBUG" false}
:parallel-build true
:language-in :ecmascript5}}}}}})
:language-in :ecmascript5}
:warning-handlers [status-im.utils.build/warning-handler]}}}}})

View File

@ -0,0 +1,10 @@
(ns status-im.utils.build
(:require [cljs.analyzer :as analyzer]))
(defn warning-handler [warning-type env extra]
(when (warning-type analyzer/*cljs-warnings*)
(when-let [s (analyzer/error-message warning-type extra)]
(binding [*out* *err*]
(println (analyzer/message env (str "\u001B[31mWARNING\u001B[0m: " s))))
;; TODO Do not enable yet as our current reagent version generates warnings
#_(System/exit 1))))