Skip to content

Commit

Permalink
Re-target C# bindings apps to netcoreapp2.2, fix broken build (fixes #…
Browse files Browse the repository at this point in the history
…4792) (#4828)

* CI: Revert - disable building C# samples on Windows due to #4792
* Re-target framework to netcoreapp2.2 and system.drawing.common to 5.0.3 (#4792)
  • Loading branch information
szekerest authored Nov 16, 2021
1 parent c84cc55 commit 58c0033
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ jobs:
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org
dotnet restore
exec { nmake /f makefile.vc interface }
# all disabled because of https://github.com/OSGeo/gdal/issues/4792
# exec { nmake /f makefile.vc all $env:WIN64_ARG}
exec { nmake /f makefile.vc ogr_dir gdal_dir osr_dir const_dir gdal_csharp $env:WIN64_ARG}
exec { nmake /f makefile.vc all $env:WIN64_ARG}
cd $env:GITHUB_WORKSPACE\autotest\cpp
exec { nmake /f makefile.vc MSVC_VER=$env:MSVC_VER $env:WIN64_ARG }
Expand Down Expand Up @@ -267,6 +265,5 @@ jobs:
cd $env:GITHUB_WORKSPACE\autotest
pip install -Ur requirements.txt
exec { pytest -vv }
# disabled because of https://github.com/OSGeo/gdal/issues/4792
# cd $env:GITHUB_WORKSPACE\swig\csharp
# exec { nmake /f makefile.vc test }
cd $env:GITHUB_WORKSPACE\swig\csharp
exec { nmake /f makefile.vc test }
9 changes: 3 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ install:
exec { python setup.py install }
cd $env:APPVEYOR_BUILD_FOLDER\swig\csharp
exec { nmake /f makefile.vc interface}
# all disabled because of https://github.com/OSGeo/gdal/issues/4792
# exec { nmake /f makefile.vc all $env:WIN64_ARG}
exec { nmake /f makefile.vc ogr_dir gdal_dir osr_dir const_dir gdal_csharp $env:WIN64_ARG}
exec { nmake /f makefile.vc all $env:WIN64_ARG}
cd $env:APPVEYOR_BUILD_FOLDER\autotest\cpp
exec { nmake /f makefile.vc MSVC_VER=$env:MSVC_VER $env:WIN64_ARG }
Expand All @@ -210,9 +208,8 @@ test_script:
cd $env:APPVEYOR_BUILD_FOLDER\autotest
exec { pip install -Ur requirements.txt }
exec { pytest -vv }
# disabled because of https://github.com/OSGeo/gdal/issues/4792
# cd $env:APPVEYOR_BUILD_FOLDER\swig\csharp
# exec { nmake /f makefile.vc test}
cd $env:APPVEYOR_BUILD_FOLDER\swig\csharp
exec { nmake /f makefile.vc test}
deploy: off

15 changes: 8 additions & 7 deletions swig/csharp/makefile.vc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CSC = mcs
NETSTANDARD = netstandard2.0
!ENDIF
!IFNDEF NETCORE
NETCORE = netcoreapp2.1
NETCORE = netcoreapp2.2
!ENDIF
!IF $(MSVC_VER) >= 1400
!IFDEF WIN64
Expand Down Expand Up @@ -87,6 +87,7 @@ template.csproj:
echo ^<PropertyGroup^> >> $@
echo ^<OutputType^>Exe^</OutputType^> >> $@
echo ^<TargetFramework^>$(NETCORE)^</TargetFramework^> >> $@
echo ^<CheckEolTargetFramework^>false^</CheckEolTargetFramework^> >> $@
echo ^<AssemblyVersion^>$(GDAL_VERSION).0^</AssemblyVersion^> >> $@
echo ^<EnableDefaultCompileItems^>false^</EnableDefaultCompileItems^> >> $@
echo ^</PropertyGroup^> >> $@
Expand Down Expand Up @@ -192,19 +193,19 @@ samples: sampleprojects
dotnet add OSRTransform.csproj reference ..\osr\osr_csharp.csproj
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) OSRTransform.csproj
dotnet add GDALRead.csproj reference ..\gdal\gdal_csharp.csproj
dotnet add GDALRead.csproj package System.Drawing.Common
dotnet add GDALRead.csproj package System.Drawing.Common -v 5.0.3
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) GDALRead.csproj
dotnet add GDALReadDirect.csproj reference ..\gdal\gdal_csharp.csproj
dotnet add GDALReadDirect.csproj package System.Drawing.Common
dotnet add GDALReadDirect.csproj package System.Drawing.Common -v 5.0.3
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) GDALReadDirect.csproj
dotnet add GDALAdjustContrast.csproj reference ..\gdal\gdal_csharp.csproj
dotnet add GDALAdjustContrast.csproj package System.Drawing.Common
dotnet add GDALAdjustContrast.csproj package System.Drawing.Common -v 5.0.3
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) GDALAdjustContrast.csproj
dotnet add GDALDatasetRasterIO.csproj reference ..\gdal\gdal_csharp.csproj
dotnet add GDALDatasetRasterIO.csproj package System.Drawing.Common
dotnet add GDALDatasetRasterIO.csproj package System.Drawing.Common -v 5.0.3
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) GDALDatasetRasterIO.csproj
dotnet add GDALDatasetRasterIOEx.csproj reference ..\gdal\gdal_csharp.csproj
dotnet add GDALDatasetRasterIOEx.csproj package System.Drawing.Common
dotnet add GDALDatasetRasterIOEx.csproj package System.Drawing.Common -v 5.0.3
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) GDALDatasetRasterIOEx.csproj
dotnet add GDALWrite.csproj reference ..\gdal\gdal_csharp.csproj
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) GDALWrite.csproj
Expand All @@ -230,7 +231,7 @@ samples: sampleprojects
dotnet add VSIMem.csproj reference ..\gdal\gdal_csharp.csproj
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) VSIMem.csproj
dotnet add GDALMemDataset.csproj reference ..\gdal\gdal_csharp.csproj
dotnet add GDALMemDataset.csproj package System.Drawing.Common
dotnet add GDALMemDataset.csproj package System.Drawing.Common -v 5.0.3
dotnet build -c $(DOTNET_CONFIG) -o "." -r $(DOTNET_RID) GDALMemDataset.csproj
dotnet add OGRLayerAlg.csproj reference ..\osr\osr_csharp.csproj
dotnet add OGRLayerAlg.csproj reference ..\ogr\ogr_csharp.csproj
Expand Down

0 comments on commit 58c0033

Please sign in to comment.