diff --git a/.gitignore b/.gitignore index f9510a17ce..b80fa41415 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,11 @@ cache/ tools/netstandard/CreateSigningKey/bin tools/netstandard/CreateSigningKey/obj +**/.vs/* +**/dotnet-test/* + +**/packages + ortools/fsharp/**/bin ortools/fsharp/**/obj ortools/fsharp/**/packages diff --git a/examples/fsharp/csintegerprogramming.fsx b/examples/fsharp/csintegerprogramming.fsx index 869dea6e06..f80dc33080 100644 --- a/examples/fsharp/csintegerprogramming.fsx +++ b/examples/fsharp/csintegerprogramming.fsx @@ -12,8 +12,11 @@ // limitations under the License. #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open System open Google.OrTools.FSharp diff --git a/examples/fsharp/cslinearprogramming.fsx b/examples/fsharp/cslinearprogramming.fsx index 9239297f0b..c7300b7e7e 100644 --- a/examples/fsharp/cslinearprogramming.fsx +++ b/examples/fsharp/cslinearprogramming.fsx @@ -11,9 +11,13 @@ // See the License for the specific language governing permissions and // limitations under the License. + #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open System open Google.OrTools.LinearSolver diff --git a/examples/fsharp/diet.fsx b/examples/fsharp/diet.fsx index 399b45f829..ea9425d0ae 100644 --- a/examples/fsharp/diet.fsx +++ b/examples/fsharp/diet.fsx @@ -17,7 +17,11 @@ *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" +#r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.ConstraintSolver diff --git a/examples/fsharp/equality-inequality.fsx b/examples/fsharp/equality-inequality.fsx index fedac29be3..33e1def9b1 100644 --- a/examples/fsharp/equality-inequality.fsx +++ b/examples/fsharp/equality-inequality.fsx @@ -21,8 +21,11 @@ *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open System open Google.OrTools.FSharp diff --git a/examples/fsharp/equality.fsx b/examples/fsharp/equality.fsx index 3e24522ea5..06bb6e8901 100644 --- a/examples/fsharp/equality.fsx +++ b/examples/fsharp/equality.fsx @@ -19,8 +19,11 @@ *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open System open Google.OrTools.FSharp diff --git a/examples/fsharp/integer-linear-program.fsx b/examples/fsharp/integer-linear-program.fsx index 4974b560fb..c0683be02b 100644 --- a/examples/fsharp/integer-linear-program.fsx +++ b/examples/fsharp/integer-linear-program.fsx @@ -36,11 +36,13 @@ *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.FSharp -open Google.OrTools.LinearSolver let opts = SolverOpts.Default .Goal(Maximize) diff --git a/examples/fsharp/knapsack.fsx b/examples/fsharp/knapsack.fsx index 5ee8947429..02426c6c29 100644 --- a/examples/fsharp/knapsack.fsx +++ b/examples/fsharp/knapsack.fsx @@ -16,8 +16,11 @@ limitations under the License. *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.FSharp diff --git a/examples/fsharp/network-max-flow-lpSolve.fsx b/examples/fsharp/network-max-flow-lpSolve.fsx index c17da3b62d..283edf0524 100644 --- a/examples/fsharp/network-max-flow-lpSolve.fsx +++ b/examples/fsharp/network-max-flow-lpSolve.fsx @@ -23,8 +23,11 @@ *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.FSharp diff --git a/examples/fsharp/network-max-flow.fsx b/examples/fsharp/network-max-flow.fsx index 8d7f644017..fd4c5df5bd 100644 --- a/examples/fsharp/network-max-flow.fsx +++ b/examples/fsharp/network-max-flow.fsx @@ -29,8 +29,11 @@ *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.Graph open Google.OrTools.FSharp diff --git a/examples/fsharp/network-min-cost-flow.fsx b/examples/fsharp/network-min-cost-flow.fsx index 7c24dcfe17..682f93dea8 100644 --- a/examples/fsharp/network-min-cost-flow.fsx +++ b/examples/fsharp/network-min-cost-flow.fsx @@ -1,6 +1,9 @@ #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.Graph open Google.OrTools.FSharp diff --git a/examples/fsharp/packages.config b/examples/fsharp/packages.config new file mode 100644 index 0000000000..6bfae13b5f --- /dev/null +++ b/examples/fsharp/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/examples/fsharp/rabbit-pheasant.fsx b/examples/fsharp/rabbit-pheasant.fsx index 9048247c2d..62928da8f3 100644 --- a/examples/fsharp/rabbit-pheasant.fsx +++ b/examples/fsharp/rabbit-pheasant.fsx @@ -1,6 +1,10 @@ #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" +#r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.ConstraintSolver diff --git a/examples/fsharp/volsay.fsx b/examples/fsharp/volsay.fsx index 12c947f290..9ba2d5126c 100644 --- a/examples/fsharp/volsay.fsx +++ b/examples/fsharp/volsay.fsx @@ -14,8 +14,11 @@ // limitations under the License. #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open System open Google.OrTools.FSharp diff --git a/examples/fsharp/volsay3-lpSolve.fsx b/examples/fsharp/volsay3-lpSolve.fsx index 1d6c140a4e..89934355a1 100644 --- a/examples/fsharp/volsay3-lpSolve.fsx +++ b/examples/fsharp/volsay3-lpSolve.fsx @@ -15,8 +15,11 @@ *) #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open Google.OrTools.FSharp diff --git a/examples/fsharp/volsay3.fsx b/examples/fsharp/volsay3.fsx index f1547b066f..279ada2c81 100644 --- a/examples/fsharp/volsay3.fsx +++ b/examples/fsharp/volsay3.fsx @@ -14,8 +14,11 @@ // limitations under the License. #I "../../bin" +#I "./packages/NETStandard.Library.2.0.2/build/netstandard2.0/ref" + #r "Google.OrTools.dll" #r "Google.OrTools.FSharp.dll" +#r "netstandard.dll" open System open Google.OrTools.FSharp diff --git a/makefiles/Makefile.dotnet.mk b/makefiles/Makefile.dotnet.mk index fa77eab05e..b690a709f8 100644 --- a/makefiles/Makefile.dotnet.mk +++ b/makefiles/Makefile.dotnet.mk @@ -23,6 +23,10 @@ CLR_ORTOOLS_DLL_NAME?=Google.$(ORTOOLS_DLL_NAME) BASE_CLR_ORTOOLS_DLL_NAME:=$(CLR_ORTOOLS_DLL_NAME) CLR_ORTOOLS_IMPORT_DLL_NAME:=$(LIB_PREFIX)$(CLR_ORTOOLS_DLL_NAME) +# relative to the project root folder +DOTNET_ORTOOLS_TEST_DIR=dotnet-test +DOTNET_BUILD_DIR=build + # Check for required build tools ifeq ($(SYSTEM), win) DOTNET_EXECUTABLE := $(shell $(WHICH) dotnet.exe 2>nul) @@ -42,7 +46,7 @@ ifeq ($(PLATFORM),LINUX) DOTNET_LIB_DIR = env LD_LIBRARY_PATH=$(LIB_DIR) endif -CLEAN_FILES=$(CLR_PROTOBUF_DLL_NAME).* $(LIB_PREFIX)$(CLR_ORTOOLS_DLL_NAME).* $(CLR_ORTOOLS_DLL_NAME).* Google.$(FSHARP_ORTOOLS_DLL_NAME).* +CLEAN_FILES=$(CLR_PROTOBUF_DLL_NAME).* $(LIB_PREFIX)$(CLR_ORTOOLS_DLL_NAME).* $(CLR_ORTOOLS_DLL_NAME).* .PHONY: csharp_dotnet # Build C# OR-Tools csharp_dotnet: \ @@ -51,7 +55,8 @@ csharp_dotnet: \ # Assembly Info -$(GEN_DIR)/com/google/ortools/properties/GitVersion$(OR_TOOLS_VERSION).txt: +$(GEN_DIR)/com/google/ortools/properties/GitVersion$(OR_TOOLS_VERSION).txt: \ + | $(GEN_DIR)/com/google/ortools/properties @echo $(OR_TOOLS_VERSION) > $(GEN_DIR)$Scom$Sgoogle$Sortools$Sproperties$SGitVersion$(OR_TOOLS_VERSION).txt # csharp ortools @@ -182,26 +187,22 @@ $(BIN_DIR)/$(CLR_ORTOOLS_DLL_NAME)$(DLL): \ $(GEN_DIR)/com/google/ortools/sat/CpModel.g.cs \ $(OR_TOOLS_LIBS) $(DYNAMIC_LD) $(LD_OUT)$(LIB_DIR)$S$(LIB_PREFIX)$(CLR_ORTOOLS_DLL_NAME).$(SWIG_LIB_SUFFIX) $(OBJ_DIR)/swig/linear_solver_csharp_wrap.$O $(OBJ_DIR)/swig/sat_csharp_wrap.$O $(OBJ_DIR)/swig/constraint_solver_csharp_wrap.$O $(OBJ_DIR)/swig/knapsack_solver_csharp_wrap.$O $(OBJ_DIR)/swig/graph_csharp_wrap.$O $(OR_TOOLS_LNK) $(OR_TOOLS_LD_FLAGS) - $(SED) -i -e "s/.*<\/Version>/$(OR_TOOLS_VERSION)<\/Version>/" ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj - $(SED) -i -e "s/.*<\/AssemblyVersion>/$(OR_TOOLS_VERSION)<\/AssemblyVersion>/" ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj - $(SED) -i -e "s/.*<\/FileVersion>/$(OR_TOOLS_VERSION)<\/FileVersion>/" ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj - "$(DOTNET_EXECUTABLE)" restore ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj "$(DOTNET_EXECUTABLE)" build -c Debug ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj - "$(DOTNET_EXECUTABLE)" build -c Release ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj ifeq ($(SYSTEM),win) $(COPY) ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$Sbin$Sx64$SDebug$Snetstandard2.0$S*.* $(BIN_DIR) else $(COPY) ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$Sbin$SDebug$Snetstandard2.0$S*.* $(BIN_DIR) endif +ifeq ($(PLATFORM),MACOSX) + $(COPY) dependencies/install/lib/libgflags.*.dylib dependencies/install/lib/libglog.*.dylib dependencies/install/lib/libprotobuf.*.dylib dependencies/install/lib/libCbcSolver.*.dylib dependencies/install/lib/libCbc.*.dylib dependencies/install/lib/libOsiCbc.*.dylib dependencies/install/lib/libCgl.*.dylib dependencies/install/lib/libClpSolver.*.dylib dependencies/install/lib/libClp.*.dylib dependencies/install/lib/libOsiClp.*.dylib dependencies/install/lib/libOsi.*.dylib dependencies/install/lib/libCoinUtils.*.dylib $(LIB_DIR) +endif +ifeq ($(PLATFORM),LINUX) + $(COPY) dependencies/install/lib/libgflags.*.so dependencies/install/lib/libglog.*.so dependencies/install/lib/libprotobuf.*.so dependencies/install/lib/libCbcSolver.*.so dependencies/install/lib/libCbc.*.so dependencies/install/lib/libOsiCbc.*.so dependencies/install/lib/libCgl.*.so dependencies/install/lib/libClpSolver.*.so dependencies/install/lib/libClp.*.so dependencies/install/lib/libOsiClp.*.so dependencies/install/lib/libOsi.*.so dependencies/install/lib/libCoinUtils.*.so $(LIB_DIR) +endif .PHONY: fsharp_dotnet # Build F# OR-Tools fsharp_dotnet: - $(SED) -i -e "s/.*<\/Version>/$(OR_TOOLS_VERSION)<\/Version>/" ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj - $(SED) -i -e "s/.*<\/AssemblyVersion>/$(OR_TOOLS_VERSION)<\/AssemblyVersion>/" ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj - $(SED) -i -e "s/.*<\/FileVersion>/$(OR_TOOLS_VERSION)<\/FileVersion>/" ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj - "$(DOTNET_EXECUTABLE)" restore ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj "$(DOTNET_EXECUTABLE)" build -c Debug ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj - "$(DOTNET_EXECUTABLE)" build -c Release ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj ifeq ($(SYSTEM),win) $(COPY) ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$Sbin$Sx64$SDebug$Snetstandard2.0$S*.* $(BIN_DIR) else @@ -210,29 +211,41 @@ endif .PHONY: clean_dotnet # Clean files clean_dotnet: + $(DELREC) $(GEN_DIR) + $(DELREC) .$S$(DOTNET_ORTOOLS_TEST_DIR) $(foreach var,$(CLEAN_FILES), $(DEL) bin$S$(var);) .PHONY: test_dotnet # Test dotnet version of OR-Tools -test_dotnet: +test_dotnet: csharp_dotnet fsharp_dotnet "$(DOTNET_EXECUTABLE)" restore --packages "ortools$Sdotnet$Spackages" "ortools$Sdotnet$S$(ORTOOLS_DLL_TEST)$S$(ORTOOLS_DLL_TEST).csproj" + $(MKDIR_P) .$S$(DOTNET_ORTOOLS_TEST_DIR) "$(DOTNET_EXECUTABLE)" clean "ortools$Sdotnet$S$(ORTOOLS_DLL_TEST)$S$(ORTOOLS_DLL_TEST).csproj" - "$(DOTNET_EXECUTABLE)" build "ortools$Sdotnet$S$(ORTOOLS_DLL_TEST)$S$(ORTOOLS_DLL_TEST).csproj" + "$(DOTNET_EXECUTABLE)" build -o "..$S..$S..$S$(DOTNET_ORTOOLS_TEST_DIR)" "ortools$Sdotnet$S$(ORTOOLS_DLL_TEST)$S$(ORTOOLS_DLL_TEST).csproj" "$(DOTNET_EXECUTABLE)" clean "ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_TEST)$S$(FSHARP_ORTOOLS_DLL_TEST).fsproj" - "$(DOTNET_EXECUTABLE)" build "ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_TEST)$S$(FSHARP_ORTOOLS_DLL_TEST).fsproj" - + "$(DOTNET_EXECUTABLE)" build -o "..$S..$S..$S$(DOTNET_ORTOOLS_TEST_DIR)" "ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_TEST)$S$(FSHARP_ORTOOLS_DLL_TEST).fsproj" + # $(COPY) $(LIB_DIR)$S*.* .$S$(DOTNET_ORTOOLS_TEST_DIR) ifeq ($(SYSTEM),win) - $(DOTNET_LIB_DIR) "$(DOTNET_EXECUTABLE)" "ortools$Sdotnet$Spackages$Sxunit.runner.console$S2.3.1$Stools$Snetcoreapp2.0$Sxunit.console.dll" "ortools$Sdotnet$S$(ORTOOLS_DLL_TEST)$Sbin$Sx64$SDebug$Snetcoreapp2.0$SGoogle.$(ORTOOLS_DLL_TEST).dll" "ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_TEST)$Sbin$Sx64$SDebug$Snetcoreapp2.0$SGoogle.$(FSHARP_ORTOOLS_DLL_TEST).dll" -verbose + $(DOTNET_LIB_DIR) "$(DOTNET_EXECUTABLE)" "ortools$Sdotnet$Spackages$Sxunit.runner.console$S2.3.1$Stools$Snetcoreapp2.0$Sxunit.console.dll" ".$S$(DOTNET_ORTOOLS_TEST_DIR)$SGoogle.$(ORTOOLS_DLL_TEST).dll" ".$S$(DOTNET_ORTOOLS_TEST_DIR)$SGoogle.$(FSHARP_ORTOOLS_DLL_TEST).dll" -verbose else - $(DOTNET_LIB_DIR) "$(DOTNET_EXECUTABLE)" "ortools$Sdotnet$Spackages$Sxunit.runner.console$S2.3.1$Stools$Snetcoreapp2.0$Sxunit.console.dll" "ortools$Sdotnet$S$(ORTOOLS_DLL_TEST)$Sbin$SDebug$Snetcoreapp2.0$SGoogle.$(ORTOOLS_DLL_TEST).dll" "ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_TEST)$Sbin$SDebug$Snetcoreapp2.0$SGoogle.$(FSHARP_ORTOOLS_DLL_TEST).dll" -verbose + $(DOTNET_LIB_DIR) "$(DOTNET_EXECUTABLE)" "ortools$Sdotnet$Spackages$Sxunit.runner.console$S2.3.1$Stools$Snetcoreapp2.0$Sxunit.console.dll" ".$S$(DOTNET_ORTOOLS_TEST_DIR)$SGoogle.$(ORTOOLS_DLL_TEST).dll" ".$S$(DOTNET_ORTOOLS_TEST_DIR)$SGoogle.$(FSHARP_ORTOOLS_DLL_TEST).dll" -verbose endif .PHONY: dotnet # Build OrTools for .NET -dotnet: \ - clean_dotnet \ - csharp_dotnet \ - fsharp_dotnet -BUILT_LANGUAGES +=, dotnet (netstandard2.0/net462) +dotnet: clean_dotnet test_dotnet + $(SED) -i -e "s/.*<\/Version>/$(OR_TOOLS_VERSION)<\/Version>/" ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj + $(SED) -i -e "s/.*<\/AssemblyVersion>/$(OR_TOOLS_VERSION)<\/AssemblyVersion>/" ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj + $(SED) -i -e "s/.*<\/FileVersion>/$(OR_TOOLS_VERSION)<\/FileVersion>/" ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj + $(SED) -i -e "s/.*<\/Version>/$(OR_TOOLS_VERSION)<\/Version>/" ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj + $(SED) -i -e "s/.*<\/AssemblyVersion>/$(OR_TOOLS_VERSION)<\/AssemblyVersion>/" ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj + $(SED) -i -e "s/.*<\/FileVersion>/$(OR_TOOLS_VERSION)<\/FileVersion>/" ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj + "$(DOTNET_EXECUTABLE)" build -c Release -o $(BIN_DIR) ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj + "$(DOTNET_EXECUTABLE)" build -c Release -o $(BIN_DIR) ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj + $(MKDIR_P) $(DOTNET_BUILD_DIR) + "$(DOTNET_EXECUTABLE)" publish -c Release -o "..$S..$S..$S$(DOTNET_BUILD_DIR)" -f netstandard2.0 ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj + + +BUILT_LANGUAGES +=, dotnet (netstandard2.0) ifeq ($(SYSTEM),win) NUGET_COMPILER ?= nuget.exe @@ -245,15 +258,12 @@ NUGET_SRC = https://www.nuget.org/api/v2/package .PHONY: pkg_dotnet # Build Nuget Package pkg_dotnet: - $(SED) -i -e "s/MMMM/$(CLR_ORTOOLS_DLL_NAME)/" ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE) - $(SED) -i -e "s/VVVV/$(OR_TOOLS_VERSION)/" ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE) - $(NUGET_EXECUTABLE) pack ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE) + $(warning Not Implemented) .PHONY: pkg_dotnet-upload # Upload Nuget Package pkg_dotnet-upload: nuget_archive $(warning Not Implemented) - .PHONY: detect_dotnet # Show variables used to build dotnet OR-Tools. detect_dotnet: @echo Relevant info for the dotnet build: diff --git a/ortools/dotnet/OrTools.FSharp/OrTools.FSharp.fsproj b/ortools/dotnet/OrTools.FSharp/OrTools.FSharp.fsproj index d806e4b835..2f352e44c8 100644 --- a/ortools/dotnet/OrTools.FSharp/OrTools.FSharp.fsproj +++ b/ortools/dotnet/OrTools.FSharp/OrTools.FSharp.fsproj @@ -5,7 +5,7 @@ Library Google.OrTools.FSharp - netstandard2.0;net462 + netstandard2.0 Google.OrTools.FSharp OrTools.FSharp.nuspec diff --git a/ortools/dotnet/OrTools/OrTools.csproj b/ortools/dotnet/OrTools/OrTools.csproj index 122cffb5b9..e1dc43d7ea 100644 --- a/ortools/dotnet/OrTools/OrTools.csproj +++ b/ortools/dotnet/OrTools/OrTools.csproj @@ -6,7 +6,7 @@ Library Google.OrTools - netstandard2.0;net462 + netstandard2.0 Google.OrTools False ..\OrTools.nuspec diff --git a/ortools/dotnet/README.md b/ortools/dotnet/README.md index e06bedc45a..c1623f6072 100644 --- a/ortools/dotnet/README.md +++ b/ortools/dotnet/README.md @@ -1,5 +1,18 @@ # Google OrTools ## Pre-requisites -- dotnet core 2.0 -- mono 5.4 +- dotnet core 2.1 +- .NET framework (mono, net46x) +- nuget + +## Build +The library is compiled against `netstandard2.0`. + +Either use the makefile or you can build in Visual Studio. The workflow is typically +`make test_fsharp` which will build both C# and F# libraries in debug mode. The output will be placed in `/dotnet-test` folder. All tests will be run based on this folder. When you are ready to package the application `make dotnet` will change the version and install a release version in `bin` and in `build`. + +## Examples + +The Test projects show an example of building the application with `netcoreapp2.0`. + +The F# example folder shows how to compile against the typical .NET Framework installed on machine. Before compiling be sure to run `nuget install -o ./packages` in the example folder.