Skip to content
Egor Suvorov edited this page Dec 14, 2017 · 27 revisions

Installation

GumTree requires Java 1.8 to run. Also we use Gradle to manage the dependencies and the build of GumTree. We therefore recommend also to have Gradle.

Prerequisites

  • You have to install srcML if you want to analyze C++ and C# code
  • You have to install cgum, if you want to analyze C code

Both tools have to be available in your system's path.

From source

You can build GumTree with the following commands:

git clone https://github.com/GumTreeDiff/gumtree.git
cd gumtree
./gradlew build -x test

You will have a zip distribution of GumTree in the dist/build/distributions folder. The gumtree binary is located in the bin folder contained in this archive.

Windows notes

  1. Instead of ./gradlew build -x test, run gradlew.bat build -x test
  2. If you get an The input line is too long. The syntax of the command is incorrect. error when trying to run gumtree.bat, then you've just bumped into a Gradle issue, see comments from there for possible workarounds.

From maven

GumTree's Maven modules are available here: http://mvnrepository.com/artifact/com.github.gumtreediff.

From nightlies

You can also download the nightly version on Bintray.

Usage

From the distribution

You can unzip the archive previously described, and just run the gumtree binary suited to your system. The gumtree binary takes a command as first parameter. For instance gumtree webdiff file1.java file2.java will perform a diff and will display it in a browser.

From Java

The class containing the main method to run GumTree is fr.labri.gumtree.client.Run. You can run this class without parameters to find out the available commands. Note that if you want to have all available commands and parsers at your disposal, you need to set up the classpath to include the projects of the gumtree distribution.

For instance, the arguments webdiff file1.java file2.java will compute the diff between file1.java and file2.java, and launch a local web server that will show you the output of the diff. This server is accessible via the URL http://localhost:4567/.

Clone this wiki locally