set shell := ["powershell.exe","-NoLogo","-NoProfile", "-c"] # windows 
set dotenv-load
set quiet :=true

@_:
    just --list

[group("build")]
generate-schema:
    rm {{quote(".well-known"/"*.json")}}
    @fd -e json -H "schema"
    uv run --reinstall-package glrocky-sdk  \
        python -m \
        pytest --co --generate-schema --continue-on-collection-errors -q
    mv {{ quote (".well-known" / "schema_autogenerated.json")}} {{ quote (".well-known" / "schema.json")}}
    @fd -e json -H "schema"

[group("qa")]
lint:
    uvx ruff check --fix --unsafe-fixes .
    uvx ruff format

[group("run")]
[doc("run a specific test,eg: j run 0101_02")]
run TEST:
    uv run python -m pytest -sqv -k {{TEST}}

[group("clean")]
clean-pycache:
   @rm.exe -rf .pytest_cache .mypy_cache .ruff_cache .coverage
   rm.exe -rf log out
   @fd -td -I "__pycache__" -x rm -rf '{}'
   @echo "✅ Done"

[group("clean")]
clean-cache:
  @rm.exe -rf .pytest_cache .mypy_cache .ruff_cache .coverage

[group("clean")]
clean-out-and-log:
  rm.exe -rf logs/ out/

[group("clean")]
clean-all:
    just clean-cache
    just clean-out-and-log
    just clean-pycache

[group("dev")]
[doc("start test executor server,from glrocky framework")]
debug-srv:
    uv run api-test-server
