Skip to content
chreex edited this page Apr 8, 2015 · 17 revisions

Tutorial

The goal of this tutorial is to review the source code of the QGears Review tool itself, presenting common usage scenarios and a recommended review workflow.

Note that this document assumes a basic knowledge of Eclipse, SVN and Subversive from the reader.

Preparing the demo environment

After reading README.md on what QGears Review Tool is, and having the installation successfully accomplished with the help of INSTALL.md, additional handcrafted configuration is necessary to use the tool. As the QGears Review Tool supports reviewing files only in SVN repositories, the SVN interface of GitHub will be used. During the tutorial, keep a command line terminal ready at hand, and use the same session all the way up the line.

The content of the qgears-review-tool github repo repository will be replicated into local SVN repo in the example. Your commits will land in there, without requiring to set up an SVN server just for the example.

First, check out the revision 10 of the QGears Review Tool repo into a temporary location:

svn co https://github.com/qgears/qgears-review-tool/trunk@10 /tmp/qgears-review-tool-trunk-r10

Create a local SVN repository and import the source tree:

cd ~
mkdir -p temp/qgears-svn-replica
cd temp/qgears-svn-replica
svnadmin create qgears-review-tool
svn import /tmp/qgears-review-tool-trunk-r10 file:///home/user1/temp/qgears-svn-replica/qgears-review-tool/trunk -m "Initial import of QGears Review Tool for reviewing its source code"

Check out the whole trunk of the qgears-review-tool SVN repo into an arbitrary directory! This directory will further be referred to as $SRCDIR. Commands to execute:

cd
export SRCDIR=$HOME/qreviewtool-svn
mkdir $SRCDIR
svn co file://$HOME/temp/qgears-svn-replica/qgears-review-tool/trunk ```$SRCDIR```

Creating the review tool configuration

Create a folder for the reviews and review configurations in $SRCDIR, let's call it 'review':

export REVIEWDIR=$SRCDIR/review
mkdir -p $REVIEWDIR

Create a subfolder in $REVIEWDIR, called settings-$USER, which will store (only) your main, user-specific configuration file:

export $USER_SETTINGS_DIR=$REVIEWDIR/settings-$USER
mkdir -p $USER_SETTINGS_DIR

Create your personal, main configuration file called sourcefoldermappings.properties in the $USER_SETTINGS_DIR directory - for the sake of simplicity, copy-paste the template below:

echo "# QGears Review tool user-specific config file
config=$REVIEWDIR/config-qreviewtool
map.qreviewsvn_workingcopy=$SRCDIR
annotationsfolder.1=review-$USER
annotationsfolder.2=review-ben
annotationsfolder.3=review-charlie
" > $USER_SETTINGS_DIR/sourcefoldermappings.properties

Explanation of the entries:

  • config: absolute path of a subdirectory with settings and saved code reviews specific to reviewing a software project
  • map.qreviewsvn_workingcopy: the root directory of an SVN working copy of the reviewed software project - note that more than one map* entry may be present in a sourcefoldermappings.properties file, as the reviewed files may be contained in more than one SCM repositories
  • annotationsfolder.# where # is a number; at least 1: the names of the subfolders within the $REVIEWDIR, containing one person's code reviews

Assembling the Eclipse workspace

For the rest of the tutorial, use an Eclipse installation, into which the QGears Review Tool is preinstalled according to the INSTALL.md file found in the qgears-review-tool github repo.

In this Eclipse, create a workspace, into which the projects from $SRCDIR are all imported. This will help to avoid syntax errors and dependency problems which would bother the tutorial.

Now you have a workspace with 5 projects imported, all at revision 1:

  • hu.qgears.review
  • hu.qgears.review.build
  • hu.qgears.review.eclipse.ui
  • hu.qgears.review.feature
  • hu.qgears.sonar.client
Clone this wiki locally