80 lines
2.1 KiB
Bash
Executable File
80 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
PROJECT_DIR="${1:-qt5-before/qt5-legacy-migration-benchmark}"
|
|
|
|
need_cmd() {
|
|
command -v "$1" >/dev/null 2>&1 || {
|
|
echo "ERROR: '$1' not found in PATH." >&2
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
need_cmd entire
|
|
need_cmd copilot
|
|
need_cmd git
|
|
|
|
if [ ! -d "$PROJECT_DIR" ]; then
|
|
echo "ERROR: project directory '$PROJECT_DIR' not found." >&2
|
|
exit 1
|
|
fi
|
|
|
|
cd "$PROJECT_DIR"
|
|
|
|
if [ ! -d .git ]; then
|
|
git init
|
|
fi
|
|
|
|
entire agent add copilot-cli
|
|
entire status
|
|
|
|
git add .
|
|
if git diff --cached --quiet; then
|
|
git commit --allow-empty -m "baseline: Qt5/C++11 legacy benchmark before Qt6/C++23 migration"
|
|
else
|
|
git commit -m "baseline: Qt5/C++11 legacy benchmark before Qt6/C++23 migration"
|
|
fi
|
|
|
|
entire checkpoint list
|
|
|
|
cat <<'PROMPT'
|
|
|
|
Use this prompt in Copilot CLI:
|
|
|
|
Migrate the legacy Qt5/C++11 desktop application to Qt6/C++23.
|
|
|
|
Requirements:
|
|
- Read the legacy source project from qt5-before/qt5-legacy-migration-benchmark
|
|
- Write the migrated project into qt6-after/qt6-migrated-benchmark
|
|
- Do not modify the legacy source tree in place
|
|
- Update CMake from Qt5 to Qt6
|
|
- Keep Core, Gui, and Widgets explicitly linked
|
|
- Replace QRegExp with QRegularExpression
|
|
- Replace QDesktopWidget / QApplication::desktop() usage with QScreen-based Qt6 APIs
|
|
- Remove legacy QTextCodec usage and use modern Qt6-safe text handling
|
|
- Modernize old SIGNAL/SLOT syntax to function-pointer connect syntax
|
|
- Replace legacy null pointer literals with nullptr
|
|
- Preserve the .ui and .qrc integration
|
|
- Preserve application behavior
|
|
- Upgrade the project from C++11 to C++23
|
|
- For every code change inside a method, add at least three tests covering the changed behavior
|
|
- Place all generated tests in qt6-after/qt6-migrated-benchmark/tests
|
|
- Update CMake so the migrated application and all tests build successfully with CTest
|
|
- Keep the test file naming compatible with repository policy checks
|
|
- Briefly explain each migration change
|
|
PROMPT
|
|
|
|
copilot
|
|
|
|
git status --short
|
|
git add .
|
|
|
|
if git diff --cached --quiet; then
|
|
echo "No changes to commit."
|
|
exit 0
|
|
fi
|
|
|
|
git commit -m "migrate: Qt5/C++11 app to Qt6/C++23 with tests and modern Qt APIs"
|
|
entire checkpoint list
|
|
entire checkpoint explain HEAD || true
|