diff --git a/.travis.yml b/.travis.yml index 23f74d8..bf56673 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ sudo: required +# osx_image: xcode7.3 + env: - distribution: ubuntu - distribution: fedora @@ -7,15 +9,19 @@ env: - distribution: debian-testing - distribution: debian +#matrix: +# include: +# - os: osx + services: - docker - + before_install: - - ./ci/update_travis.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 & 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/README.md b/README.md index b74dcb3..9f50c08 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/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. ## About diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..9fed3a7 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,15 @@ +platform: + - x64 + +environment: + MSYSTEM: MSYS + +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 "$(cygpath ${APPVEYOR_BUILD_FOLDER})/ci/update_ci.sh" + +build_script: + - 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/compile.sh b/ci/compile.sh index 9a072b0..59d86f2 100755 --- a/ci/compile.sh +++ b/ci/compile.sh @@ -1,14 +1,25 @@ #!/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 .." + make_command="make" + else + cmake_command="cmake -DENABLE_TESTING=1 -DCMAKE_CXX_FLAGS=-Werror .." + fi fi if [ "${make_command}" == "" ]; then make_command="make -j 2" fi -cd jucipp || exit -mkdir -p build && cd build || exit -sh -c "${cmake_command}" || exit -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}" diff --git a/ci/execute.sh b/ci/execute.sh index a90cee5..18df1d6 100755 --- a/ci/execute.sh +++ b/ci/execute.sh @@ -19,7 +19,28 @@ 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 () { + 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" + bf=$(cygpath ${APPVEYOR_BUILD_FOLDER}) + cd "$bf" || (echo "Error changing directory"; return 1) + if [ "${script}" == "clean" ]; then + sudo rm "./build" -rf + return 0 + fi + sh -c "${bf}/ci/${script}.sh" } + +if [ "$TRAVIS_OS_NAME" == "" ]; then + TRAVIS_OS_NAME=windows +fi + $TRAVIS_OS_NAME diff --git a/ci/update_ci.sh b/ci/update_ci.sh new file mode 100755 index 0000000..795ac87 --- /dev/null +++ b/ci/update_ci.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +function linux () { + sudo apt-get update + sudo apt-get purge lxc-docker + sudo apt-get install --yes --force-yes -o Dpkg::Options::="--force-confnew" linux-image-extra-$(uname -r) docker-engine + sudo service docker stop || exit + sudo rm -rf /var/lib/docker || exit + sudo service docker start || exit +} + +function brew_install() { + (brew outdated "$1" || brew install $1) || (echo "Error installing $1"; return 1) +} + +function osx () { + 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 () { + arch=x86_64 + if [ "$PLATFORM" == "x86" ]; then + arch=i686 + fi + 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 + TRAVIS_OS_NAME=windows +fi + +$TRAVIS_OS_NAME \ No newline at end of file diff --git a/ci/update_travis.sh b/ci/update_travis.sh deleted file mode 100755 index 8969bae..0000000 --- a/ci/update_travis.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -function linux () { - sudo apt-get update - sudo apt-get purge lxc-docker - sudo apt-get install --yes --force-yes -o Dpkg::Options::="--force-confnew" linux-image-extra-$(uname -r) docker-engine - sudo service docker stop || exit - sudo rm -rf /var/lib/docker || exit - sudo service docker start || exit -} - -# TODO method should update osx, brew, packages etc needed for juCi++ -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 -} - -$TRAVIS_OS_NAME \ No newline at end of file