diff --git a/cmake/docker/almalinux/dotnet.Dockerfile b/cmake/docker/almalinux/dotnet.Dockerfile index 3979577eb2..568088c64f 100644 --- a/cmake/docker/almalinux/dotnet.Dockerfile +++ b/cmake/docker/almalinux/dotnet.Dockerfile @@ -5,7 +5,7 @@ FROM ortools/cmake:almalinux_swig AS env RUN wget -q "https://dot.net/v1/dotnet-install.sh" \ && chmod a+x dotnet-install.sh \ && ./dotnet-install.sh -c 3.1 -i /usr/local/bin \ -&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin +&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin # Trigger first run experience by running arbitrary cmd RUN dotnet --info diff --git a/cmake/docker/alpine/dotnet.Dockerfile b/cmake/docker/alpine/dotnet.Dockerfile index ed3fea7d08..ddc72c4801 100644 --- a/cmake/docker/alpine/dotnet.Dockerfile +++ b/cmake/docker/alpine/dotnet.Dockerfile @@ -5,12 +5,12 @@ RUN apk add --no-cache wget icu-libs libintl \ && mkdir -p /usr/share/dotnet \ && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet -## .Net 6.0 -## see: https://dotnet.microsoft.com/download/dotnet-core/6.0 -RUN dotnet_sdk_version=6.0.405 \ +## .Net 8.0 +## see: https://dotnet.microsoft.com/download/dotnet-core/8.0 +RUN dotnet_sdk_version=8.0.408 \ && wget -qO dotnet.tar.gz \ "https://dotnetcli.azureedge.net/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-${dotnet_sdk_version}-linux-musl-x64.tar.gz" \ -&& dotnet_sha512='ca98ebc5858339c5ce4164f5f5932a5bf8aae9f13d54adf382a41f5e6d1302df278bd7e218ecc2f651dcf67e705c40c43347cd33956732c6bd88d3b3d2881b84' \ +&& dotnet_sha512='0ab0c0d52985bde69b594454b5e1d9e1a6e003159656ee2972058d2960cfb0968dbe4d470d8eb21dcea41ff594976520e189a8e13afc44a419ca08e456df36e1' \ && echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \ && tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \ && rm dotnet.tar.gz diff --git a/cmake/docker/debian/dotnet.Dockerfile b/cmake/docker/debian/dotnet.Dockerfile index 79b958264d..5cf49e5f8e 100644 --- a/cmake/docker/debian/dotnet.Dockerfile +++ b/cmake/docker/debian/dotnet.Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update -qq \ && dpkg -i packages-microsoft-prod.deb \ && rm packages-microsoft-prod.deb \ && apt-get update -qq \ -&& apt-get install -yq dotnet-sdk-6.0 \ +&& apt-get install -yq dotnet-sdk-8.0 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Trigger first run experience by running arbitrary cmd diff --git a/cmake/docker/fedora/java.Dockerfile b/cmake/docker/fedora/java.Dockerfile index 62ef7b3461..b5b1210bd5 100644 --- a/cmake/docker/fedora/java.Dockerfile +++ b/cmake/docker/fedora/java.Dockerfile @@ -1,7 +1,7 @@ FROM ortools/cmake:fedora_swig AS env RUN dnf -y update \ -&& dnf -y install java-11-openjdk java-11-openjdk-devel maven \ +&& dnf -y install java-21-openjdk java-21-openjdk-devel maven \ && dnf clean all ENV JAVA_HOME=/usr/lib/jvm/java-openjdk diff --git a/cmake/docker/opensuse/dotnet.Dockerfile b/cmake/docker/opensuse/dotnet.Dockerfile index af94e5d3ea..cd94182ca3 100644 --- a/cmake/docker/opensuse/dotnet.Dockerfile +++ b/cmake/docker/opensuse/dotnet.Dockerfile @@ -3,13 +3,13 @@ FROM ortools/cmake:opensuse_swig AS env # .NET install # see: https://docs.microsoft.com/en-us/dotnet/core/install/linux-opensuse RUN zypper refresh \ -&& zypper install -y wget tar awk gzip libicu-devel +&& zypper install -y wget tar awk gzip libicu-devel findutils -## .Net 6.0 +## .Net 8.0 # see: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install RUN wget -q "https://dot.net/v1/dotnet-install.sh" \ && chmod a+x dotnet-install.sh \ -&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin +&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin # Trigger first run experience by running arbitrary cmd RUN dotnet --info diff --git a/cmake/docker/rockylinux/dotnet.Dockerfile b/cmake/docker/rockylinux/dotnet.Dockerfile index c973a59f2f..7e4fbb4995 100644 --- a/cmake/docker/rockylinux/dotnet.Dockerfile +++ b/cmake/docker/rockylinux/dotnet.Dockerfile @@ -5,7 +5,7 @@ FROM ortools/cmake:rockylinux_swig AS env RUN wget -q "https://dot.net/v1/dotnet-install.sh" \ && chmod a+x dotnet-install.sh \ && ./dotnet-install.sh -c 3.1 -i /usr/local/bin \ -&& ./dotnet-install.sh -c 6.0 -i /usr/local/bin +&& ./dotnet-install.sh -c 8.0 -i /usr/local/bin # Trigger first run experience by running arbitrary cmd RUN dotnet --info diff --git a/cmake/samples/dotnet/Google.Sample.csproj b/cmake/samples/dotnet/Google.Sample.csproj index 7f92e92545..1979548ff9 100644 --- a/cmake/samples/dotnet/Google.Sample.csproj +++ b/cmake/samples/dotnet/Google.Sample.csproj @@ -2,7 +2,7 @@ Exe 8.0 - net6.0 + net8.0 LatestMajor Google.Sample diff --git a/makefiles/Makefile.cpp.mk b/makefiles/Makefile.cpp.mk index dc60adbf2e..05fa5692fe 100644 --- a/makefiles/Makefile.cpp.mk +++ b/makefiles/Makefile.cpp.mk @@ -41,7 +41,7 @@ USE_SCIP ?= ON USE_CPLEX ?= OFF USE_DOTNET_CORE_31 ?= OFF -USE_DOTNET_6 ?= ON +USE_DOTNET_8 ?= ON BUILD_VENV ?= ON JOBS ?= 4 @@ -72,7 +72,7 @@ third_party: -DUSE_SCIP=$(USE_SCIP) \ -DUSE_CPLEX=$(USE_CPLEX) \ -DUSE_DOTNET_CORE_31=$(USE_DOTNET_CORE_31) \ - -DUSE_DOTNET_6=$(USE_DOTNET_6) \ + -DUSE_DOTNET_8=$(USE_DOTNET_8) \ -DBUILD_VENV=$(BUILD_VENV) \ -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \ -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \ diff --git a/makefiles/Makefile.dotnet.mk b/makefiles/Makefile.dotnet.mk index 700242fec0..a8bc1d5399 100644 --- a/makefiles/Makefile.dotnet.mk +++ b/makefiles/Makefile.dotnet.mk @@ -110,12 +110,12 @@ $(TEMP_DOTNET_DIR)/$1/%/%.csproj: \ > $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj $(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj -ifeq ($(USE_DOTNET_6)_$(USE_DOTNET_CORE_31),ON_ON) - $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net6.0<\/TargetFrameworks>/' \ +ifeq ($(USE_DOTNET_8)_$(USE_DOTNET_CORE_31),ON_ON) + $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net8.0<\/TargetFrameworks>/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj else - ifeq ($(USE_DOTNET_6),ON) - $(SED) -i -e 's/@DOTNET_TFM@/net6.0<\/TargetFramework>/' \ + ifeq ($(USE_DOTNET_8),ON) + $(SED) -i -e 's/@DOTNET_TFM@/net8.0<\/TargetFramework>/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj else $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1<\/TargetFramework>/' \ @@ -151,9 +151,9 @@ rdotnet_%: \ $(TEMP_DOTNET_DIR)/$1/%/%.csproj \ $(TEMP_DOTNET_DIR)/$1/%/%.cs \ FORCE -ifeq ($(USE_DOTNET_6),ON) - cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net6.0 -c Release - cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net6.0 -c Release $(ARGS) +ifeq ($(USE_DOTNET_8),ON) + cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net8.0 -c Release + cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net8.0 -c Release $(ARGS) endif ifeq ($(USE_DOTNET_CORE_31),ON) cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework netcoreapp3.1 -c Release @@ -184,12 +184,12 @@ $(TEMP_DOTNET_DIR)/$1/%/%.csproj: \ > $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj $(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj -ifeq ($(USE_DOTNET_6)_$(USE_DOTNET_CORE_31),ON_ON) - $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net6.0<\/TargetFrameworks>/' \ +ifeq ($(USE_DOTNET_8)_$(USE_DOTNET_CORE_31),ON_ON) + $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net8.0<\/TargetFrameworks>/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj else - ifeq ($(USE_DOTNET_6),ON) - $(SED) -i -e 's/@DOTNET_TFM@/net6.0<\/TargetFramework>/' \ + ifeq ($(USE_DOTNET_8),ON) + $(SED) -i -e 's/@DOTNET_TFM@/net8.0<\/TargetFramework>/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj else $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1<\/TargetFramework>/' \ @@ -225,9 +225,9 @@ rdotnet_%: \ $(TEMP_DOTNET_DIR)/$1/%/%.csproj \ $(TEMP_DOTNET_DIR)/$1/%/%.cs \ FORCE -ifeq ($(USE_DOTNET_6),ON) - cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net6.0 -c Release - cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net6.0 -c Release $(ARGS) +ifeq ($(USE_DOTNET_8),ON) + cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net8.0 -c Release + cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net8.0 -c Release $(ARGS) endif ifeq ($(USE_DOTNET_CORE_31),ON) cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework netcoreapp3.1 -c Release @@ -255,12 +255,12 @@ $(TEMP_DOTNET_DIR)/$1/%/%.csproj: \ > $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj $(SED) -i -e 's/@DOTNET_LANG@/9.0/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj -ifeq ($(USE_DOTNET_6)_$(USE_DOTNET_CORE_31),ON_ON) - $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net6.0<\/TargetFrameworks>/' \ +ifeq ($(USE_DOTNET_8)_$(USE_DOTNET_CORE_31),ON_ON) + $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net8.0<\/TargetFrameworks>/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj else - ifeq ($(USE_DOTNET_6),ON) - $(SED) -i -e 's/@DOTNET_TFM@/net6.0<\/TargetFramework>/' \ + ifeq ($(USE_DOTNET_8),ON) + $(SED) -i -e 's/@DOTNET_TFM@/net8.0<\/TargetFramework>/' \ $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj else $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1<\/TargetFramework>/' \ @@ -296,9 +296,9 @@ rdotnet_%: \ $(TEMP_DOTNET_DIR)/$1/%/%.csproj \ $(TEMP_DOTNET_DIR)/$1/%/%.cs \ FORCE -ifeq ($(USE_DOTNET_6),ON) - cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net6.0 -c Release - cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" test --no-build --framework net6.0 -c Release $(ARGS) +ifeq ($(USE_DOTNET_8),ON) + cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net8.0 -c Release + cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" test --no-build --framework net8.0 -c Release $(ARGS) endif ifeq ($(USE_DOTNET_CORE_31),ON) cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework netcoreapp3.1 -c Release @@ -659,7 +659,7 @@ $(TEMP_DOTNET_DIR)/ortools_examples/examples/dotnet/%.csproj: \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj $(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj - $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net6.0<\/TargetFrameworks>/' \ + $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net8.0<\/TargetFrameworks>/' \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj $(SED) -i -e 's/@DOTNET_PROJECT@/$(DOTNET_ORTOOLS_ASSEMBLY_NAME)/' \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj @@ -694,7 +694,7 @@ $(TEMP_DOTNET_DIR)/ortools_examples/examples/dotnet/%.csproj: \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj $(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj - $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net6.0<\/TargetFrameworks>/' \ + $(SED) -i -e 's/@DOTNET_TFM@/netcoreapp3.1;net8.0<\/TargetFrameworks>/' \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj $(SED) -i -e 's/@DOTNET_PROJECT@/$(DOTNET_ORTOOLS_ASSEMBLY_NAME)/' \ $(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj @@ -741,7 +741,7 @@ endif ###################### .PHONY: nuget_archive # Build .Net "Google.OrTools" Nuget Package nuget_archive: dotnet | $(TEMP_DOTNET_DIR) - "$(DOTNET_BIN)" publish $(DOTNET_BUILD_ARGS) --no-build --no-dependencies --no-restore -f net6.0 \ + "$(DOTNET_BIN)" publish $(DOTNET_BUILD_ARGS) --no-build --no-dependencies --no-restore -f net8.0 \ -o "..$S..$S..$S$(TEMP_DOTNET_DIR)" \ ortools$Sdotnet$S$(DOTNET_ORTOOLS_ASSEMBLY_NAME)$S$(DOTNET_ORTOOLS_ASSEMBLY_NAME).csproj "$(DOTNET_BIN)" pack -c Release $(NUGET_PACK_ARGS) --no-build \ @@ -750,7 +750,7 @@ nuget_archive: dotnet | $(TEMP_DOTNET_DIR) .PHONY: nuget_upload # Upload Nuget Package nuget_upload: nuget_archive - @echo Uploading Nuget package for "netcoreapp3.1;net6.0". + @echo Uploading Nuget package for "netcoreapp3.1;net8.0". $(warning Not Implemented) endif # HAS_DOTNET=ON diff --git a/ortools/dotnet/CreateSigningKey/CreateSigningKey.csproj b/ortools/dotnet/CreateSigningKey/CreateSigningKey.csproj index a7c0d90456..67f0dd4c04 100644 --- a/ortools/dotnet/CreateSigningKey/CreateSigningKey.csproj +++ b/ortools/dotnet/CreateSigningKey/CreateSigningKey.csproj @@ -1,7 +1,7 @@ Exe - net6.0 + net8.0 1.0.0 diff --git a/ortools/dotnet/README.md b/ortools/dotnet/README.md index f11ce54848..d3836cd37b 100644 --- a/ortools/dotnet/README.md +++ b/ortools/dotnet/README.md @@ -25,11 +25,11 @@ and osx-x64) nuget package using `dotnet` and few `.csproj`. ## Requirement -The library is compiled against `netcoreapp3.1` and `net6.0`, so you'll only +The library is compiled against `netcoreapp3.1` and `net8.0`, so you'll only need: * .Net Core 3.1 LTS SDK -* .Net 6.0 LTS SDK +* .Net 8.0 LTS SDK note: We won't/can't rely on VS 2022 since we want a portable cross-platform [`dotnet/cli`](https://github.com/dotnet/cli) pipeline. @@ -230,7 +230,7 @@ defined) should have this layout: \- Google.OrTools.dll ... ``` -note: `{framework}` could be `netcoreapp3.1` or/and `net6.0` +note: `{framework}` could be `netcoreapp3.1` or/and `net8.0` ### Complete Google.OrTools Package @@ -278,7 +278,7 @@ dotnet pack /dotnet/Google.OrTools ## Examples -The Test projects show examples of building applications with `net6.0`. +The Test projects show examples of building applications with `net8.0`. The F# example folder shows how to compile against the typical .NET Framework installed on machine. diff --git a/tools/Makefile.dotnet.mk b/tools/Makefile.dotnet.mk index 412106c70a..0a7d4a78bb 100644 --- a/tools/Makefile.dotnet.mk +++ b/tools/Makefile.dotnet.mk @@ -89,7 +89,7 @@ endif #ifeq SOURCE exist build: $(SOURCE) "$(DOTNET_BIN)" build examples/$(SOURCE_NAME)/project.csproj run: build - "$(DOTNET_BIN)" run --no-build --framework net6.0 --project examples/$(SOURCE_NAME)/project.csproj -- $(ARGS) + "$(DOTNET_BIN)" run --no-build --framework net8.0 --project examples/$(SOURCE_NAME)/project.csproj -- $(ARGS) endif #ifeq SOURCE diff --git a/tools/README.cc.java.dotnet b/tools/README.cc.java.dotnet index c2cda14b6a..ea857dfc93 100644 --- a/tools/README.cc.java.dotnet +++ b/tools/README.cc.java.dotnet @@ -101,12 +101,12 @@ make run SOURCE=examples/dotnet/Vrp/Vrp.cs ```shell dotnet build examples/dotnet/Vrp/Vrp.csproj - dotnet run --no-build --framework net6.0 --project examples/dotnet/Vrp/Vrp.csproj + dotnet run --no-build --framework net8.0 --project examples/dotnet/Vrp/Vrp.csproj ``` - on Windows: ```shell dotnet build examples\dotnet\Vrp\Vrp.csproj - dotnet run --no-build --framework net6.0 --project examples\dotnet\Vrp\Vrp.csproj + dotnet run --no-build --framework net8.0 --project examples\dotnet\Vrp\Vrp.csproj ```