-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdune.py
More file actions
executable file
·109 lines (104 loc) · 3.28 KB
/
dune.py
File metadata and controls
executable file
·109 lines (104 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env python3
# Copyright 2018 Vincent Jacques <vincent@vincent-jacques.net>
import sys
import os
def gen(flavor):
yield '(library'
yield ' (name Collide)'
yield ' (modules Ring Drawer Simulation Application GraphicalApplication)'
yield ' (libraries General JsOfOCairo)'
if flavor == "coverage":
yield ' (preprocess (pps bisect_ppx))'
yield ')'
yield ''
yield ''
yield '(executable'
yield ' (name collide_cli)'
yield ' (public_name collide_cli)'
yield ' (modules collide_cli)'
yield ' (libraries Collide cairo2)'
yield ')'
yield ''
yield ''
yield '(executable'
yield ' (name collide_gtk)'
yield ' (public_name collide_gtk)'
yield ' (modules collide_gtk)'
yield ' (libraries Collide cairo2 threads lablgtk2 cairo2-gtk)'
yield ')'
yield ''
yield ''
yield '(rule'
yield ' (targets node_modules.sentinel)'
yield ' (action (progn'
yield ' (run %{bin:npm} install "file-saver@1.3.3")'
yield ' (write-file node_modules.sentinel sentinel)'
yield ' ))'
yield ')'
yield ''
yield '(rule'
yield ' (targets FileSaver.js)'
yield ' (deps node_modules.sentinel)'
yield ' (action (progn'
yield ' (with-stdout-to %{targets} (run %{bin:browserify} -s FileSaver node_modules/file-saver/FileSaver.min.js))'
yield ' ))'
yield ')'
yield ''
yield '(executable'
yield ' (name collide_browser)'
yield ' (modules collide_browser)'
yield ' (libraries Collide)'
yield ' (preprocess (pps "js_of_ocaml-ppx"))'
yield ' (js_of_ocaml (flags "+nat.js"))'
yield ')'
yield ''
yield '(rule'
yield ' (targets bootstrap.min.css)'
yield ' (action (run %{bin:wget} https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css))'
yield ')'
yield ''
yield '(rule'
yield ' (targets bootstrap.min.js)'
yield ' (action (run %{bin:wget} https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js))'
yield ')'
yield ''
yield '(rule'
yield ' (targets popper.min.js)'
yield ' (action (run %{bin:wget} https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js))'
yield ')'
yield ''
yield '(rule'
yield ' (targets jquery-3.2.1.slim.min.js)'
yield ' (action (run %{bin:wget} https://code.jquery.com/jquery-3.2.1.slim.min.js))'
yield ')'
yield ''
yield '(alias'
yield ' (name collide_browser)'
yield ' (deps collide_browser.html bootstrap.min.css bootstrap.min.js popper.min.js jquery-3.2.1.slim.min.js FileSaver.js collide_browser.bc.js)'
yield ')'
yield ''
yield ''
yield '(executable'
yield ' (name unit_test)'
yield ' (modules unit_test)'
yield ' (libraries Collide)'
if flavor == "coverage":
yield ' (preprocess (pps bisect_ppx))'
yield ')'
yield ''
yield '(rule'
yield ' (targets unit_test.sentinel)'
yield ' (deps unit_test.bc)'
yield ' (action (progn'
yield ' (run %{exe:unit_test.bc})'
yield ' (write-file unit_test.sentinel sentinel)'
yield ' ))'
yield ')'
yield ''
yield '(alias'
yield ' (name runtest)'
yield ' (deps unit_test.sentinel)'
yield ')'
yield ''
for line in gen(sys.argv[1]):
print(line)