|
@ -2,13 +2,12 @@
|
||||||
tests/output_images
|
tests/output_images
|
||||||
tests/output_images/*
|
tests/output_images/*
|
||||||
R.py
|
R.py
|
||||||
|
kotonebot/tasks/sprites
|
||||||
kotonebot-ui/node_modules
|
kotonebot-ui/node_modules
|
||||||
kotonebot-ui/.vite
|
kotonebot-ui/.vite
|
||||||
dumps*/
|
dumps*/
|
||||||
config.json
|
config.json
|
||||||
reports/
|
reports/
|
||||||
invoke.yml
|
|
||||||
pyproject.toml
|
|
||||||
tmp/
|
tmp/
|
||||||
res/sprites_compiled/
|
res/sprites_compiled/
|
||||||
messages/
|
messages/
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
graft res
|
graft kotonebot/tasks/sprites
|
||||||
prune res/sprites
|
prune tests
|
||||||
|
prune tools
|
||||||
|
prune experiments
|
|
@ -16,9 +16,10 @@
|
||||||
4. 编译资源:在 VSCode 中选择“Terminal” -> “Run Task” -> “Make R.py”并执行。
|
4. 编译资源:在 VSCode 中选择“Terminal” -> “Run Task” -> “Make R.py”并执行。
|
||||||
|
|
||||||
|
|
||||||
## 打包
|
## 打包 & 安装
|
||||||
```bash
|
```bash
|
||||||
just package <版本号>
|
just package
|
||||||
|
pip install --find-links=dist ksaa
|
||||||
```
|
```
|
||||||
|
|
||||||
## 截图
|
## 截图
|
||||||
|
|
36
justfile
|
@ -43,41 +43,33 @@ env:
|
||||||
build: env
|
build: env
|
||||||
{{venv}} pyinstaller -y kotonebot-gr.spec
|
{{venv}} pyinstaller -y kotonebot-gr.spec
|
||||||
|
|
||||||
# Generate pyproject.toml
|
@package-resource: env
|
||||||
generate-pyproject-toml version:
|
Write-Host "Packaging kotonebot-resource..."
|
||||||
#!{{shebang_python}}
|
@{{venv}} python -m build -s kotonebot-resource
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
today = datetime.now()
|
|
||||||
# version = today.strftime("%Y.%m.%d")
|
|
||||||
version = "{{version}}"
|
|
||||||
|
|
||||||
with open("pyproject.template.toml", "r", encoding="utf-8") as f:
|
|
||||||
template = f.read()
|
|
||||||
|
|
||||||
with open("pyproject.toml", "w", encoding="utf-8") as f:
|
|
||||||
f.write(template.replace("<<<version>>>", version))
|
|
||||||
|
|
||||||
# Package KAA
|
# Package KAA
|
||||||
@package version: env
|
@package: package-resource
|
||||||
|
{{venv}} python tools/make_resources.py -p # Make R.py in production mode
|
||||||
|
|
||||||
Write-Host "Removing old build files..."
|
Write-Host "Removing old build files..."
|
||||||
if (Test-Path dist) { rm -r -fo dist }
|
if (Test-Path dist) { rm -r -fo dist }
|
||||||
if (Test-Path build) { rm -r -fo build }
|
if (Test-Path build) { rm -r -fo build }
|
||||||
Write-Host "Generating pyproject.toml..."
|
Write-Host "Packaging KAA..."
|
||||||
just generate-pyproject-toml {{version}}
|
|
||||||
Write-Host "Packaging KAA {{version}}..."
|
|
||||||
@{{venv}} python -m build
|
@{{venv}} python -m build
|
||||||
Write-Host "Removing pyproject.toml..."
|
|
||||||
@rm -fo pyproject.toml
|
Write-Host "Copying kotonebot-resource to dist..."
|
||||||
|
Copy-Item .\kotonebot-resource\dist\* .\dist\
|
||||||
|
|
||||||
|
{{venv}} python tools/make_resources.py # Make R.py in development mode
|
||||||
|
|
||||||
# Upload to PyPI
|
# Upload to PyPI
|
||||||
publish version: (package version)
|
publish: package
|
||||||
# if (git diff-index --quiet HEAD) { } else { Write-Host "Error: Commit all changes before publishing"; exit 1 }
|
# if (git diff-index --quiet HEAD) { } else { Write-Host "Error: Commit all changes before publishing"; exit 1 }
|
||||||
@Write-Host "Uploading to PyPI..."
|
@Write-Host "Uploading to PyPI..."
|
||||||
twine upload dist/* -u __token__ -p $env:PYPI_TOKEN
|
twine upload dist/* -u __token__ -p $env:PYPI_TOKEN
|
||||||
|
|
||||||
# Upload to PyPI-Test
|
# Upload to PyPI-Test
|
||||||
publish-test version: (package version)
|
publish-test: package
|
||||||
@Write-Host "Uploading to PyPI-Test..."
|
@Write-Host "Uploading to PyPI-Test..."
|
||||||
twine upload --repository testpypi dist/* -u __token__ -p $env:PYPI_TEST_TOKEN
|
twine upload --repository testpypi dist/* -u __token__ -p $env:PYPI_TEST_TOKEN
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
graft fonts
|
||||||
|
graft models
|
||||||
|
graft ui
|
|
@ -0,0 +1,21 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=61.0"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "ksaa-res"
|
||||||
|
description = "This package contains the resources for ksaa."
|
||||||
|
readme = "README.md"
|
||||||
|
requires-python = ">=3.10"
|
||||||
|
dependencies = []
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
include-package-data = true
|
||||||
|
|
||||||
|
[tool.setuptools.package-dir]
|
||||||
|
kaa = "."
|
||||||
|
"kaa.res" = "."
|
||||||
|
"kaa.res.models" = "models"
|
||||||
|
"kaa.res.fonts" = "fonts"
|
||||||
|
"kaa.res.ui" = "ui"
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 662 B After Width: | Height: | Size: 662 B |
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 749 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 998 B |
Before Width: | Height: | Size: 905 B After Width: | Height: | Size: 905 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 638 B |
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 861 KiB After Width: | Height: | Size: 861 KiB |
Before Width: | Height: | Size: 743 KiB After Width: | Height: | Size: 743 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 808 B After Width: | Height: | Size: 808 B |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 872 B |
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 622 B |
Before Width: | Height: | Size: 392 KiB After Width: | Height: | Size: 392 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 818 B |
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 973 B After Width: | Height: | Size: 973 B |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |