-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjustfile
More file actions
72 lines (55 loc) · 1.8 KB
/
justfile
File metadata and controls
72 lines (55 loc) · 1.8 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
develop:
uv sync
clean-artifacts:
rm -rf **/_dist
find . -wholename "*/c/build" -type d -exec rm -rf {} \;
build-wheels:
uv build --all-packages
test-py *TEST_ARGS: develop
uv run pytest {{TEST_ARGS}}
test-rs *TEST_ARGS:
uv run cargo test {{TEST_ARGS}}
BIND_BUILD := "target/selene-bindings-build"
PLUGIN_EXPAND := "target/plugin-expand"
generate-plugin-header plugin:
mkdir -p {{PLUGIN_EXPAND}}
cd selene-core/examples/{{plugin}} && cargo expand > ../../../{{PLUGIN_EXPAND}}/{{plugin}}.rs
cbindgen \
--config selene-core/examples/cbindgen.toml \
--output selene-core/c/include/selene/{{plugin}}.h \
{{PLUGIN_EXPAND}}/{{plugin}}.rs
rm -rf target/tmp
generate-selene-core-headers:
cbindgen \
--config selene-core/cbindgen.toml \
--crate selene-core \
--output selene-core/c/include/selene/core_types.h
just generate-plugin-header error_model
just generate-plugin-header simulator
just generate-plugin-header runtime
generate-headers:
just generate-selene-core-headers
just generate-selene-sim-headers
generate-selene-sim-headers:
cbindgen \
--config selene-sim/cbindgen.toml \
--crate selene-sim \
--output selene-sim/c/include/selene/selene.h
generate-selene-sim-bindings: generate-selene-sim-headers
mkdir -p {{BIND_BUILD}}
cmake \
-B{{BIND_BUILD}} \
-DCMAKE_INSTALL_PREFIX=selene-sim/python/selene_sim/_dist \
selene-sim/c
cmake \
--build {{BIND_BUILD}} \
--target install
rm -rf {{BIND_BUILD}}
generate-bindings: generate-selene-core-headers generate-selene-sim-bindings
build-ci:
#!/usr/bin/env bash
set -euo pipefail
mkdir -p /tmp/ci-cache
export CACHE_CARGO=true
uv build --package selene-core --out-dir wheelhouse
cibuildwheel .