From 454bb2cb44ad368fa560d1203358addfae64ba75 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Fri, 27 Aug 2021 13:27:19 +0200 Subject: [PATCH] fix .Net and Java build --- makefiles/Makefile.dotnet.mk | 1 + makefiles/Makefile.java.mk | 4 ++-- ortools/constraint_solver/routing.h | 4 ++++ ortools/sat/sat_parameters.proto | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/makefiles/Makefile.dotnet.mk b/makefiles/Makefile.dotnet.mk index eb9f45f0fc..6e2767e3f9 100644 --- a/makefiles/Makefile.dotnet.mk +++ b/makefiles/Makefile.dotnet.mk @@ -409,6 +409,7 @@ $(DOTNET_ORTOOLS_RUNTIME_NUPKG): \ $(GEN_DIR)/ortools/constraint_solver/RoutingParameters.pb.cs \ $(GEN_DIR)/ortools/constraint_solver/RoutingEnums.pb.cs \ $(GEN_DIR)/ortools/sat/CpModel.pb.cs \ + $(GEN_DIR)/ortools/sat/SatParameters.pb.cs \ $(GEN_DIR)/ortools/util/OptionalBoolean.pb.cs \ | $(DOTNET_ORTOOLS_SNK) $(DOTNET_PACKAGE_DIR) "$(DOTNET_BIN)" build $(DOTNET_BUILD_ARGS) $(TEMP_DOTNET_DIR)$S$(DOTNET_ORTOOLS_RUNTIME_ASSEMBLY_NAME)$S$(DOTNET_ORTOOLS_RUNTIME_ASSEMBLY_NAME).csproj diff --git a/makefiles/Makefile.java.mk b/makefiles/Makefile.java.mk index 3c8c7433a6..a309fc687c 100644 --- a/makefiles/Makefile.java.mk +++ b/makefiles/Makefile.java.mk @@ -347,9 +347,9 @@ $(JAVA_ORTOOLS_JAR): \ $(GEN_DIR)/java/com/google/ortools/constraintsolver/RoutingParameters.java \ $(GEN_DIR)/java/com/google/ortools/constraintsolver/RoutingEnums.java \ $(GEN_DIR)/java/com/google/ortools/linearsolver/MPModelProto.java \ + $(GEN_DIR)/java/com/google/ortools/sat/CpModelProto.java \ $(GEN_DIR)/java/com/google/ortools/sat/SatParameters.java \ $(GEN_DIR)/java/com/google/ortools/util/OptionalBoolean.java \ - $(GEN_DIR)/java/com/google/ortools/sat/CpModelProto.java \ $(SRC_DIR)/ortools/java/com/google/ortools/Loader.java \ $(SRC_DIR)/ortools/java/com/google/ortools/constraintsolver/IntIntToLongFunction.java \ $(SRC_DIR)/ortools/java/com/google/ortools/constraintsolver/JavaDecisionBuilder.java \ @@ -481,9 +481,9 @@ $(TEMP_JAVA_DIR)/$(JAVA_ORTOOLS_PROJECT)/timestamp: \ $(GEN_DIR)/java/com/google/ortools/constraintsolver/RoutingParameters.java \ $(GEN_DIR)/java/com/google/ortools/constraintsolver/RoutingEnums.java \ $(GEN_DIR)/java/com/google/ortools/linearsolver/MPModelProto.java \ + $(GEN_DIR)/java/com/google/ortools/sat/CpModelProto.java \ $(GEN_DIR)/java/com/google/ortools/sat/SatParameters.java \ $(GEN_DIR)/java/com/google/ortools/util/OptionalBoolean.java \ - $(GEN_DIR)/java/com/google/ortools/sat/CpModelProto.java \ $(SRC_DIR)/ortools/java/com/google/ortools/Loader.java \ $(SRC_DIR)/ortools/java/com/google/ortools/constraintsolver/IntIntToLongFunction.java \ $(SRC_DIR)/ortools/java/com/google/ortools/constraintsolver/JavaDecisionBuilder.java \ diff --git a/ortools/constraint_solver/routing.h b/ortools/constraint_solver/routing.h index 4577b4c003..e0ed93117c 100644 --- a/ortools/constraint_solver/routing.h +++ b/ortools/constraint_solver/routing.h @@ -376,6 +376,7 @@ class RoutingModel { // clang-format on }; +#ifndef SWIG /// A ResourceGroup defines a set of available Resources with attributes on /// one or multiple dimensions. /// For every ResourceGroup in the model, each (used) vehicle in the solution @@ -444,6 +445,7 @@ class RoutingModel { /// All indices of dimensions affected by this resource group. absl::flat_hash_set affected_dimension_indices_; }; +#endif // SWIG /// Constant used to express a hard constraint instead of a soft penalty. static const int64_t kNoPenalty; @@ -680,12 +682,14 @@ class RoutingModel { return primary_constrained_dimension_; } +#ifndef SWIG ResourceGroup* const AddResourceGroup(); // clang-format off const std::vector >& GetResourceGroups() const { return resource_groups_; } +#endif // SWIG // clang-format on /// Returns the indices of resource groups for this dimension. This method can /// only be called after the model has been closed. diff --git a/ortools/sat/sat_parameters.proto b/ortools/sat/sat_parameters.proto index a17dae30b2..613f77dd7f 100644 --- a/ortools/sat/sat_parameters.proto +++ b/ortools/sat/sat_parameters.proto @@ -17,6 +17,7 @@ package operations_research.sat; option java_package = "com.google.ortools.sat"; option java_multiple_files = true; +option csharp_namespace = "Google.OrTools.Sat"; // Contains the definitions for all the sat algorithm parameters and their