From 64b5ebfce9d14009bd80de5409cc923ce43414c7 Mon Sep 17 00:00:00 2001 From: Gyorgy Orban Date: Thu, 22 Nov 2018 13:41:30 +0100 Subject: [PATCH] update documentation --- docs/developer.md | 18 +++++++++-------- readme.md | 49 ++++++++++++++++++++++++----------------------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/docs/developer.md b/docs/developer.md index 47a993a7..fd0624ca 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -1,23 +1,23 @@ -## Troubleshooting +# Troubleshooting * In case of compile error, attach the maven output * Runtime logging is still a big todo, currently most log will appear on stdout/stderr -## Development Notes +# Development Notes * Requires the Tycho Connector, Eclipse will automatically install it for you when you first import the project -* Requires Eclipse PDE (Plug-in Development Environment) +* [Requires Eclipse PDE](https://www.eclipse.org/pde/) (Plug-in Development Environment) * WindowMaker plugin is recommended * Adherence to the [Google Java Style](https://google.github.io/styleguide/javaguide.html) is mandatory * An IntelliJ Idea autoformatter XML configuration file is included in the repo for convenience -## Version Update +# Update plugin version -Execute the following command in CodeCheckerEclipsePlugin/eclipse-plugin. +Execute the following command in CodeCheckerEclipsePlugin/eclipse-plugin: ``` mvn -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=X.X.X-SNAPSHOT -Dartifacts=cc.codechecker.eclipse.plugin ``` -## Log +# Logging Logging in the plugin is handled by `log4j` from Apache. The default loglevel is `ERROR`, and the following loglevels are used, in increasing severity order: @@ -30,10 +30,12 @@ Logging in the plugin is handled by `log4j` from Apache. The default loglevel is The log configuration file's location is `eclipse-plugin/eclipse/cc.codechecker.eclipse.plugin/log4j.properties` before compilation. -After compiling the plugin, you may change the log level (which specifies which *least severe* category will be logged) by opening the built `cc.codechecker.eclipse.plugin-0.0.1-SNAPSHOT.jar` file (with `mc` or any `zip` editor) and changing the `log4j.properties` file therein. +After compiling the plugin, you may change the log level (which specifies which *least severe* category will be logged) by opening the built `cc.codechecker.eclipse.plugin-0.0.6.jar` file (with `mc` or any `zip` editor) and changing the `log4j.properties` file therein. The loglevel is specified as follows: - log4j.appender.log.threshold=ERROR +``` +log4j.appender.log.threshold=ERROR +``` After modifying the jar file, you will need to restart eclipse for the changes to take effect. diff --git a/readme.md b/readme.md index 95dc091b..e6a205f6 100644 --- a/readme.md +++ b/readme.md @@ -2,47 +2,48 @@ [![Build Status](https://travis-ci.org/Ericsson/CodeCheckerEclipsePlugin.svg?branch=master)](https://travis-ci.org/Ericsson/CodeCheckerEclipsePlugin) -This is a C/C++ code analysis plugin for Eclipse that shows bugs detected by the [Clang Static Analyzer](http://clang-analyzer.llvm.org/) and [Clang Tidy](http://clang.llvm.org/extra/clang-tidy/) analyzers, using [CodeChecker](https://github.com/Ericsson/codechecker) as a backend, +This is a C/C++ code analysis plugin for Eclipse that shows bugs detected by the [Clang Static Analyzer](http://clang-analyzer.llvm.org/) and [Clang Tidy](http://clang.llvm.org/extra/clang-tidy/) analyzers, using [CodeChecker](https://github.com/Ericsson/codechecker) as a backend to run the analyzers. -## Requirements +# Requirements -* Linux operating system -* Recent [CodeChecker](https://github.com/Ericsson/codechecker) -* [Eclipse](www.eclipse.org): the plugin is currently tested with Eclipse Neon, but any recent Eclipse version should work -* Eclipse CDT +* Linux operating system (Tested on Ubuntu 16.04) +* Recent [CodeChecker](https://github.com/Ericsson/codechecker) (v6.8.0 or newer) +* [Eclipse](https://www.eclipse.org): the plugin is currently tested with Eclipse Neon, but any recent Eclipse version should work +* [Eclipse CDT](https://www.eclipse.org/cdt/) (C/C++ Development Tooling) * Java 1.7 -## Build and install CodeChecker Eclipse Plugin -### Build -run `mvn package` in the project's directory in: +# Build and install CodeChecker Eclipse Plugin +## Build -`./eclipse-plugin/` +```sh +cd ./eclipse-plugin +mvn package # build the plugin and run the tests +``` -### Install -* Copy the `cc.codechecker.eclipse.plugin-0.0.6-SNAPSHOT.jar`: - * From: ./eclipse-plugin/eclipse/cc.codechecker.eclipse.plugin/target/ - * To: the dropins directory of Eclipse - -## How to use -Make sure that before staring Eclipse: +## Install +Copy the `cc.codechecker.eclipse.plugin-0.0.6-SNAPSHOT.jar`: +* From: `./eclipse-plugin/eclipse/cc.codechecker.eclipse.plugin/target/` +* To: the `dropins` directory of Eclipse +# How to use +Make sure that before starting Eclipse: * CodeChecker/bin directory is included in PATH (e.g.: `export PATH="/home//CodeChecker/bin/:$PATH"`) * Python virtualenv with CodeChecker dependencies is sourced (e.g.: `source /home//venv/bin/activate`) -__Currently the plugin is only usable with a CDT project.__ +__Currently the plugin is only usable with a CDT project!__ -#### 1. Setup Perspective +## 1. Setup Perspective In Eclipse, select Window, Perspectives, and activate the CodeChecker perspective. Alternatively, you can manually add the two windows under the CodeChecker category into any perspective, using the Window - Views menu. ![Window->Perspective->Open Perspective->Other](docs/allperspective.png) -#### 2. Setup Nature +## 2. Setup Nature The plugin is activated on a per project basis, first you have to add the __CodeChecker Nature__ to a CDT project using the projects context menu in the project explorer with `Add CodeChecker Nature` command. ![CodeChecker Nature Add](docs/nature.png) -#### 3. Configure CodeChecker and checkers +## 3. Configure CodeChecker and checkers After that, the settings can be customized in the project preferences window under the CodeChecker panel. For the plugin to work correctly, it is mandatory to add the correct path to the root of the CodeChecker package. You can download and compile CodeChecker from [here](https://github.com/Ericsson/codechecker). ![CodeChecker Configure](docs/config.png) @@ -50,19 +51,19 @@ After that, the settings can be customized in the project preferences window und After the plugin is successfully configured for a project, it'll listen to build events, and automatically rechecks the project with CodeChecker when needed. -#### 4. Set up eclipse C/C++ build environment +## 4. Set up eclipse C/C++ build environment The code analysis runs only if your project can be built by Eclipse (as it intercepts gcc build commands). Please check that your builder is set up correctly in properties/C/C++ Build settings. If all goes well, you should be able to build your project from Eclipse using the Project/Build Project menu item. -#### 5. Analyze C/C++ project and view results +## 5. Analyze C/C++ project and view results By default the plugin displays the problems related to the currently selected file on the current file reports view. Here the viewer can decide to check the individual reports selected from the reports tree, and view the related bugpath. Double clicking on a bugpath item will jump and set the cursor to that line in the editor. *Please note that codechecker will only show analysis results for files that you built. This means that if you want to see all bugs for your project you will need to do a full (clean) build. After you update a source file, analysis results will be updated when you rebuild your project.* ![CodeChecker Runtime Example](docs/example.png) -## Contributing +# Contributing For further information see [developer documentation](docs/developer.md).