diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 002602c..8f021a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,18 +41,19 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Build + working-directory: src/MarcerGameDvdLauncher run: dotnet publish -c Release -r ${{ matrix.rid }} -p:Version=${{ steps.version.outputs.version }} --self-contained false - name: Create ZIP (Windows) if: matrix.os == 'windows-latest' shell: pwsh run: | - Compress-Archive -Path "MarcerGameDvdLauncher/bin/Release/net10.0/${{ matrix.rid }}/publish/*" -DestinationPath "MarcerGameDvdLauncher-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}.zip" + Compress-Archive -Path "src/MarcerGameDvdLauncher/bin/Release/net10.0/${{ matrix.rid }}/publish/*" -DestinationPath "MarcerGameDvdLauncher-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}.zip" - name: Create ZIP (Linux/macOS) if: matrix.os != 'windows-latest' run: | - cd MarcerGameDvdLauncher/bin/Release/net10.0/${{ matrix.rid }}/publish + cd src/MarcerGameDvdLauncher/bin/Release/net10.0/${{ matrix.rid }}/publish zip -r $GITHUB_WORKSPACE/MarcerGameDvdLauncher-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}.zip . - name: Upload artifact diff --git a/AGENTS.md b/AGENTS.md index 3c1df9c..acc202a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ applyTo: '**' ## Module Overview (Marcer GameDVD Launcher) -The implementation is split into focused modules (files) under the `MarcerGameDvdLauncher/` folder. Keep this section up to date when files are added, removed or responsibilities change. +The implementation is split into focused modules (files) under the `src/MarcerGameDvdLauncher/` folder. Keep this section up to date when files are added, removed or responsibilities change. - MarcerGameDvdLauncher/Program.cs: Minimal entry point. Sets console title and starts the application by creating `LauncherApp`. - MarcerGameDvdLauncher/LauncherApp.cs: Application lifecycle host — loads configuration, initializes components and runs the main directory navigation loop (contains `AppHost` internal class). @@ -18,7 +18,7 @@ The implementation is split into focused modules (files) under the `MarcerGameDv Note: This overview is intentionally concise. For behavioral changes (navigation, color scheme, launch command or config schema), update this file (AGENTS.md) and README.md as required by project policy. **Note for Automated Tests/CI:** -The Launcher cannot be executed or tested via `start.cmd` from this environment (build system, automation agent) since no Windows console environment is present. For release workflows and developer validation, it is ALWAYS required to do a manual test run via start.cmd per documentation and policy before delivery. +The Launcher cannot be executed or tested via `scripts/start.cmd` from this environment (build system, automation agent) since no Windows console environment is present. For release workflows and developer validation, it is ALWAYS required to do a manual test run via scripts/start.cmd per documentation and policy before delivery. **Release Process (automated via GitHub Actions):** - Pushing a tag (`v*`) triggers the GitHub Action workflow (`.github/workflows/release.yml`). @@ -35,7 +35,7 @@ Additional policy: - README.md must be written in English. Any functional change that affects usage, configuration, or behavior MUST update README.md in English immediately after the change. If there are consequential changes to developer-facing policies, build steps, or requirements, AGENTS.md must be updated as well. Developer note: Visual Studio Solution -- A Visual Studio solution file exists at the repository root: `marcer-gamedvd-launcher.sln`. Developers may open this solution in Visual Studio to work on the project, debug and build from the IDE. The solution references `MarcerGameDvdLauncher\MarcerGameDvdLauncher.csproj` and includes Debug and Release configurations. Use `build.cmd` (Windows) or `build.sh` (Linux) and `start.cmd` for consistent command-line builds/releases as described elsewhere in this document. +- A Visual Studio solution file exists at `src/marcer-gamedvd-launcher.sln`. Developers may open this solution in Visual Studio to work on the project, debug and build from the IDE. The solution references `MarcerGameDvdLauncher\MarcerGameDvdLauncher.csproj` and includes Debug and Release configurations. Use `scripts/build.cmd` (Windows) or `scripts/build.sh` (Linux) and `scripts/start.cmd` for consistent command-line builds/releases as described elsewhere in this document. With this, it is ensured that binary/release files never end up in git, and the release process is always traceable and performed exclusively manually in the web interface. @@ -79,9 +79,9 @@ The console launcher is meant for browsing a games directory and can launch ZIP - Hatari.Executable is validated during startup: the path is resolved (relative to the EXE directory when applicable) and must point to an existing file. If validation fails the program must present a clear error and exit. ### Miscellaneous -- Optional: Build and start scripts (build.cmd / build.sh / start.cmd) are present, adapt as needed. - - For ALL builds, tests, and releases, ONLY the platform build script may be used: `build.cmd` (Windows) or `build.sh` (Linux). Direct `dotnet build`/`dotnet run` calls are NOT allowed, as they can lead to version/runtime conflicts. The application must always be started and tested using `start.cmd`. - - After making any code changes that affect behavior or touch source files, run the platform build script (`build.cmd` on Windows, `build.sh` on Linux) and ensure the build completes successfully before committing. Additionally, perform a manual functional test using `start.cmd` on a Windows machine prior to pushing a release. +- Optional: Build and start scripts (`scripts/build.cmd` / `scripts/build.sh` / `scripts/start.cmd` / `scripts/start.sh`) are present, adapt as needed. + - For ALL builds, tests, and releases, ONLY the platform build script may be used: `scripts/build.cmd` (Windows) or `scripts/build.sh` (Linux). Direct `dotnet build`/`dotnet run` calls are NOT allowed, as they can lead to version/runtime conflicts. The application must always be started and tested using `scripts/start.cmd`. + - After making any code changes that affect behavior or touch source files, run the platform build script (`scripts/build.cmd` on Windows, `scripts/build.sh` on Linux) and ensure the build completes successfully before committing. Additionally, perform a manual functional test using `scripts/start.cmd` on a Windows machine prior to pushing a release. - The console window can have any number of lines; display/navigation must adapt dynamically. - After each build for a release, the entire build output directory (`bin/Release/net10.0/`) must be zipped in the `release/` directory, and the ZIP must be uploaded as a release asset in Gitea. - For every release, a Release Notes file must be maintained that summarizes all changes, bugfixes, and new features in that version; Release Notes must be provided with the release asset. diff --git a/PLAN.md b/PLAN.md index b576650..7a00ef4 100644 --- a/PLAN.md +++ b/PLAN.md @@ -94,4 +94,4 @@ externe Anpassungsmöglichkeit dafür. ## 4. Abschlusskriterien - [ ] Commit mit aussagekräftiger Message (nur echter Autor, kein Co-Author). -- [ ] Nach Doku- und Code-Änderungen: `build.cmd` (Windows) bzw. `build.sh` (Linux) läuft fehlerfrei. +- [ ] Nach Doku- und Code-Änderungen: `scripts/build.cmd` (Windows) bzw. `scripts/build.sh` (Linux) läuft fehlerfrei. diff --git a/README.md b/README.md index e8d4d5a..c737a92 100644 --- a/README.md +++ b/README.md @@ -76,8 +76,8 @@ A performant, consistent console launcher for the Hatari emulator on Windows. Co ## Usage 1. Edit `launcher.config.example.json` to set your `RootDirectory`, optional `PatchDirectory` and the `Hatari` settings, then copy it to `launcher.config.json` for local use. Relative paths are resolved against the EXE folder (build output). -2. **Windows:** Build via `build.cmd`, start via `start.cmd`. -3. **Linux/macOS:** Build via `build.sh` (run `chmod +x build.sh` first to make it executable), start via `start.sh`. +2. **Windows:** Build via `scripts/build.cmd`, start via `scripts/start.cmd`. +3. **Linux/macOS:** Build via `scripts/build.sh` (run `chmod +x scripts/*.sh` first to make it executable), start via `scripts/start.sh`. 4. In the console, all subfolders and ZIPs in root (and recursively below) will be shown; other file types/hidden files are always ignored. 5. Complete navigation/control with arrow keys, Enter, Backspace, ESC, PgUp/PgDn, as described above. 6. **IMPORTANT:** Navigation/scroll/backspace: @@ -139,8 +139,8 @@ Releases are automated via GitHub Actions. When a tag matching `v*` is pushed, t 4. The GitHub Action handles the rest. **Local builds** (for development/testing): -- **Windows:** `build.cmd` to build, `start.cmd` to run -- **Linux/macOS:** `build.sh` to build, `start.sh` to run (run `chmod +x *.sh` first) +- **Windows:** `scripts/build.cmd` to build, `scripts/start.cmd` to run +- **Linux/macOS:** `scripts/build.sh` to build, `scripts/start.sh` to run (run `chmod +x scripts/*.sh` first) ## Community diff --git a/demo.sh b/demo.sh index 49c28b9..6810153 100755 --- a/demo.sh +++ b/demo.sh @@ -175,7 +175,7 @@ EOF echo "[OK] Config written to $CONFIG_FILE" # Copy config to EXE output directory (app looks for it there) -EXE_DIR="$SCRIPT_DIR/MarcerGameDvdLauncher/bin/Release/net10.0" +EXE_DIR="$SCRIPT_DIR/src/MarcerGameDvdLauncher/bin/Release/net10.0" cp "$CONFIG_FILE" "$EXE_DIR/launcher.config.json" echo "[OK] Config copied to $EXE_DIR" @@ -186,4 +186,4 @@ echo "Controls: Arrow keys, Enter, Backspace, ESC to exit" echo "" cd "$SCRIPT_DIR" -dotnet run --project MarcerGameDvdLauncher -c Release +dotnet run --project src/MarcerGameDvdLauncher -c Release diff --git a/build.cmd b/scripts/build.cmd similarity index 88% rename from build.cmd rename to scripts/build.cmd index 9dca052..e325e11 100644 --- a/build.cmd +++ b/scripts/build.cmd @@ -8,9 +8,9 @@ if errorlevel 1 ( exit /b 1 ) -REM Im aktuellen Ordner (wo build.cmd liegt) bauen +REM Im src-Ordner bauen (build.cmd liegt in scripts/) cd /d %~dp0 -cd MarcerGameDvdLauncher +cd ..\src\MarcerGameDvdLauncher dotnet build -c Release if errorlevel 1 ( diff --git a/build.sh b/scripts/build.sh similarity index 84% rename from build.sh rename to scripts/build.sh index d2d98e7..89828c0 100755 --- a/build.sh +++ b/scripts/build.sh @@ -8,11 +8,9 @@ if ! command -v dotnet &> /dev/null; then exit 1 fi -# Build in current directory (where build.sh is located) +# Build in MarcerGameDvdLauncher subdirectory (script is in scripts/, code in src/) cd "$(dirname "$0")" - -# Change to MarcerGameDvdLauncher subdirectory -cd "MarcerGameDvdLauncher" +cd "../src/MarcerGameDvdLauncher" dotnet build -c Release if [ $? -ne 0 ]; then diff --git a/scripts/start.cmd b/scripts/start.cmd new file mode 100644 index 0000000..16e0c90 --- /dev/null +++ b/scripts/start.cmd @@ -0,0 +1,14 @@ +@echo off + +REM Starts MarcerGameDvdLauncher.exe (script is in scripts/, code in src/) +setlocal +set EXE_PATH=%~dp0..\src\MarcerGameDvdLauncher\bin\Release\net10.0\MarcerGameDvdLauncher.exe + +if not exist "%EXE_PATH%" ( + echo [ERROR] Application not built. Please run build.cmd first. + exit /b 1 +) + +pushd "%~dp0..\src\MarcerGameDvdLauncher\bin\Release\net10.0" +"MarcerGameDvdLauncher.exe" +popd diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 0000000..c239e47 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Starts MarcerGameDvdLauncher (script is in scripts/, code in src/) +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +EXE_PATH="$SCRIPT_DIR/../src/MarcerGameDvdLauncher/bin/Release/net10.0/MarcerGameDvdLauncher" + +if [ ! -f "$EXE_PATH" ]; then + echo "[ERROR] Application not built. Please run build.sh first." + exit 1 +fi + +cd "$SCRIPT_DIR/../src/MarcerGameDvdLauncher/bin/Release/net10.0" +./MarcerGameDvdLauncher diff --git a/MarcerGameDvdLauncher/AppConfiguration.cs b/src/MarcerGameDvdLauncher/AppConfiguration.cs similarity index 100% rename from MarcerGameDvdLauncher/AppConfiguration.cs rename to src/MarcerGameDvdLauncher/AppConfiguration.cs diff --git a/MarcerGameDvdLauncher/FavoritesService.cs b/src/MarcerGameDvdLauncher/FavoritesService.cs similarity index 100% rename from MarcerGameDvdLauncher/FavoritesService.cs rename to src/MarcerGameDvdLauncher/FavoritesService.cs diff --git a/MarcerGameDvdLauncher/HatariLauncher.cs b/src/MarcerGameDvdLauncher/HatariLauncher.cs similarity index 100% rename from MarcerGameDvdLauncher/HatariLauncher.cs rename to src/MarcerGameDvdLauncher/HatariLauncher.cs diff --git a/MarcerGameDvdLauncher/LauncherApp.cs b/src/MarcerGameDvdLauncher/LauncherApp.cs similarity index 100% rename from MarcerGameDvdLauncher/LauncherApp.cs rename to src/MarcerGameDvdLauncher/LauncherApp.cs diff --git a/MarcerGameDvdLauncher/MarcerGameDvdLauncher.csproj b/src/MarcerGameDvdLauncher/MarcerGameDvdLauncher.csproj similarity index 100% rename from MarcerGameDvdLauncher/MarcerGameDvdLauncher.csproj rename to src/MarcerGameDvdLauncher/MarcerGameDvdLauncher.csproj diff --git a/MarcerGameDvdLauncher/MenuRenderer.cs b/src/MarcerGameDvdLauncher/MenuRenderer.cs similarity index 100% rename from MarcerGameDvdLauncher/MenuRenderer.cs rename to src/MarcerGameDvdLauncher/MenuRenderer.cs diff --git a/MarcerGameDvdLauncher/NavigationController.cs b/src/MarcerGameDvdLauncher/NavigationController.cs similarity index 100% rename from MarcerGameDvdLauncher/NavigationController.cs rename to src/MarcerGameDvdLauncher/NavigationController.cs diff --git a/MarcerGameDvdLauncher/OverlayDirectoryBrowser.cs b/src/MarcerGameDvdLauncher/OverlayDirectoryBrowser.cs similarity index 100% rename from MarcerGameDvdLauncher/OverlayDirectoryBrowser.cs rename to src/MarcerGameDvdLauncher/OverlayDirectoryBrowser.cs diff --git a/MarcerGameDvdLauncher/Program.cs b/src/MarcerGameDvdLauncher/Program.cs similarity index 100% rename from MarcerGameDvdLauncher/Program.cs rename to src/MarcerGameDvdLauncher/Program.cs diff --git a/MarcerGameDvdLauncher/ProgramHelpers.cs b/src/MarcerGameDvdLauncher/ProgramHelpers.cs similarity index 100% rename from MarcerGameDvdLauncher/ProgramHelpers.cs rename to src/MarcerGameDvdLauncher/ProgramHelpers.cs diff --git a/MarcerGameDvdLauncher/UIErrorService.cs b/src/MarcerGameDvdLauncher/UIErrorService.cs similarity index 100% rename from MarcerGameDvdLauncher/UIErrorService.cs rename to src/MarcerGameDvdLauncher/UIErrorService.cs diff --git a/MarcerGameDvdLauncher/launcher.config.example.json b/src/MarcerGameDvdLauncher/launcher.config.example.json similarity index 100% rename from MarcerGameDvdLauncher/launcher.config.example.json rename to src/MarcerGameDvdLauncher/launcher.config.example.json diff --git a/marcer-gamedvd-launcher.sln b/src/marcer-gamedvd-launcher.sln similarity index 100% rename from marcer-gamedvd-launcher.sln rename to src/marcer-gamedvd-launcher.sln diff --git a/start.cmd b/start.cmd deleted file mode 100644 index 78f85f1..0000000 --- a/start.cmd +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -REM Starts MarcerGameDvdLauncher.exe from the correct folder -setlocal -set EXE_PATH=%~dp0MarcerGameDvdLauncher\bin\Release\net10.0\MarcerGameDvdLauncher.exe - -if not exist "%EXE_PATH%" ( - echo [ERROR] Application not built. Please run build.cmd first. - exit /b 1 -) - -pushd "MarcerGameDvdLauncher\bin\Release\net10.0" -"MarcerGameDvdLauncher.exe" -popd diff --git a/start.sh b/start.sh deleted file mode 100755 index 893e174..0000000 --- a/start.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Starts MarcerGameDvdLauncher from the correct folder -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -EXE_PATH="$SCRIPT_DIR/MarcerGameDvdLauncher/bin/Release/net10.0/MarcerGameDvdLauncher" - -if [ ! -f "$EXE_PATH" ]; then - echo "[ERROR] Application not built. Please run build.sh first." - exit 1 -fi - -cd "$SCRIPT_DIR/MarcerGameDvdLauncher/bin/Release/net10.0" -./MarcerGameDvdLauncher