Files
clice/pixi.toml
2025-12-29 09:19:45 +08:00

179 lines
4.6 KiB
TOML

[workspace]
name = "clice"
version = "0.1.0"
description = "A next-generation C++ language server for modern C++"
authors = [
"ykiko <ykikoykikoykiko@gmail.com>",
"clice contributors <clice@clice.io>",
]
license = "Apache-2.0"
license-file = "LICENSE"
readme = "README.md"
documentation = "https://clice.io"
repository = "https://github.com/clice-io/clice"
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-arm64"]
[dependencies]
python = ">=3.13"
cmake = ">=3.30"
ninja = "*"
clang = "==20.1.8"
clangxx = "==20.1.8"
lld = "==20.1.8"
llvm-tools = "==20.1.8"
compiler-rt = "==20.1.8"
[target.linux-64.dependencies]
sysroot_linux-64 = "==2.17"
gcc = "==14.2.0"
gxx = "==14.2.0"
[target.linux-64.activation]
scripts = ["scripts/activate_linux.sh"]
[target.win-64.activation]
scripts = ["scripts/activate_asan.bat"]
[feature.test.pypi-dependencies]
pytest = "*"
pytest-asyncio = ">=1.1.0"
[feature.package.dependencies]
xz = ">=5.8.1,<6"
[feature.format.dependencies]
ruff = "*"
tombi = "*"
stylua = "*"
fd-find = "*"
prettier = "*"
clang-format = "==21.1.7"
[feature.format.tasks]
format-cpp = "fd -H -e cpp -e h -e cc -e hpp -x clang-format -i"
format-python = "ruff format ."
format-lua = "stylua ."
format-web = "fd -H -e js -e ts -e css -x prettier --write"
format-markdown = "fd -H -e md -x prettier --write"
format-json = "fd -H -e json -E package-lock.json -x prettier --write"
format-toml = "fd -H -e toml -x tombi format"
format-yaml = """
fd -H -e yaml -e yml -E pnpm-lock.yaml -x prettier --write && \
fd -H "^\\.clang-(format|tidy)$" -x prettier --write --parser yaml
"""
format = { depends-on = [
"format-cpp",
"format-python",
"format-lua",
"format-web",
"format-markdown",
"format-json",
"format-toml",
"format-yaml"
] }
[feature.node.dependencies]
nodejs = ">=20"
pnpm = "*"
[feature.node.tasks]
build-docs = { cwd = "docs", cmd = "pnpm run docs:build", depends-on = ["install-docs"] }
preview-docs = { cwd = "docs", cmd = "pnpm run docs:preview", depends-on = ["install-docs"] }
build-vscode = { cwd = "editors/vscode", cmd = "pnpm run package", depends-on = ["install-vscode"] }
publish-vscode = { cwd = "editors/vscode", cmd = "pnpm run publish", depends-on = ["install-vscode"] }
[feature.node.tasks.install-docs]
cwd = "docs"
cmd = "pnpm install"
inputs = ["docs/package.json", "docs/pnpm-lock.yaml"]
outputs = ["docs/node_modules/.modules.yaml"]
[feature.node.tasks.install-vscode]
cwd = "editors/vscode"
cmd = "pnpm install"
inputs = ["editors/vscode/package.json", "editors/vscode/pnpm-lock.yaml"]
outputs = ["editors/vscode/node_modules/.modules.yaml"]
[feature.develop.tasks]
unit-test = './build/bin/unit_tests --test-dir="./tests/data"'
integration-test = 'pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice{% if pixi.is_win %}.exe{% endif %}'
xmake-test = "xmake test --verbose"
hello = "echo Hello"
[environments]
default = []
develop = ["test", "develop"]
package = ["test", "package"]
format = ["format"]
node = ["node"]
[tasks.ci-cmake-configure]
args = ["build_type"]
cmd = [
"cmake",
"-B",
"build",
"-G",
"Ninja",
"-DCMAKE_BUILD_TYPE={{ build_type }}",
"-DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake",
"-DCLICE_ENABLE_TEST=ON",
"-DCLICE_CI_ENVIRONMENT=ON",
]
[tasks.cmake-build]
cmd = "cmake --build build"
[tasks.ci-cmake-build]
args = ["build_type"]
depends-on = [
{ task = "ci-cmake-configure", args = ["{{ build_type }}"] },
{ task = "cmake-build" },
]
[tasks.ci-cmake-test]
depends-on = [{ task = "unit-test" }, { task = "integration-test" }]
[tasks.ci-xmake-configure]
args = ["build_type"]
cmd = "xmake config --clean --yes --mode={{ build_type }} --toolchain=clang --ci=y"
[tasks.xmake-build]
cmd = "xmake build --verbose --diagnosis --all"
[tasks.ci-xmake-build]
args = ["build_type"]
depends-on = [
{ task = "ci-xmake-configure", args = [
"{{ build_type }}",
] },
{ task = "xmake-build" },
]
[tasks.build-llvm]
cmd = ["python3", "scripts/build-llvm.py"]
[tasks.upload-llvm]
args = ["workflow_id", "llvm_version", { "arg" = "branch", default = "main" }]
cmd = [
"gh",
"workflow",
"run",
"upload-llvm.yml",
"--ref",
"{{ branch }}",
"--field",
"workflow_id={{workflow_id}}",
"--field",
"version={{llvm_version}}",
]
[tasks.delete-artifacts]
# delete all workflows generated by "file_name"
args = ["file_name"]
cmd = ["scripts/delete-artifacts.bash", "{{ file_name }}"]
[tasks.package]
cmd = "xmake config --yes --enable_test=n --dev=n --release=y --mode=releasedbg --toolchain=clang && xmake pack --verbose"