Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add windows to travis (#327)
authoradegomme <13270544+adegomme@users.noreply.github.com>
Thu, 4 Jul 2019 14:24:05 +0000 (16:24 +0200)
committerMartin Quinson <624847+mquinson@users.noreply.github.com>
Thu, 4 Jul 2019 14:24:05 +0000 (16:24 +0200)
travis: compile on windows (and drop appveyor)

.travis.yml
src/bindings/java/org/simgrid/NativeLib.java
tools/cmake/Java.cmake

index 4368a85..f0f882b 100644 (file)
@@ -48,11 +48,21 @@ addons:
 #   - ls -lR $TRAVIS_BUILD_DIR/LuaInstall
 
 script:
-   - if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON .; fi
-   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -Denable_model-checking=ON  -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1) ; fi
-   # run make and ctest in the sonar wrapper on master/linux; run it directly in PR or OSX
-   # - if [[ -e Makefile ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then ./tools/internal/travis-sonarqube.sh make -j2 VERBOSE=1; else make -j2 VERBOSE=1 && ctest -j2 --output-on-failure ; fi
-   - make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure
+   - if [[ "$TRAVIS_OS_NAME" == "windows"   ]]; then
+       mv "C:/Program Files/Git/usr/bin/sh.exe" "sh-ignored.exe";
+       choco install boost-msvc-12 python jdk8;
+       export CC=gcc;
+       export CXX=g++;
+       export PATH='C:\Python37':'C:\local\boost_1_58_0':$PATH;
+       export BOOST_LIBRARYDIR='C:/local/boost_1_58_0/lib64-msvc-12.0';
+       export BOOST_INCLUDEDIR='C:/local/boost_1_58_0/include';
+       export JAVA_HOME='C:/Program Files/Java/jdk1.8.0_211';
+       cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_java=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .;
+       mingw32-make.exe VERBOSE=1 java-all; 
+       ctest --output-on-failure -R java;
+     fi
+   - if [[ "$TRAVIS_OS_NAME" == "osx"   ]]; then cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON . && make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure; fi
+   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then (cmake -Denable_model-checking=ON  -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1)) && make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure ; fi
 notifications:
   recipients:
     - martin.quinson@ens-rennes.fr
@@ -69,3 +79,4 @@ notifications:
 os:
   - linux
   - osx
+  - windows
index d452dfe..b67462e 100644 (file)
@@ -163,9 +163,9 @@ public final class NativeLib {
                public void run() {
                        try {
                                for (File f : dir.listFiles())
-                                       if (! f.delete() && !f.getAbsolutePath().contains("appveyor")) // Be silent on AppVeyor to not break the tests. Ugly trick :)
+                                       if (! f.delete() && !f.getAbsolutePath().contains("travis")) // Be silent on AppVeyor to not break the tests. Ugly trick :)
                                                System.out.println("Unable to clean temporary file "+f.getAbsolutePath()+" during shutdown.");
-                               if (! dir.delete() && !dir.getAbsolutePath().contains("appveyor") )
+                               if (! dir.delete() && !dir.getAbsolutePath().contains("travis") )
                                        System.out.println("Unable to clean temporary file "+dir.getAbsolutePath()+" during shutdown.");                                
                        } catch(Exception e) {
                                System.out.println("Error while cleaning temporary file "+dir.getAbsolutePath()+" during shutdown: "+e.getCause());
index c462643..a254ff1 100644 (file)
@@ -137,7 +137,7 @@ if(WIN32)
     # So let's be brutal and copy it in any case (even on non-windows builds) from the location where appveyor provides it.
     # The copy is only expected to work on the appveyor builder, but that's all we need right now
     # since our users are directed to download that file as nightly build.
-    COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/libwinpthread-1.dll  ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll  ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true
   )
 endif()