aboutsummaryrefslogtreecommitdiff
path: root/kokoro/scripts
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2018-11-20 13:17:36 -0500
committerDavid Neto <dneto@google.com>2018-11-20 13:17:36 -0500
commite84624514a1016c82d3e6ddabd9336b7842f13e5 (patch)
tree37484fede213009b1fbb2547dcb8448928e25b88 /kokoro/scripts
parent8088edb8104388e06481f29928609caee742e737 (diff)
downloadamber-e84624514a1016c82d3e6ddabd9336b7842f13e5.tar.gz
Add kokoro configs for Windows (#73)
Diffstat (limited to 'kokoro/scripts')
-rw-r--r--kokoro/scripts/windows/build.bat67
1 files changed, 67 insertions, 0 deletions
diff --git a/kokoro/scripts/windows/build.bat b/kokoro/scripts/windows/build.bat
new file mode 100644
index 0000000..d3db67a
--- /dev/null
+++ b/kokoro/scripts/windows/build.bat
@@ -0,0 +1,67 @@
+:: Copyright The Amber Authors.
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+
+@echo on
+
+set BUILD_ROOT=%cd%
+set SRC=%cd%\github\amber
+set BUILD_TYPE=%1
+
+:: Force usage of python 2.7 rather than 3.6
+set PATH=C:\python27;%PATH%
+
+cd %SRC%
+python tools\git-sync-deps
+
+:: #########################################
+:: set up msvc build env
+:: #########################################
+call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
+echo "Using VS 2017..."
+
+cd %SRC%
+mkdir build
+cd build
+
+:: #########################################
+:: Start building.
+:: #########################################
+echo "Starting build... %DATE% %TIME%"
+if "%KOKORO_GITHUB_COMMIT%." == "." (
+ set BUILD_SHA=%KOKORO_GITHUB_PULL_REQUEST_COMMIT%
+) else (
+ set BUILD_SHA=%KOKORO_GITHUB_COMMIT%
+)
+
+cmake -GNinja -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ..
+
+if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
+
+echo "Build everything... %DATE% %TIME%"
+ninja
+if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
+echo "Build Completed %DATE% %TIME%"
+
+:: ################################################
+:: Run the tests (We no longer run tests on VS2013)
+:: ################################################
+echo "Running Tests... %DATE% %TIME%"
+amber_unittests
+if %ERRORLEVEL% GEQ 1 exit /b %ERRORLEVEL%
+echo "Tests Completed %DATE% %TIME%"
+
+:: Clean up some directories.
+rm -rf %SRC%\build
+
+exit /b %ERRORLEVEL%