[tasks.release] dependencies = [ "format", "clean", "build", "maturin", "maturin_build", "pip", "pyinstaller", "zip", ] [tasks.upload] script_runner="@shell" ignore_errors = true script = [ "twine upload releases/xiv_csolver*.whl --repository gitea", "twine upload releases/xiv_csolver_lib*.whl --repository gitea", ] [tasks.fmt] script_runner = "@shell" script = [ "cargo +nightly fmt -- --config format_code_in_doc_comments=true --config imports_granularity=Module" ] [tasks.testcov] script_runner = "@shell" ignore_errors = true script = [ "mkdir -p coverage", "mkdir -p coverage/html", "mkdir -p coverage/", "CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off' LLVM_PROFILE_FILE='llvm/cargo-test-%p-%m.profraw' cargo test", "grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore '/*' --ignore '*xiv_csolver.rs' --ignore '*python*.rs' -o coverage/html/", ] [tasks.clean] command = "cargo" args = ["clean"] dependencies = ["remove_tmp"] [tasks.remove_tmp] script_runner = "@shell" ignore_errors = true script = ''' rm -rf releases rm -rf python/build rm -rf python/dist ''' [tasks.zip] windows_alias = 'zip_win' linux_alias = 'zip_linux' [tasks.zip_linux] script_runner = "@shell" script = ''' mkdir -p releases # Add version as an arg and things cp target/wheels/*.whl releases/ zip releases/xiv_csolver_cli_linux.zip -j target/release/xiv_csolver_cli craft.toml -j target/release/libxiv_craft_solver.so cd python/dist/ && zip ../../releases/xiv_csolver_gui_linux.zip -r xiv_csolver_gui_linux/ ''' [tasks.zip_win] script_runner = "@shell" script = ''' mkdir -p releases # Add version as an arg and things cp target/wheels/*.whl releases/ tar acvf releases/xiv_csolver_cli_win.zip .\craft.toml -C .\target\release\ xiv_csolver_cli.exe libxiv_craft_solver.d tar acvf releases/xiv_csolver_gui_win.zip -C .\python\dist\ .\xiv_csolver_gui_win\* ''' [tasks.pip] script_runner = "@shell" ignore_errors = true script = ''' cd python rm -rf build dist pip install -q -r requirements_dev.txt pip install -q -e . python -m pip wheel . --wheel-dir=../releases/ ''' [tasks.pyinstaller] windows_alias = "windows_pyinstaller" linux_alias = "linux_pyinstaller" [tasks.linux_pyinstaller] script_runner = "@shell" script = ''' cd python pyinstaller src/xiv_csolver/__main__.py -i "src/xiv_csolver/ressources/xiv_csolver.ico" --add-data "src/xiv_csolver/configs/:xiv_csolver/configs" --add-data "src/xiv_csolver/ressources/:xiv_csolver/ressources" --name xiv_csolver_gui_linux -y ''' [tasks.windows_pyinstaller] script_runner = "@shell" script = ''' cd python pyinstaller src\xiv_csolver\__main__.py -i "src/xiv_csolver/ressources/xiv_csolver.ico" --add-data "src\xiv_csolver\configs\;xiv_csolver\configs" --add-data "src\xiv_csolver\ressources\;xiv_csolver\ressources" --name xiv_csolver_gui_win -y ''' [tasks.build] command = "cargo" args = ["build","--release"] dependencies = ["clean"] [tasks.maturin] command = "maturin" args = ["develop", "--release"] [tasks.maturin_build] command = "maturin" args = ["build", "--release"] [tasks.rebuild] dependencies = ["clean","build","maturin","pip"] [tasks.rust] dependencies = ["build","maturin"]