diff --git a/.gitignore b/.gitignore index 682b318..f78ee89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /bin/ /obj/ -/test/benchmark_output/ \ No newline at end of file +/test/benchmark_output/ +/.contest diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..6bf20de --- /dev/null +++ b/mise.toml @@ -0,0 +1,71 @@ +# Quick Guide +# - install mise +# - download the asset and extract them to ASSET_PATH_RO +# - mise run verify-asset +# - mise run serve +# - mise run arrange +# - mise run action +# - mise run assert + +[env] +ASSET_PATH_RO = "{{ [xdg_cache_home, 'stitch-a-ton', 'asset'] | join_path }}" +CONTEST_HOST = "http://localhost:7007" +CONTEST_ENDPOINT = "/api/image/generate" +CONTEST_OUTPUT = "{{ [cwd, '.contest'] | join_path }}" +DOTNET_ENVIRONMENT = 'Production' + +[tools] +dotnet = "8" +xh = "latest" +uv = "latest" + +# uncomment these if you're on windows +#[tools."http:hashdeep"] +#version = "4.4" + +#[tools."http:hashdeep".platforms] +#windows-x64 = {url = "https://github.com/jessek/hashdeep/releases/download/v4.4/md5deep-4.4.zip"} + +[tasks.setup] +run = ''' +{% if env.CONTEST_OUTPUT is not exists %} +mkdir .contest +{% endif %} +''' + +[tasks.verify-asset] +dir = "{{ env.ASSET_PATH_RO }}" +run = ''' +xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/branch/main/asset.txt -o ../asset.txt +hashdeep -arbvk ../asset.txt . +''' + +[tasks.arrange] +depends = ['setup'] +dir = "{{ env.CONTEST_OUTPUT }}" +outputs = ['generate.py'] +run = ''' +xh get https://null.formulatrix.dev/Contest/stitch-a-ton-answer/raw/branch/main/generate.py -o generate.py +''' + +[tasks.serve] +run = "dotnet run -c Release --no-launch-profile --urls {{env.CONTEST_HOST}}" + +[tasks.quick] +depends = ['arrange'] +dir = "{{ env.CONTEST_OUTPUT }}" +run = ''' +xh post {{env.CONTEST_HOST}}{{env.CONTEST_ENDPOINT}} canvas_rect=A1:H12 crop_offset:=[0,0] crop_size:=[1,1] output_scale:=0.25 -o quick.png +''' + +[tasks.action] +depends = ['arrange'] +run = ''' +uv run --script {{ [env.CONTEST_OUTPUT, 'generate.py'] | join_path }} +''' + +[tasks.assert] +depends = ['action'] +run = ''' +echo not_implemented +'''