$ProjectRoot = if ($PSScriptRoot) { Split-Path -Parent $PSScriptRoot } else { (Get-Location).Path }
Set-Location $ProjectRoot

$MainScript = Join-Path $ProjectRoot "main.py"
$IconPath = Join-Path $ProjectRoot "icon.ico"
$MariadbPath = Join-Path $ProjectRoot "mariadb"

python -m nuitka `
  --standalone `
  --enable-plugin=pyqt6 `
  --windows-console-mode=disable `
  --windows-icon-from-ico="$IconPath" `
  --follow-imports `
  --assume-yes-for-downloads `
  --include-package=core `
  --include-package=ui `
  --include-package=modules `
  --include-data-dir="${MariadbPath}=mariadb" `
  --output-dir="build\nuitka" `
  --output-filename="Golder.exe" `
  "$MainScript"
