Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:cppit/jucipp into python-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zalox committed Jun 1, 2016
2 parents fc3edb0 + 1ec36f4 commit 6d5f303
Show file tree
Hide file tree
Showing 32 changed files with 672 additions and 409 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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_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 & make test" ./ci/execute.sh
- script=compile make_command="broadwayd & CTEST_OUTPUT_ON_FAILURE=1 make test" ./ci/execute.sh
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
<!--<img src="https://github.com/cppit/jucipp/blob/master/docs/images/screenshot3.png"/>-->
## About
Expand Down
15 changes: 15 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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"
21 changes: 16 additions & 5 deletions ci/compile.sh
Original file line number Diff line number Diff line change
@@ -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}"
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}"
23 changes: 22 additions & 1 deletion ci/execute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
42 changes: 42 additions & 0 deletions ci/update_ci.sh
Original file line number Diff line number Diff line change
@@ -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
22 changes: 0 additions & 22 deletions ci/update_travis.sh

This file was deleted.

9 changes: 5 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ set(global_libraries
set(project_files
config.cc
dialogs.cc
dialogs_unix.cc
directories.cc
entrybox.cc
info.cc
Expand All @@ -56,8 +57,6 @@ set(project_files
terminal.cc
tooltips.cc
window.cc

../tiny-process-library/process.cpp
)

#Files used both in ../src and ../tests
Expand All @@ -83,16 +82,18 @@ set(project_shared_files
../libclangmm/src/Tokens.cc
../libclangmm/src/TranslationUnit.cc
../libclangmm/src/Utility.cc

../tiny-process-library/process.cpp
)

if(LIBLLDB_FOUND)
list(APPEND project_shared_files debug_clang.cc)
endif()

if(MSYS)
list(APPEND project_files dialogs_unix.cc ../tiny-process-library/process_win.cpp)
list(APPEND project_shared_files ../tiny-process-library/process_win.cpp)
else()
list(APPEND project_files dialogs_unix.cc ../tiny-process-library/process_unix.cpp)
list(APPEND project_shared_files ../tiny-process-library/process_unix.cpp)
endif()

include_directories(${global_includes})
Expand Down
7 changes: 4 additions & 3 deletions src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void Config::load() {
catch(const std::exception &e) {
::Terminal::get().print("Error: could not parse "+config_json+": "+e.what()+"\n", true);
std::stringstream ss;
ss << configjson;
ss << default_config_file;
boost::property_tree::read_json(ss, cfg);
retrieve_config();
}
Expand All @@ -64,7 +64,7 @@ void Config::find_or_create_config_files() {
boost::filesystem::create_directories(home/"plugins");

if (!boost::filesystem::exists(config_json))
filesystem::write(config_json, configjson);
filesystem::write(config_json, default_config_file);

auto juci_style_path = home/"styles";
boost::filesystem::create_directories(juci_style_path); // io exp captured by calling method
Expand Down Expand Up @@ -163,7 +163,7 @@ void Config::update_config_file() {
try {
if(cfg.get<std::string>("version")!=JUCI_VERSION) {
std::stringstream ss;
ss << configjson;
ss << default_config_file;
boost::property_tree::read_json(ss, default_cfg);
cfg_ok=false;
if(cfg.count("version")>0)
Expand Down Expand Up @@ -199,6 +199,7 @@ void Config::get_source() {
source.default_tab_char = source_json.get<char>("default_tab_char");
source.default_tab_size = source_json.get<unsigned>("default_tab_size");
source.auto_tab_char_and_size = source_json.get<bool>("auto_tab_char_and_size");
source.tab_indents_line = source_json.get<bool>("tab_indents_line");

source.wrap_lines = source_json.get<bool>("wrap_lines");

Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Config {
bool auto_tab_char_and_size;
char default_tab_char;
unsigned default_tab_size;
bool tab_indents_line;
bool wrap_lines;
bool highlight_current_line;
bool show_line_numbers;
Expand Down
2 changes: 1 addition & 1 deletion src/debug_clang.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void Debug::Clang::select_frame(uint32_t frame_index, uint32_t thread_index_id)
}
}

void Debug::Clang::delete_debug() {
void Debug::Clang::cancel() {
kill();
if(debug_thread.joinable())
debug_thread.join();
Expand Down
2 changes: 1 addition & 1 deletion src/debug_clang.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace Debug {
std::vector<Variable> get_variables();
void select_frame(uint32_t frame_index, uint32_t thread_index_id=0);

void delete_debug(); //can't use delete as function name
void cancel();

std::string get_value(const std::string &variable, const boost::filesystem::path &file_path, unsigned int line_nr, unsigned int line_index);
std::string get_return_value(const boost::filesystem::path &file_path, unsigned int line_nr, unsigned int line_index);
Expand Down
Loading

0 comments on commit 6d5f303

Please sign in to comment.