Skip to content

Commit

Permalink
move elisp files in top directory and the server in its own directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarcasm committed Apr 21, 2014
1 parent 52e8227 commit 7ad54cc
Show file tree
Hide file tree
Showing 50 changed files with 91 additions and 135 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/irony-server
/tests/
/utils/tests/
/perso/
/local-data/
/build/
/bin/
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "lib/SimpleJSON"]
path = lib/SimpleJSON
[submodule "server/lib/SimpleJSON"]
path = server/lib/SimpleJSON
url = https://github.com/MJPA/SimpleJSON.git
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ before_script:
- cd build

script:
- cmake ..
- make -k -j 4
- cmake ../server
- make -k -j4
- ctest --output-on-failure

after_script:
Expand Down
42 changes: 0 additions & 42 deletions CMakeLists.txt

This file was deleted.

36 changes: 0 additions & 36 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,39 +88,3 @@ private:
std::string *ptr_;
};
```
## How to add a plugin
Create a file named irony-PLUGIN_NAME.el
This file should contain 2 methods taking no arguments:
1. `irony-PLUGIN_NAME-enable` called by `irony-enable module-names` usually in
user configuration file. You can add a hook for on irony-mode if you need to
be active in each irony-mode buffer.
2. `irony-PLUGIN_NAME-disable` called by `irony-disable module-names` usually in
user configuration file. If a hook was added during
`irony-PLUGIN_NAME-enable` you can remove it inside this function.
Existing plugins such as *elisp/irony/ac.el* can serve as an example.
Simplified code, just to get a basic understanding:
~~~ el
(defun irony-ac-setup ()
"Hook to run for `auto-complete-mode' when `irony-mode' is activated."
(add-to-list 'ac-sources 'ac-source-irony)
(define-key irony-mode-map [(control return)] 'ac-complete-irony))
(defun irony-ac-enable ()
"Enable `auto-complete-mode' handling of `irony-mode' completion results."
(add-hook 'irony-mode-hook 'irony-ac-setup))
(defun irony-ac-disable ()
"Disable `auto-complete-mode' handling of `irony-mode' completion results."
(remove-hook 'irony-mode-hook 'irony-ac-setup))
~~~
For more information look at the existing plugins or ask me.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion lib/SimpleJSON
Submodule SimpleJSON deleted from 012bad
79 changes: 36 additions & 43 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,47 +1,40 @@
#
# irony-server executable build file
#
find_package (LibClang REQUIRED)

include_directories (${LIBCLANG_INCLUDE_DIRS})
include_directories (${IRONY_UTILS_INCLUDES})
include_directories (${CMAKE_CURRENT_SOURCE_DIR})

#
# irony-server executable
#
add_executable (irony-server
# Main sources
IPlugin.cpp
IPlugin.h
ClangString.cpp
ClangString.h
Server.cpp
Server.h
TUManager.cpp
TUManager.h
main.cpp

# "Built-in" plugins sources
plugins/CodeCompletion.cpp
plugins/CodeCompletion.h
plugins/SyntaxChecker.cpp
plugins/SyntaxChecker.h
plugins/CacheInvalidation.h
plugins/CacheInvalidation.cpp
plugins/CompileChecker.cpp
plugins/CompileChecker.h
)
cmake_minimum_required(VERSION 2.8)

add_dependencies (irony-server
# Dependencies
irony-utils
)
project(IronyMode)

set(CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake
${PROJECT_SOURCE_DIR}/cmake/modules
${CMAKE_MODULE_PATH})

include(utils)

check_for_in_source_build()
release_as_default_build_type()
enable_colored_diagnotics()

if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options_(-Wall -Wextra)
endif()

# libclang in non standard locations can cause some troubles.
option(USE_RPATH "Enable rpath for shared libraries (such as libclang.so)." OFF)

if (USE_RPATH)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

target_link_libraries (irony-server
irony-utils
${LIBCLANG_LIBRARIES}
set(IRONY_UTILS_INCLUDES
${PROJECT_SOURCE_DIR}/lib
${PROJECT_SOURCE_DIR}/lib/SimpleJSON/src
)

install (TARGETS irony-server
RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/bin)
add_subdirectory(lib)
add_subdirectory(src)
add_subdirectory(docs)
enable_testing()
add_subdirectory(test)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions server/lib/SimpleJSON
Submodule SimpleJSON added at ad8216
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 46 additions & 0 deletions server/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# irony-server executable build file
#
find_package (LibClang REQUIRED)

include_directories (${LIBCLANG_INCLUDE_DIRS})
include_directories (${IRONY_UTILS_INCLUDES})
include_directories (${CMAKE_CURRENT_SOURCE_DIR})

#
# irony-server executable
#
add_executable (irony-server
# Main sources
IPlugin.cpp
IPlugin.h
ClangString.cpp
ClangString.h
Server.cpp
Server.h
TUManager.cpp
TUManager.h
main.cpp

# "Built-in" plugins sources
plugins/CodeCompletion.cpp
plugins/CodeCompletion.h
plugins/SyntaxChecker.cpp
plugins/SyntaxChecker.h
plugins/CacheInvalidation.h
plugins/CacheInvalidation.cpp
plugins/CompileChecker.cpp
plugins/CompileChecker.h
)

add_dependencies (irony-server
# Dependencies
irony-utils
)

target_link_libraries (irony-server
irony-utils
${LIBCLANG_LIBRARIES}
)

install (TARGETS irony-server DESTINATION bin)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

;; load irony
(unless (require 'irony nil t)
(let ((irony-dir (expand-file-name "../../elisp" test-dir)))
(let ((irony-dir (expand-file-name "../../.." test-dir)))
(add-to-list 'load-path irony-dir)
(require 'irony)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

(require 'irony-cdb)

(require 'json)

(ert-deftest cdb/gen-clang-args/end-of-opts ()
(should (not
(irony-cdb-gen-clang-args '("--" "a.c" "b.c")))))
Expand All @@ -14,8 +12,8 @@
"Test if the arguments are given back in the same order as they
were given.
An argument my be dependent of the previous one, we want to keep
the order. -W"
An argument may be dependent of the previous one, it's important
to keep the ordering right."
(let ((args '("-Wall" "-ferror-limit" "42" "-Wextra")))
(should (equal
args
Expand Down
File renamed without changes.

0 comments on commit 7ad54cc

Please sign in to comment.