From 9aaa87a35a388812cdb30fbf9f8156cb858bb235 Mon Sep 17 00:00:00 2001 From: Matthew Moore Date: Thu, 26 Apr 2018 20:41:34 -0700 Subject: [PATCH] Only build dotnet in CI --- .travis.yml | 13 ++----------- .travis/install.sh | 12 ++++++------ .travis/script.sh | 13 +++++-------- Makefile | 10 +++++----- makefiles/Makefile.dotnet.mk | 9 ++++----- 5 files changed, 22 insertions(+), 35 deletions(-) diff --git a/.travis.yml b/.travis.yml index e22a8251b7..107ce2b9e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,12 +23,7 @@ matrix: dist: trusty language: cpp compiler: gcc - env: BUILDER=make DISTRO=native LANGUAGE=csharp - - os: linux - dist: trusty - language: cpp - compiler: gcc - env: BUILDER=make DISTRO=native LANGUAGE=fsharp + env: BUILDER=make DISTRO=native LANGUAGE=dotnet - os: osx language: cpp @@ -45,11 +40,7 @@ matrix: - os: osx language: cpp compiler: clang - env: BUILDER=make DISTRO=native LANGUAGE=csharp - - os: osx - language: cpp - compiler: clang - env: BUILDER=make DISTRO=native LANGUAGE=fsharp + env: BUILDER=make DISTRO=native LANGUAGE=dotnet # CMake Build Generator - os: linux dist: trusty diff --git a/.travis/install.sh b/.travis/install.sh index 62c16b9ccb..505c81a51b 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -49,9 +49,7 @@ if [ "${BUILDER}" == make ]; then if [ "${LANGUAGE}" == python ]; then pyenv global system 3.6; python3.6 -m pip install -q virtualenv wheel six; - elif [ "${LANGUAGE}" == csharp ]; then - installmono - elif [ "${LANGUAGE}" == fsharp ]; then + elif [ "${LANGUAGE}" == dotnet ]; then installmono sudo apt-get -yqq install fsharp installdotnetsdk @@ -72,10 +70,12 @@ if [ "${BUILDER}" == make ]; then python3.6 -m pip install -q virtualenv wheel six; elif [ "${LANGUAGE}" == java ]; then brew cask install java; - elif [ "${LANGUAGE}" == csharp ] || [ "${LANGUAGE}" == fsharp ]; then - brew install mono + elif [ "${LANGUAGE}" == dotnet ]; then + brew install mono; + # Installer changes path but won't be picked up in current terminal session + # Need to explicitly add location (see Makefile.fsharp.mk) brew tap caskroom/cask - brew cask install dotnet-sdk + brew cask install dotnet-sdk; fi else # MacOS Docker Makefile build: diff --git a/.travis/script.sh b/.travis/script.sh index f6c20080bc..4caac592d2 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -15,12 +15,9 @@ function checkenv() { python3.6 -m pip --version elif [ "${LANGUAGE}" == java ]; then java -version - elif [ "${LANGUAGE}" == csharp ]; then + elif [ "${LANGUAGE}" == dotnet ]; then mono --version - which csharp - elif [ "${LANGUAGE}" == fsharp ]; then - mono --version - dotnet -h + which dotnet fi } @@ -40,7 +37,7 @@ if [ "${BUILDER}" == make ];then make detect UNIX_PYTHON_VER=3.6 elif [ "${LANGUAGE}" == java ]; then make detect JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 - elif [ "${LANGUAGE}" == csharp ] || [ "${LANGUAGE}" == fsharp ] ; then + elif [ "${LANGUAGE}" == dotnet ] ; then make detect fi cat Makefile.local @@ -56,7 +53,7 @@ if [ "${BUILDER}" == make ];then fi elif [ "${TRAVIS_OS_NAME}" == osx ];then if [ "${DISTRO}" == native ];then - if [ "${LANGUAGE}" == fsharp ]; then + if [ "${LANGUAGE}" == dotnet ]; then # Installer changes path but won't be picked up in current terminal session # Need to explicitly add location export PATH=/usr/local/share/dotnet:"${PATH}" @@ -66,7 +63,7 @@ if [ "${BUILDER}" == make ];then make detect elif [ "${LANGUAGE}" == python ]; then make detect UNIX_PYTHON_VER=3.6 - elif [ "${LANGUAGE}" == java ] || [ "${LANGUAGE}" == csharp ] || [ "${LANGUAGE}" == fsharp ]; then + elif [ "${LANGUAGE}" == java ] || [ "${LANGUAGE}" == dotnet ] ; then make detect fi cat Makefile.local diff --git a/Makefile b/Makefile index 9b8d85c936..e662439757 100755 --- a/Makefile +++ b/Makefile @@ -82,21 +82,21 @@ else endif .PHONY: help_all -help_all: help_usage help_third_party help_cc help_python help_java help_csharp help_fsharp +help_all: help_usage help_third_party help_cc help_python help_java help_dotnet .PHONY: build_all -build_all: cc python java csharp fsharp +build_all: cc python java dotnet @echo Or-tools have been built for $(BUILT_LANGUAGES) .PHONY: test_all -test_all: test_cc test_python test_java test_csharp test_fsharp +test_all: test_cc test_python test_java test_dotnet @echo Or-tools have been built and tested for $(BUILT_LANGUAGES) .PHONY: clean_all -clean_all: clean_cc clean_python clean_java clean_csharp clean_compat clean_fsharp +clean_all: clean_cc clean_python clean_java clean_dotnet clean_compat @echo Or-tools have been cleaned for $(BUILT_LANGUAGES) .PHONY: detect_all -detect_all: detect_port detect_third_party detect_cc detect_python detect_java detect_csharp detect_fsharp +detect_all: detect_port detect_third_party detect_cc detect_python detect_java detect_dotnet print-% : ; @echo $* = $($*) diff --git a/makefiles/Makefile.dotnet.mk b/makefiles/Makefile.dotnet.mk index 4b2173aa6b..34ffd523ec 100644 --- a/makefiles/Makefile.dotnet.mk +++ b/makefiles/Makefile.dotnet.mk @@ -30,7 +30,7 @@ else # UNIX ifeq ($(PLATFORM),MACOSX) DOTNET_EXECUTABLE := $(shell dirname ${DOTNET_INSTALL_PATH})$Sdotnet else # LINUX -DOTNET_EXECUTABLE := $(shell which dotnet) +DOTNET_EXECUTABLE := $(shell $(WHICH) dotnet) endif endif @@ -48,7 +48,6 @@ CLEAN_FILES=$(CLR_PROTOBUF_DLL_NAME).* $(CLR_ORTOOLS_DLL_NAME).* Google.$(FSHARP csharp_dotnet: \ ortoolslibs \ csharportools -BUILT_LANGUAGES +=, netstandard2.0 # Assembly Info @@ -178,7 +177,7 @@ $(BIN_DIR)/$(CLR_ORTOOLS_DLL_NAME)$(DLL): \ $(GEN_DIR)/com/google/ortools/sat/CpModel.g.cs \ $(OR_TOOLS_LIBS) $(DYNAMIC_LD) $(LDOUT)$(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/0.0.0.0/$(OR_TOOLS_VERSION)/" ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj + $(SED) -i -e "s/0.0.0.0/$(OR_TOOLS_VERSION)/" 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 @@ -186,7 +185,7 @@ $(BIN_DIR)/$(CLR_ORTOOLS_DLL_NAME)$(DLL): \ .PHONY: fsharp_dotnet # Build F# OR-Tools fsharp_dotnet: - # $(SED) -i -e "s/0.0.0.0/$(OR_TOOLS_VERSION)/" ortools$Sdotnet$S$(FSHARP_ORTOOLS_DLL_NAME)$S$(FSHARP_ORTOOLS_DLL_NAME).fsproj + $(SED) -i -e "s/0.0.0.0/$(OR_TOOLS_VERSION)/" 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 @@ -212,7 +211,7 @@ dotnet: \ clean_dotnet \ csharp_dotnet \ fsharp_dotnet - +BUILT_LANGUAGES +=, netstandard2.0 ifeq ($(SYSTEM),win) NUGET_COMPILER ?= nuget.exe