From 01fce1781ee96d75f8569061274d6be53a7412e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Mon, 23 May 2016 01:29:55 +0200 Subject: [PATCH 1/7] Add appveyor.yml and attempt of windows build --- .travis.yml | 2 +- appveyor.yml | 15 +++++++++++++++ ci/compile.sh | 11 ++++++++++- ci/execute.sh | 14 ++++++++++++++ ci/{update_travis.sh => update_ci.sh} | 12 ++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 appveyor.yml rename ci/{update_travis.sh => update_ci.sh} (59%) diff --git a/.travis.yml b/.travis.yml index 1383c0e..9f81098 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ services: - docker before_install: - - ./ci/update_travis.sh + - ./ci/update_ci.sh script: - script=compile CXX=clang++ CC=clang ./ci/execute.sh diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..2e3274a --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,15 @@ +platform: + - x86 + - x64 + +before_build: + - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh pacman + - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh git + - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade + +build_script: + - C:\msys64\usr\bin\bash -lc "script=compile CXX=clang++ CC=clang $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=clean $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=static_analysis $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile make_command=\"broadwayd & make test\" $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" diff --git a/ci/compile.sh b/ci/compile.sh index 9a072b0..aac3547 100755 --- a/ci/compile.sh +++ b/ci/compile.sh @@ -1,7 +1,16 @@ #!/bin/bash if [ "${cmake_command}" == "" ]; then - cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + if [ $APPVEYOR ]; then + if [ "$PLATFORM" == "x64" ]; then + mingw="mingw64" + else + mingw="mingw32" + fi + cmake_command="cmake -G\"MSYS Makefiles\" -DCMAKE_INSTALL_PREFIX=/${mingw} .. -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + else + cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + fi fi if [ "${make_command}" == "" ]; then diff --git a/ci/execute.sh b/ci/execute.sh index a90cee5..0cfdc76 100755 --- a/ci/execute.sh +++ b/ci/execute.sh @@ -22,4 +22,18 @@ function osx () { true } +function windows () { + cd "$(dirname "$0")" || exit + if [ "${script}" == "clean" ]; then + sudo rm ./build -rf + return 0 + fi + sh -c "./ci/${script}.sh" +} + + +if [ "$TRAVIS_OS_NAME" == "" ]; then + TRAVIS_OS_NAME=windows +fi + $TRAVIS_OS_NAME diff --git a/ci/update_travis.sh b/ci/update_ci.sh similarity index 59% rename from ci/update_travis.sh rename to ci/update_ci.sh index 8969bae..693b2c2 100755 --- a/ci/update_travis.sh +++ b/ci/update_ci.sh @@ -19,4 +19,16 @@ function osx () { brew install cmake pkg-config boost homebrew/x11/gtksourceviewmm3 aspell clang-format } +function windows () { + arch=x86_64 + if [ "$PLATFORM" == "x86" ]; then + arch=i686 + fi + sh -c "pacman -S git mingw-w64-${arch}-cmake make mingw-w64-${arch}-toolchain mingw-w64-${arch}-clang mingw-w64-${arch}-gtkmm3 mingw-w64-${arch}-gtksourceviewmm3 mingw-w64-${arch}-boost mingw-w64-${arch}-aspell mingw-w64-${arch}-aspell-en" +} + +if [ "$TRAVIS_OS_NAME" == "" ]; then + TRAVIS_OS_NAME=windows +fi + $TRAVIS_OS_NAME \ No newline at end of file From 2ccbea40ba9ff92c19a96be81015dbebe652da79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Mon, 23 May 2016 12:18:47 +0200 Subject: [PATCH 2/7] Fix path in msys2, no longer selects cmake installed in program files for instance" --- appveyor.yml | 9 ++++----- ci/execute.sh | 7 ++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9fb03c6..55abb99 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,10 +6,9 @@ before_build: - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh pacman - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh git - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade + - C:\msys64\usr\bin\bash -lc "C:/projects/jucipp/ci/update_ci.sh" build_script: - - C:\msys64\usr\bin\bash -lc "script=compile CXX=clang++ CC=clang C:\projects\jucipp\ci\execute.sh" - - C:\msys64\usr\bin\bash -lc "script=clean C:\projects\jucipp\ci\execute.sh" - - C:\msys64\usr\bin\bash -lc "script=compile C:\projects\jucipp\ci\execute.sh" - - C:\msys64\usr\bin\bash -lc "script=static_analysis C:\projects\jucipp\ci\execute.sh" - - C:\msys64\usr\bin\bash -lc "script=compile make_command=\"broadwayd & make test\" C:\projects\jucipp\ci\execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile C:/projects/jucipp/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "broadwayd & exit" + - C:\msys64\usr\bin\bash -lc "script=compile make_command='make test' C:/projects/jucipp/ci/execute.sh" diff --git a/ci/execute.sh b/ci/execute.sh index 0cfdc76..4f60bf2 100755 --- a/ci/execute.sh +++ b/ci/execute.sh @@ -23,12 +23,13 @@ function osx () { } function windows () { - cd "$(dirname "$0")" || exit + export PATH="/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" + cd "C:/projects" || (echo "Error changing directory"; return 1) if [ "${script}" == "clean" ]; then - sudo rm ./build -rf + sudo rm "C:/projects/jucipp/build" -rf return 0 fi - sh -c "./ci/${script}.sh" + sh -c "C:/projects/jucipp/ci/${script}.sh" } From 146228812088704b35f43b934f745f5c021770a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 15:41:54 +0200 Subject: [PATCH 3/7] More work on osx build. Still disabled --- .travis.yml | 10 ++++++++-- ci/execute.sh | 7 ++++++- ci/update_ci.sh | 22 +++++++++++++++------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f81098..faa72cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,27 @@ sudo: required +# osx_image: xcode7.3 + env: - distribution: ubuntu - distribution: fedora - distribution: arch - distribution: debian-testing - distribution: debian + +#matrix: +# include: +# - os: osx services: - docker before_install: - - ./ci/update_ci.sh + - ./ci/update_ci.sh #travis_wait 90 ./ci/update_ci.sh script: - script=compile CXX=clang++ CC=clang ./ci/execute.sh - script=clean ./ci/execute.sh - - script=compile ./ci/execute.sh + - script=compile CXX=g++ CC=gcc ./ci/execute.sh - script=static_analysis ./ci/execute.sh - script=compile make_command="broadwayd & make test" ./ci/execute.sh \ No newline at end of file diff --git a/ci/execute.sh b/ci/execute.sh index 4f60bf2..9670d97 100755 --- a/ci/execute.sh +++ b/ci/execute.sh @@ -19,7 +19,12 @@ function linux () { #TODO Should run compile/install instructions for osx function osx () { - true + cd .. || (echo "Error changing directory";return 1) + if [ "${script}" == "clean" ]; then + sudo rm -rf "./jucipp/build" + return 0 + fi + sh -c "./jucipp/ci/${script}.sh" || return 1 } function windows () { diff --git a/ci/update_ci.sh b/ci/update_ci.sh index 693b2c2..18cd506 100755 --- a/ci/update_ci.sh +++ b/ci/update_ci.sh @@ -9,14 +9,22 @@ function linux () { sudo service docker start || exit } -# TODO method should update osx, brew, packages etc needed for juCi++ +function brew_install() { + (brew outdated "$1" || brew install $1) || (echo "Error installing $1"; return 1) +} + function osx () { - brew update - brew rm llvm - brew doctor - brew upgrade - brew install --with-clang --with-lldb llvm - brew install cmake pkg-config boost homebrew/x11/gtksourceviewmm3 aspell clang-format + brew update || return 1 + brew uninstall llvm --force || return 1 + brew upgrade --all || return 1 + brew update || return 1 + brew upgrade --all || return 1 + brew install --with-clang llvm + brew_install "boost" || return 1 + brew_install "aspell" || return 1 + brew_install "clang-format" || return 1 + brew_install "pkg-config" || return 1 + brew_install "gtksourceviewmm3" || return 1 } function windows () { From df42e131662b7af24367222122721850259fa47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 15:43:31 +0200 Subject: [PATCH 4/7] Add debug messages for build script. Set --noconfirm on msys packages --- README.md | 3 ++- appveyor.yml | 4 +++- ci/compile.sh | 11 ++++++----- ci/update_ci.sh | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b74dcb3..7ad0d41 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# juCi++ [![Build Status](https://travis-ci.org/cppit/jucipp.svg?branch=master)](https://travis-ci.org/cppit/jucipp) +# juCi++ [![Build Status](https://travis-ci.org/cppit/jucipp.svg?branch=master)](https://travis-ci.org/cppit/jucipp) [![Build status](https://ci.appveyor.com/api/projects/status/07jsrg16a5bcpods/branch/master?svg=true)](https://ci.appveyor.com/project/zalox/jucipp/branch/master) + ###### a lightweight, platform independent C++-IDE with support for C++11, C++14, and experimental C++17 features depending on libclang version. ## About diff --git a/appveyor.yml b/appveyor.yml index 55abb99..264cbef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,8 @@ platform: - - x86 - x64 + +environment: + MSYSTEM: MSYS before_build: - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh pacman diff --git a/ci/compile.sh b/ci/compile.sh index aac3547..e2bafd6 100755 --- a/ci/compile.sh +++ b/ci/compile.sh @@ -1,13 +1,13 @@ #!/bin/bash if [ "${cmake_command}" == "" ]; then - if [ $APPVEYOR ]; then + if [ "$APPVEYOR" != "" ]; then if [ "$PLATFORM" == "x64" ]; then mingw="mingw64" else mingw="mingw32" fi - cmake_command="cmake -G\"MSYS Makefiles\" -DCMAKE_INSTALL_PREFIX=/${mingw} .. -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + cmake_command="cmake -G\"MSYS Makefiles\" -DCMAKE_INSTALL_PREFIX=/${mingw} -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." else cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." fi @@ -17,7 +17,8 @@ if [ "${make_command}" == "" ]; then make_command="make -j 2" fi -cd jucipp || exit -mkdir -p build && cd build || exit -sh -c "${cmake_command}" || exit +cd jucipp || (echo "Can't cd into jucipp"; return 1) +git submodule update --init --recursive +mkdir -p build && cd build || (echo "Error making build directory"; return 1) +sh -c "${cmake_command}" || (echo "Cmake configuration failed"; return 1) exec sh -c "${make_command}" \ No newline at end of file diff --git a/ci/update_ci.sh b/ci/update_ci.sh index 18cd506..795ac87 100755 --- a/ci/update_ci.sh +++ b/ci/update_ci.sh @@ -32,7 +32,7 @@ function windows () { if [ "$PLATFORM" == "x86" ]; then arch=i686 fi - sh -c "pacman -S git mingw-w64-${arch}-cmake make mingw-w64-${arch}-toolchain mingw-w64-${arch}-clang mingw-w64-${arch}-gtkmm3 mingw-w64-${arch}-gtksourceviewmm3 mingw-w64-${arch}-boost mingw-w64-${arch}-aspell mingw-w64-${arch}-aspell-en" + sh -c "pacman -S --noconfirm git mingw-w64-${arch}-cmake make mingw-w64-${arch}-toolchain mingw-w64-${arch}-clang mingw-w64-${arch}-gtkmm3 mingw-w64-${arch}-gtksourceviewmm3 mingw-w64-${arch}-boost mingw-w64-${arch}-aspell mingw-w64-${arch}-aspell-en" } if [ "$TRAVIS_OS_NAME" == "" ]; then From 8b6300f8ddc7bca761d41b0700e3d5e4bb0c66ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Tue, 31 May 2016 15:47:18 +0200 Subject: [PATCH 5/7] update appveyor badge to cppit/jucipp --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ad0d41..9f50c08 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# juCi++ [![Build Status](https://travis-ci.org/cppit/jucipp.svg?branch=master)](https://travis-ci.org/cppit/jucipp) [![Build status](https://ci.appveyor.com/api/projects/status/07jsrg16a5bcpods/branch/master?svg=true)](https://ci.appveyor.com/project/zalox/jucipp/branch/master) +# juCi++ [![Build Status](https://travis-ci.org/cppit/jucipp.svg?branch=master)](https://travis-ci.org/cppit/jucipp) [![Build status](https://ci.appveyor.com/api/projects/status/tj8ants9q8ouuoob/branch/master?svg=true)](https://ci.appveyor.com/project/zalox/jucipp-6hwdu/branch/master) ###### a lightweight, platform independent C++-IDE with support for C++11, C++14, and experimental C++17 features depending on libclang version. From 2a86c1c20b4cd2c4740b151e9488974429525c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 1 Jun 2016 14:06:40 +0200 Subject: [PATCH 6/7] Make sure tests displays errors on windows, fix some bad practise in bash --- .travis.yml | 6 +++--- appveyor.yml | 5 ++--- ci/compile.sh | 11 ++++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f69c4d..bf56673 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,14 +8,14 @@ env: - distribution: arch - distribution: debian-testing - distribution: debian - + #matrix: # include: # - os: osx services: - docker - + before_install: - ./ci/update_ci.sh #travis_wait 90 ./ci/update_ci.sh @@ -24,4 +24,4 @@ script: - script=clean ./ci/execute.sh - script=compile CXX=g++ CC=gcc ./ci/execute.sh - script=static_analysis ./ci/execute.sh - - script=compile make_command="broadwayd & CTEST_OUTPUT_ON_FAILURE=1 make test" ./ci/execute.sh \ No newline at end of file + - script=compile make_command="broadwayd & CTEST_OUTPUT_ON_FAILURE=1 make test" ./ci/execute.sh diff --git a/appveyor.yml b/appveyor.yml index 264cbef..5b6ef8f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ platform: - x64 - + environment: MSYSTEM: MSYS @@ -12,5 +12,4 @@ before_build: build_script: - C:\msys64\usr\bin\bash -lc "script=compile C:/projects/jucipp/ci/execute.sh" - - C:\msys64\usr\bin\bash -lc "broadwayd & exit" - - C:\msys64\usr\bin\bash -lc "script=compile make_command='make test' C:/projects/jucipp/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile make_command='CTEST_OUTPUT_ON_FAILURE=1 make test' C:/projects/jucipp/ci/execute.sh" diff --git a/ci/compile.sh b/ci/compile.sh index e2bafd6..59d86f2 100755 --- a/ci/compile.sh +++ b/ci/compile.sh @@ -8,6 +8,7 @@ if [ "${cmake_command}" == "" ]; then mingw="mingw32" fi cmake_command="cmake -G\"MSYS Makefiles\" -DCMAKE_INSTALL_PREFIX=/${mingw} -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + make_command="make" else cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." fi @@ -17,8 +18,8 @@ if [ "${make_command}" == "" ]; then make_command="make -j 2" fi -cd jucipp || (echo "Can't cd into jucipp"; return 1) -git submodule update --init --recursive -mkdir -p build && cd build || (echo "Error making build directory"; return 1) -sh -c "${cmake_command}" || (echo "Cmake configuration failed"; return 1) -exec sh -c "${make_command}" \ No newline at end of file +cd jucipp || echo "Can't cd into jucipp" +git submodule update --init --recursive # appveyor doesn't checkout recursively +mkdir -p build && cd build || echo "Error making build directory" +sh -c "${cmake_command}" || echo "Cmake configuration failed" +exec sh -c "${make_command}" From 1ec36f44bca57a7aeb779012f2844c81b36c3f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 1 Jun 2016 14:39:54 +0200 Subject: [PATCH 7/7] fix source directory path for appveyor --- appveyor.yml | 6 +++--- ci/execute.sh | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5b6ef8f..9fed3a7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,8 +8,8 @@ before_build: - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh pacman - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh git - C:\msys64\usr\bin\pacman --noconfirm --sync --refresh --refresh --sysupgrade --sysupgrade - - C:\msys64\usr\bin\bash -lc "C:/projects/jucipp/ci/update_ci.sh" + - C:\msys64\usr\bin\bash -lc "$(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/update_ci.sh" build_script: - - C:\msys64\usr\bin\bash -lc "script=compile C:/projects/jucipp/ci/execute.sh" - - C:\msys64\usr\bin\bash -lc "script=compile make_command='CTEST_OUTPUT_ON_FAILURE=1 make test' C:/projects/jucipp/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" + - C:\msys64\usr\bin\bash -lc "script=compile make_command='CTEST_OUTPUT_ON_FAILURE=1 make test' $(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/execute.sh" diff --git a/ci/execute.sh b/ci/execute.sh index 9670d97..18df1d6 100755 --- a/ci/execute.sh +++ b/ci/execute.sh @@ -29,12 +29,13 @@ function osx () { function windows () { export PATH="/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" - cd "C:/projects" || (echo "Error changing directory"; return 1) + bf=$(cygpath ${APPVEYOR_BUILD_FOLDER}) + cd "$bf" || (echo "Error changing directory"; return 1) if [ "${script}" == "clean" ]; then - sudo rm "C:/projects/jucipp/build" -rf + sudo rm "./build" -rf return 0 fi - sh -c "C:/projects/jucipp/ci/${script}.sh" + sh -c "${bf}/ci/${script}.sh" }