From 4fe59254661b0cf3544ce382307b394a72a0c55c Mon Sep 17 00:00:00 2001 From: Paul Meems Date: Sun, 25 Oct 2026 21:12:26 +0100 Subject: [PATCH] Update build.yml --- .github/copilot-instructions.md | 48 +++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 10 +++---- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 3c7b119..e0b6cce 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -17,6 +17,54 @@ MapWinGIS 5 is the legacy COM/ActiveX library and the behavior reference. Port its functionality incrementally as modern C++20. Do not transliterate the legacy implementation. +## Build and test + +Run these commands from the repository root: + +```powershell +pwsh -File build\scripts\bootstrap-vcpkg.ps1 +msbuild MapWinGIS6.slnx -p:Configuration=Debug -p:Platform=x64 -m +bin\Debug\x64\MapWinGIS.Core.Tests.exe +``` + +Run one GoogleTest case by adding its suite and test name: + +```powershell +bin\Debug\x64\MapWinGIS.Core.Tests.exe --gtest_filter=VectorDatasetTest.ReportsTheDriverAndPath +``` + +Write a JUnit-style test report when needed: + +```powershell +bin\Debug\x64\MapWinGIS.Core.Tests.exe --gtest_output=xml:testresults.xml +``` + +The test project uses GoogleTest. Shared generated data and temporary-directory +helpers are in `tests/MapWinGIS.Core.Tests/TestData.h`. Keep fixtures in a +temporary directory and do not commit generated shapefiles or databases. + +## Architecture across files + +`MapWinGIS.Core.dll` contains the public native API and application logic. +`MwGdalCore` is a static library linked into it for GDAL execution support. +Public headers live under `src/MapWinGIS.Core/include/mapwingis//`. +Implementations mirror those areas under `src/MapWinGIS.Core/src//`. +Put private shared code under `src/MapWinGIS.Core/src/internal/`. + +Call `GdalEnvironment::Initialize()` before normal GDAL use. The build deploys +GDAL and PROJ data beside the DLL, and `GdalEnvironment` configures their paths. +Do not depend on `GDAL_DATA` or `PROJ_LIB` environment variables. Core objects +are not thread-safe unless their API documents otherwise. + +Use `CoreError` subclasses for operational failures. Use `TryX` companions +when failure is a normal probe result. Use `std::optional` for absent values, +not for operational failures. + +When porting behavior, use MapWinGIS 5 as the behavioral reference. Keep +feature indexes 0-based and preserve numeric values for matching type-library +enums. Preserve legacy value formatting and error information unless a change +is deliberate and documented. + When working in this repository, prioritize: * Correctness and preservation of existing MapWinGIS behavior. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b7be4c..6497adc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Record runner image version id: runner_image @@ -32,7 +32,7 @@ jobs: run: Add-Content -Path $env:GITHUB_OUTPUT -Value "image_version=$env:ImageVersion" - name: Cache vcpkg binary packages - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: vcpkg-binary-cache key: vcpkg-binary-${{ runner.os }}-${{ matrix.platform }}-${{ steps.runner_image.outputs.image_version }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json', 'build/triplets/*.cmake', 'Directory.Build.props') }} @@ -44,7 +44,7 @@ jobs: run: ./build/scripts/bootstrap-vcpkg.ps1 - name: Set up MSBuild - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v3 - name: Build shell: pwsh @@ -66,7 +66,7 @@ jobs: - name: Upload test results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: testresults-${{ matrix.platform }}-${{ matrix.configuration }} path: testresults-${{ matrix.platform }}-${{ matrix.configuration }}.xml @@ -74,7 +74,7 @@ jobs: - name: Upload binaries if: matrix.configuration == 'Release' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: MapWinGIS.Core-${{ matrix.platform }} path: bin/Release/${{ matrix.platform }}/