Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ jobs:
api-key-nuget: ${{ secrets.API_KEY_NUGET }}
api-user-github: ${{ secrets.API_USER_GITHUB }}
api-user-nuget: ${{ secrets.API_USER_NUGET }}
- name: Remove old formats
run: |
rm -rf ${{ github.workspace }}/tests/gdal-formats
- uses: actions/download-artifact@v4
name: Download artifact - formats
with:
name: formats-osx-${{ matrix.arch }}
path: "tests/gdal-formats"
merge-multiple: true

- name: Test packages
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

env:
DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet
DOTNET_VERSION: "8.0.x"
DOTNET_VERSION: "9.0.x"
IS_PRE_RELEASE: ${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v')) }}

jobs:
Expand Down Expand Up @@ -121,6 +121,10 @@ jobs:
pattern: packages-*
path: nuget

- name: Remove old formats
run: |
rm -rf ${{ github.workspace }}/tests/gdal-formats

- uses: actions/download-artifact@v4
with:
pattern: formats-*
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ jobs:
with:
name: packages-unix-${{ matrix.arch }}
path: nuget/
- name: Remove old formats
run: |
rm -rf ${{ github.workspace }}/tests/gdal-formats

- uses: actions/download-artifact@v4
name: Download artifact - formats
with:
name: formats-unix-${{ matrix.arch }}
path: "tests/gdal-formats"
merge-multiple: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ jobs:
api-user-nuget: ${{ secrets.API_USER_NUGET }}
shell: pwsh

- uses: actions/download-artifact@v4
name: Download artifact - formats
with:
pattern: formats-win
path: "tests/gdal-formats"
merge-multiple: true

- name: Test packages
run: ./test.ps1 -buildNumberTail ${{ github.run_number }} -preRelease $${{ inputs.is-pre-release }}
shell: pwsh
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN pip install cmake --upgrade
# load cache from previous build
COPY ci/cache*/dotnet* /usr/share/dotnet/

ARG DOTNET_VERSION=8.0
ARG DOTNET_VERSION=9.0
ARG DOTNET_INSTALL_DIR=/build/ci/cache/.dotnet

ENV PATH="${PATH}:/usr/share/dotnet"
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile.unix.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Runs tests from GDAL.NETCORE on Linux
ARG DOTNET_VERSION=8.0
ARG DOTNET_VERSION=9.0
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/sdk:$DOTNET_VERSION as base
RUN apt-get update && apt-get install -y \
build-essential
Expand Down
8 changes: 4 additions & 4 deletions shared/GdalCore.opt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ BUILD_NUMBER_TAIL=100
### build (drivers) root
BUILD_ROOT=$(ROOTDIR_)/build-$(BASE_RID)

# Feb 14, 2025
GDAL_VERSION=3.10.3
# May 9, 2025
GDAL_VERSION=3.11.0
GDAL_ROOT=$(BUILD_ROOT)/gdal-source
GDAL_REPO=https://github.com/OSGeo/gdal.git
GDAL_COMMIT_VER=v$(GDAL_VERSION)
Expand Down Expand Up @@ -70,8 +70,8 @@ LIBSHARED=$(PACKAGE_BUILD_ROOT)/$(__libshared)/$(RID)/$(__libshared)
##### GDAL source extended location
GDAL_ROOT=$(BUILD_ROOT)/gdal-source
##### Dotnet version for GDAL
DOTNET_VERSION=8.0
GDAL_CSHARP_VERSION=net8.0
DOTNET_VERSION=9.0
GDAL_CSHARP_VERSION=net9.0

##### SWIG executable and interface
BASE_SWIG_=$(GDAL_ROOT)/swig
Expand Down
4 changes: 2 additions & 2 deletions shared/patch/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ index ea9c5bb985..856bfa2ee4 100644
if (DOTNET_FOUND)
set(CSHARP_LIBRARY_VERSION
- "net6.0"
+ "net8.0"
+ "net9.0"
CACHE STRING ".NET version to be used for libraries")
set(CSHARP_APPLICATION_VERSION
- "net6.0"
+ "net8.0"
+ "net9.0"
CACHE STRING ".NET version to be used for the sample Applications")
else ()
set(CSHARP_LIBRARY_VERSION
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/gdalcore.bundle.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Platforms>arm64;x64</Platforms>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0;net461</TargetFrameworks>
<Copyright>MaxRev © 2024</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
4 changes: 2 additions & 2 deletions shared/templates/gdalcore.linuxruntime.bundle.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Platforms>arm64;x64</Platforms>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0;net461</TargetFrameworks>
<Copyright>MaxRev © 2024</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -17,7 +17,7 @@
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5, and others.
Targets linux-arm64 and linux-x64 runtimes. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0
Targets linux-arm64 and linux-x64 runtimes. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0, net9.0
</Description>
<PackageReleaseNotes>
- GDAL ${_GDAL_VERSION}
Expand Down
4 changes: 2 additions & 2 deletions shared/templates/gdalcore.linuxruntime.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Platform>${_BUILD_ARCH}</Platform>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0;net461</TargetFrameworks>
<Copyright>MaxRev © 2024</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -17,7 +17,7 @@
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5, and others.
Targets linux-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0
Targets linux-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0, net9.0
</Description>
<PackageReleaseNotes>
- GDAL ${_GDAL_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/gdalcore.loader.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Platforms>x64;arm64</Platforms>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0;net461</TargetFrameworks>
<Copyright>MaxRev © 2024</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/gdalcore.macosruntime.bundle.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5, and others.
Targets osx-arm64 and osx-x64 runtimes. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0
Targets osx-arm64 and osx-x64 runtimes. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0, net9.0
</Description>
<PackageReleaseNotes>
- GDAL ${_GDAL_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/gdalcore.macosruntime.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5, and others.
Targets osx-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0
Targets osx-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0, net9.0
</Description>
<PackageReleaseNotes>
- GDAL ${_GDAL_VERSION}
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/gdalcore.windowsruntime.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5, and others.
Targets win-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0
Targets win-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netframework 4.6.1+, net6.0, net7.0, net8.0, net9.0
</Description>
<PackageReleaseNotes>
- GDAL ${_GDAL_VERSION}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>MaxRev.Gdal.Core.Tests.AzureFunctions</RootNamespace>
<Platforms>x64;arm64</Platforms>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
Expand Down
75 changes: 45 additions & 30 deletions tests/MaxRev.Gdal.Core.Tests.XUnit/CommonTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using MaxRev.Gdal.Core;
using OSGeo.GDAL;
using OSGeo.OGR;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Xunit;
using Xunit.Abstractions;

Expand Down Expand Up @@ -94,42 +96,55 @@ public static IEnumerable<object[]> ValidTestData
}
}

internal static string GetEnvRID()
{
var isArm = RuntimeInformation.ProcessArchitecture is Architecture.Arm64;
if (File.Exists(@"/System/Library/CoreServices/SystemVersion.plist"))
{
return isArm ? "osx-arm64" : "osx-x64";
}

return Environment.OSVersion.Platform switch
{
PlatformID.Unix => isArm ? "unix-arm64" : "unix-x64",
PlatformID.Win32NT => "win",
_ => throw new PlatformNotSupportedException(),
};
}

public static IEnumerable<object[]> DriversInCurrentVersion
{
get
get => GetDriversInCurrentVersion();
}

private static IEnumerable<object[]> GetDriversInCurrentVersion()
{
var folder = Extensions.GetTestDataFolder("../gdal-formats");
var rid = GetEnvRID();
var ridTrimmed = rid.Substring(0, rid.IndexOf('-'));
var formats = new List<string>();
foreach (var type in new[] { "raster", "vector" })
{
return new[]
var ciFolder = Path.Combine(folder, $"formats-{rid}");
// check if the folder exists in CI environment
if (!Directory.Exists(ciFolder))
{
ciFolder = folder; // fallback to the default path
}
var file = Path.Combine(ciFolder, $"gdal-formats-{ridTrimmed}-{type}.txt");
if (!File.Exists(file))
{
"AAIGrid","ACE2","ADRG","AIG","AirSAR","AmigoCloud",
"AVCBin","AVCE00","BAG","BIGGIF","BLX","BMP","BSB","BT",
"BYN","CAD","CALS","Carto","CEOS","COASP","COG","COSAR",
"CPG","CSV","CSW","CTable2","CTG","DAAS","DERIVED","DGN",
"DIMAP","DIPEx","DOQ1","DOQ2","DTED","DXF","ECRGTOC","EDIGEO",
"EEDA","EEDAI","EHdr","EIR","ELAS","Elasticsearch","ENVI","ERS",
"ESAT","ESRI Shapefile","ESRIC","ESRIJSON", "FAST","FIT","FITS",
"FlatGeobuf","GenBin","Geoconcept","GeoJSON","GeoJSONSeq","GeoRSS",
"GFF","GIF","GML","GMLAS","GNMDatabase","GNMFile","GPKG","GPSBabel",
"GPX","GRASSASCIIGrid","GRIB","GS7BG","GSAG","GSBG","GSC","GTFS","GTI","GTiff",
"GTX","GXF","HDF4","HDF4Image","HDF5","HDF5Image","HF2","HFA",
"HTTP","Idrisi","ILWIS","Interlis 1","Interlis 2","IRIS","ISCE",
"ISG","ISIS2","ISIS3","JAXAPALSAR","JDEM","JML","JP2OpenJPEG",
"JPEG","JSONFG","KML","KMLSUPEROVERLAY","KRO","L1B","LAN","LCP","Leveller",
"LIBKML","LOSLAS","LVBAG","MAP","MapInfo File","MapML","MBTiles",
"MEM","Memory","MFF","MFF2","MiraMonVector","MRF","MSGN","MSSQLSpatial","MVT",
"MySQL","NAS","NDF","netCDF","NGSGEOID","NGW","NITF","NOAA_B","NSIDCbin","NTv2",
"NWT_GRC","NWT_GRD","OAPIF","ODBC","ODS","OGCAPI","OGR_GMT",
"OGR_PDS","OGR_SDTS","OGR_VRT","OpenFileGDB","OSM","OZI","PAux",
"PCIDSK","PCRaster","PDF","PDS","PDS4","PGDUMP","PGeo","PLMOSAIC",
"PLSCENES","PMTiles","PNG","PNM","PostGISRaster","PostgreSQL","PRF","R",
"Rasterlite","RIK","RMF","ROI_PAC","RPFTOC","RRASTER","RS2","RST",
"S102","S104","S111","S57","SAFE","SAGA","SAR_CEOS","SDTS","Selafin","SENTINEL2","SGI",
"SIGDEM","SNODAS","SQLite","SRP","SRTMHGT","STACIT","STACTA","SVG",
"SXF","Terragen","TGA","TIGER","TIL","TopoJSON","TSX","UK .NTF",
"USGSDEM","VDV","VFK","VICAR","VRT","WAsP","WCS","WEBP","WFS",
"WMS","WMTS","XLS","XLSX","XPM","XYZ","Zarr","ZMap"
}.Select(x => new[] { x });
throw new FileNotFoundException($"File not found: {file}");
}
formats.AddRange(File.ReadAllLines(file)
.Where(x => x.Contains(type))
.Select(x => x[..x.IndexOf('-')].Trim())
.Where(x => !string.IsNullOrWhiteSpace(x))
.ToArray());
}
return formats.Distinct().Select(x => new[] { x });
}

public static IEnumerable<object[]> ValidTestDataVector
{
get
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>MaxRev.Gdal.Core.Tests.XUnit</RootNamespace>
<NoWarn>NU1605</NoWarn>
<IsPackable>false</IsPackable>
Expand Down
4 changes: 2 additions & 2 deletions tests/MaxRev.Gdal.Core.Tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 as base
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base
WORKDIR /src
COPY ["tests/MaxRev.Gdal.Core.Tests/MaxRev.Gdal.Core.Tests.csproj", "MaxRev.Gdal.Core.Tests/"]
COPY nuget nuget
Expand All @@ -9,7 +9,7 @@ FROM base AS publish
WORKDIR /src
RUN dotnet publish "MaxRev.Gdal.Core.Tests.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM mcr.microsoft.com/dotnet/runtime:8.0 as final
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MaxRev.Gdal.Core.Tests.dll"]
2 changes: 1 addition & 1 deletion tests/MaxRev.Gdal.Core.Tests/MaxRev.Gdal.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Platforms>x64;arm64</Platforms>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<StartupObject>GdalCoreTest.Program</StartupObject>
Expand Down