cmake(java): Add examples/tests (#202)

This commit is contained in:
Mizux Seiha
2020-09-17 18:45:34 +02:00
parent 87aba8675b
commit adfc450aa9
3 changed files with 35 additions and 2 deletions

View File

@@ -244,7 +244,10 @@ foreach(SAMPLES IN ITEMS algorithms graph linear_solver constraint_solver sat)
add_subdirectory(ortools/${SAMPLES}/samples)
endforeach()
# Same for examples/contrib
# Same for examples
foreach(EXAMPLES IN ITEMS contrib cpp python java dotnet)
add_subdirectory(examples/${EXAMPLES})
endforeach()
# Add tests in examples/tests
add_subdirectory(examples/tests)

View File

@@ -0,0 +1,31 @@
if(NOT BUILD_EXAMPLES)
return()
endif()
if(BUILD_CXX_EXAMPLES)
file(GLOB CXX_SRCS "*.cc")
foreach(FILE_NAME IN LISTS CXX_SRCS)
#add_cxx_test(${FILE_NAME})
endforeach()
endif()
if(BUILD_PYTHON_EXAMPLES)
file(GLOB PYTHON_SRCS "*.py")
foreach(FILE_NAME IN LISTS PYTHON_SRCS)
#add_python_test(${FILE_NAME})
endforeach()
endif()
if(BUILD_JAVA_EXAMPLES)
file(GLOB JAVA_SRCS "*.java")
foreach(FILE_NAME IN LISTS JAVA_SRCS)
add_java_test(${FILE_NAME})
endforeach()
endif()
if(BUILD_DOTNET_EXAMPLES)
file(GLOB DOTNET_SRCS "*.cs")
foreach(FILE_NAME IN LISTS DOTNET_SRCS)
#add_dotnet_test(${FILE_NAME})
endforeach()
endif()

View File

@@ -17,7 +17,6 @@ import com.google.ortools.linearsolver.MPConstraint;
import com.google.ortools.linearsolver.MPObjective;
import com.google.ortools.linearsolver.MPSolver;
import com.google.ortools.linearsolver.MPVariable;
import com.google.ortools.linearsolver.main_research_linear_solver;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.logging.Logger;