author | Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk> |
Wed, 16 Jan 2019 21:27:33 +0000 | |
changeset 69677 | a06b204527e6 |
parent 69473 | f71598c11fae |
child 70047 | 96fe857a7a6f |
permissions | -rw-r--r-- |
69241 | 1 |
(* Title: Tools/Haskell/Test.thy |
69225 | 2 |
Author: Makarius |
3 |
*) |
|
4 |
||
69241 | 5 |
section \<open>Test build of Isabelle/Haskell modules\<close> |
69225 | 6 |
|
69241 | 7 |
theory Test imports Haskell |
69225 | 8 |
begin |
9 |
||
69239
6cd985a78d6e
support sub-directories, i.e. structure module names;
wenzelm
parents:
69225
diff
changeset
|
10 |
ML \<open> |
69444
c3c9440cbf9b
more formal Haskell project setup, with dependencies on packages from "stackage";
wenzelm
parents:
69385
diff
changeset
|
11 |
Isabelle_System.with_tmp_dir "ghc" (fn tmp_dir => |
69225 | 12 |
let |
69444
c3c9440cbf9b
more formal Haskell project setup, with dependencies on packages from "stackage";
wenzelm
parents:
69385
diff
changeset
|
13 |
val src_dir = Path.append tmp_dir (Path.explode "src"); |
c3c9440cbf9b
more formal Haskell project setup, with dependencies on packages from "stackage";
wenzelm
parents:
69385
diff
changeset
|
14 |
val files = Generated_Files.write_files \<^theory>\<open>Haskell\<close> src_dir; |
c3c9440cbf9b
more formal Haskell project setup, with dependencies on packages from "stackage";
wenzelm
parents:
69385
diff
changeset
|
15 |
|
c3c9440cbf9b
more formal Haskell project setup, with dependencies on packages from "stackage";
wenzelm
parents:
69385
diff
changeset
|
16 |
val modules = files |
69677
a06b204527e6
updated tagging for 9 theories: Cross3, Determinants, Tagged_Division, Change_of_Vars, Extended_Real_Limits, Fashoda, Finite_Cartesian_Product, Function_Topology, Finite_Product_Measure
Angeliki KoutsoukouArgyraki <ak2110@cam.ac.uk>
parents:
69473
diff
changeset
|
17 |
|> map (#1 #> Path.implode #> unsuffix ".hs" #> space_explode "/" #> space_implode "."); |
69446 | 18 |
val _ = |
19 |
GHC.new_project tmp_dir |
|
69453 | 20 |
{name = "isabelle", |
69473 | 21 |
depends = |
22 |
["bytestring", "containers", "network", "split", "threads", "utf8-string", "uuid"], |
|
69453 | 23 |
modules = modules}; |
69444
c3c9440cbf9b
more formal Haskell project setup, with dependencies on packages from "stackage";
wenzelm
parents:
69385
diff
changeset
|
24 |
|
69225 | 25 |
val (out, rc) = |
26 |
Isabelle_System.bash_output |
|
69444
c3c9440cbf9b
more formal Haskell project setup, with dependencies on packages from "stackage";
wenzelm
parents:
69385
diff
changeset
|
27 |
(cat_lines ["set -e", "cd " ^ File.bash_path tmp_dir, "isabelle ghc_stack build 2>&1"]); |
69239
6cd985a78d6e
support sub-directories, i.e. structure module names;
wenzelm
parents:
69225
diff
changeset
|
28 |
in if rc = 0 then writeln out else error out end) |
69225 | 29 |
\<close> |
30 |
||
31 |
end |