This repository has been archived on 2026-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
xiv_csolver/Makefile.toml

108 lines
2.7 KiB
TOML

[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.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]
[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"]