forked from y-scope/clp-ffi-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
86 lines (77 loc) · 2.16 KB
/
Taskfile.yml
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
version: "3"
includes:
utils: "tools/yscope-dev-utils/taskfiles/utils.yml"
vars:
G_BUILD_DIR: "{{.ROOT_DIR}}/build"
G_CLP_FFI_JS_BUILD_DIR: "{{.G_BUILD_DIR}}/clp-ffi-js"
G_EMSDK_DIR: "{{.G_BUILD_DIR}}/emsdk"
G_EMSDK_CHECKSUM: "{{.G_BUILD_DIR}}/emsdk.md5"
tasks:
default:
deps: ["clp-ffi-js"]
clean:
cmds:
- task: "clean-emsdk"
- task: "clean-clp-ffi-js"
- "rm -rf '{{.G_BUILD_DIR}}'"
clean-emsdk:
cmds:
- "rm -rf '{{.G_EMSDK_DIR}}'"
clean-clp-ffi-js:
cmds:
- "rm -rf '{{.G_CLP_FFI_JS_BUILD_DIR}}'"
clp-ffi-js:
vars:
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5"
OUTPUT_DIR: "{{.G_CLP_FFI_JS_BUILD_DIR}}"
sources:
- "{{.G_EMSDK_CHECKSUM}}"
- "{{.TASKFILE}}"
- "CMakeLists.txt"
- "src/**/*"
generates: ["{{.CHECKSUM_FILE}}"]
deps:
- "emsdk"
- task: "utils:validate-checksum"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
DATA_DIR: "{{.OUTPUT_DIR}}"
cmds:
- "mkdir -p '{{.OUTPUT_DIR}}'"
- |-
cmake -S "{{.ROOT_DIR}}" -B "{{.OUTPUT_DIR}}" -G "Unix Makefiles"
cmake --build "{{.OUTPUT_DIR}}" --parallel --target ClpFfijs
# This command must be last
- task: "utils:compute-checksum"
vars:
DATA_DIR: "{{.OUTPUT_DIR}}"
OUTPUT_FILE: "{{.CHECKSUM_FILE}}"
emsdk:
vars:
CHECKSUM_FILE: "{{.G_EMSDK_CHECKSUM}}"
OUTPUT_DIR: "{{.G_EMSDK_DIR}}"
sources: ["{{.TASKFILE}}"]
generates: ["{{.CHECKSUM_FILE}}"]
deps:
- "init"
- task: "utils:validate-checksum"
vars:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
DATA_DIR: "{{.OUTPUT_DIR}}"
cmds:
- task: "clean-emsdk"
- "git clone 'https://github.com/emscripten-core/emsdk.git' '{{.G_EMSDK_DIR}}'"
- |-
cd "{{.G_EMSDK_DIR}}"
./emsdk install latest
./emsdk activate latest
# This command must be last
- task: "utils:compute-checksum"
vars:
DATA_DIR: "{{.OUTPUT_DIR}}"
OUTPUT_FILE: "{{.CHECKSUM_FILE}}"
init:
internal: true
silent: true
run: "once"
cmds: ["mkdir -p '{{.G_BUILD_DIR}}'"]