|
| 1 | +;; Copyright (c) Rich Hickey. All rights reserved. |
| 2 | +;; The use and distribution terms for this software are covered by the |
| 3 | +;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) |
| 4 | +;; which can be found in the file epl-v10.html at the root of this distribution. |
| 5 | +;; By using this software in any fashion, you are agreeing to be bound by |
| 6 | +;; the terms of this license. |
| 7 | +;; You must not remove this notice, or any other, from this software. |
| 8 | + |
| 9 | +(ns self-parity.setup |
| 10 | + ^{:doc "Sets up the filesystem, priming the output directory |
| 11 | + with needed source files so that the self-hosted compiler |
| 12 | + being executed within Node has various dependency sources |
| 13 | + available (without the benefit of being able to load resources |
| 14 | + from a classpath)."} |
| 15 | + (:require |
| 16 | + [clojure.java.io :as io])) |
| 17 | + |
| 18 | +(def out-path (io/file "builds" "out-self-parity")) |
| 19 | + |
| 20 | +(defn copy-source |
| 21 | + [source-resource-name] |
| 22 | + (let [target-file (io/file out-path source-resource-name)] |
| 23 | + (io/make-parents target-file) |
| 24 | + (io/copy (io/input-stream (io/resource source-resource-name)) target-file))) |
| 25 | + |
| 26 | +(def test-check-source-resource-names |
| 27 | + ["clojure/test/check.cljc" |
| 28 | + "clojure/test/check/random.clj" |
| 29 | + "clojure/test/check/random.cljs" |
| 30 | + "clojure/test/check/rose_tree.cljc" |
| 31 | + "clojure/test/check/clojure_test.cljc" |
| 32 | + "clojure/test/check/clojure_test/assertions.cljc" |
| 33 | + "clojure/test/check/clojure_test/assertions/cljs.cljc" |
| 34 | + "clojure/test/check/results.cljc" |
| 35 | + "clojure/test/check/impl.cljc" |
| 36 | + "clojure/test/check/properties.cljc" |
| 37 | + "clojure/test/check/random/longs.cljs" |
| 38 | + "clojure/test/check/random/doubles.cljs" |
| 39 | + "clojure/test/check/random/longs/bit_count_impl.cljs" |
| 40 | + "clojure/test/check/generators.cljc"]) |
| 41 | + |
| 42 | +(def source-resource-names |
| 43 | + (into ["clojure/template.clj"] |
| 44 | + test-check-source-resource-names)) |
| 45 | + |
| 46 | +(defn -main [] |
| 47 | + (run! copy-source source-resource-names)) |
0 commit comments