Skip to content

Commit

Permalink
merged version 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfaller committed Feb 27, 2019
2 parents 011eeae + 4b4905d commit 556171f
Show file tree
Hide file tree
Showing 120 changed files with 3,041 additions and 890 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ sudo: required
dist: trusty
before_install: ./.travis_native_dependencies.sh
before_script:
- pip2.7 install --upgrade --ignore-installed --user jsontree asttokens
- export PATH=$PWD/srcML-src/bin:$PATH
- export PATH=$PWD/cgum:$PATH
- export PATH=$PWD/pythonparser:$PATH
script: ./gradlew check
after_success:
- ./gradlew coveralls uploadArchives
Expand Down
10 changes: 6 additions & 4 deletions .travis_native_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# 1) installing srcML
# start by boost dependency
sudo apt-get update
sudo apt-get install gcc g++ libxml2-dev libxslt1-dev libarchive-dev antlr libantlr-dev libcurl4-openssl-dev libssl-dev ocaml
sudo apt-get install gcc g++ libxml2-dev libxslt1-dev libarchive-dev antlr libantlr-dev libcurl4-openssl-dev libssl-dev
wget https://netix.dl.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz
tar -xzf boost_1_55_0.tar.gz
cd boost_1_55_0
./bootstrap.sh --without-libraries=atomic,chrono,context,coroutine,exception,graph,graph_parallel,iostreams,locale,log,math,mpi,python,random,serialization,signals,test,timer,wave
sudo ./b2 link=static cxxflags="-fPIC -static -Wl,--whole-archive" threading=multi install
sudo ./b2 -d0 link=static cxxflags="-fPIC -static -Wl,--whole-archive" threading=multi install
cd ..
# then srcml itself
wget http://131.123.42.38/lmcrs/beta/srcML-src.tar.gz
Expand All @@ -17,8 +17,10 @@ cmake .
make
cd ..
# 2) installing cgum
sudo apt-get install ocaml ocaml-native-compilers camlp4
git clone https://github.com/GumTreeDiff/cgum.git --depth 1
sudo apt-get install ocaml ocaml-native-compilers camlp4
git clone --branch v1.0.0 https://github.com/GumTreeDiff/cgum.git --depth 1
cd cgum
make
cd ..
# 3) installing pythonparser
git clone https://github.com/GumTreeDiff/pythonparser.git --depth 1
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog of GumTree

## v2.1.1
## v2.1.2
* New dockerfile to run GumTree
* Python tree generator
* JavaParser tree generator
* Several minor bugfixes

## v2.1.1
* New integration with antlr4 grammars
* Add matlab grammar

Expand All @@ -16,7 +22,7 @@
* Automatically produce nightlies
* Add new srcML tree generator that can deal with C++, C, C# and Java files
* Add new css tree generator based on ph-css
* Fix no label bug in ruby tree generator
* Fix no label bug in ruby tree generator
* Add custom options to furnish srcml and cgum paths
* Build script can exclude tests requiring an external tool
* Use sparkjava for the web client instead of NanoHTTPd
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# GumTree ![Build Status](https://travis-ci.org/GumTreeDiff/gumtree.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/GumTreeDiff/gumtree/badge.svg?branch=master)](https://coveralls.io/r/GumTreeDiff/gumtree?branch=master)
# GumTree

## Status

* Master branch: ![Build Status](https://travis-ci.org/GumTreeDiff/gumtree.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/GumTreeDiff/gumtree/badge.svg?branch=master)](https://coveralls.io/github/GumTreeDiff/gumtree?branch=master)
* Develop branch: ![Build Status](https://travis-ci.org/GumTreeDiff/gumtree.svg?branch=develop) [![Coverage Status](https://coveralls.io/repos/github/GumTreeDiff/gumtree/badge.svg?branch=develop)](https://coveralls.io/github/GumTreeDiff/gumtree?branch=develop)

## Description

GumTree is a complete framework to deal with source code as trees and compute differences between them. It includes possibilities such as:
* converting a source file into a language-agnostic tree format
Expand All @@ -11,7 +18,11 @@ Compared to classical code differencing tools, it has two important particularit
* it works on a tree structure rather than a text structure,
* it can detect moved or renamed elements in addition of deleted and inserted elements.

We already deal with a wide range of languages: Java, C, JavaScript and Ruby. More languages are coming soon, if you want to help contact [me](http://www.labri.fr/perso/falleri).
## Supported languages

We already deal with a wide range of languages: C, Java, JavaScript, Python, R, Ruby. Click [here](https://github.com/GumTreeDiff/gumtree/wiki/Languages) for more details about the language we support.

More languages are coming soon, if you want to help contact [me](http://www.labri.fr/perso/falleri).

## Citing GumTree

Expand All @@ -37,7 +48,3 @@ We are researchers, therefore if you use GumTree in an academic work we would be
## Documentation

To use GumTree, you can start by consulting the [Getting Started](https://github.com/GumTreeDiff/gumtree/wiki/Getting-Started) page from our [wiki](https://github.com/GumTreeDiff/gumtree/wiki).

## Nightlies

You can find the latest binaries of GumTree on [Bintray](https://bintray.com/jrfaller/GumTree/nightlies/2.1.0-2017-2#files).
4 changes: 1 addition & 3 deletions benchmark/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
plugins {
id "me.champeau.gradle.jmh" version "0.4.3"
id "me.champeau.gradle.jmh" version "0.4.5"
}

apply plugin: 'me.champeau.gradle.jmh'

uploadArchives.enabled = false
jar.enabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class ActionsCollector {

Expand All @@ -62,10 +64,13 @@ else if (args[0].equals("check"))

public static void collectActions() throws Exception {
Run.initGenerators();
List<Path> paths = Files.walk(Paths.get(RES_DIR)).filter(
List<Path> outputPaths = new ArrayList<>();
try (Stream<Path> paths = Files.walk(Paths.get(RES_DIR))) {
outputPaths = paths.filter(
p -> p.getFileName().toString().matches(".*_v0_.*\\.xml")).collect(Collectors.toList());
}
Files.createDirectories(Paths.get(OUTPUT_DIR));
for (Path path : paths) {
for (Path path : outputPaths) {
Path otherPath = Paths.get(path.toString().replace("_v0_","_v1_"));
Path outputPath = Paths.get(path.toString().replace("_v0_","_actions_"));
TreeContext src = TreeIoUtils.fromXml().generateFromFile(path.toString());
Expand All @@ -83,11 +88,14 @@ public static void collectActions() throws Exception {

public static void checkActions() throws Exception {
Run.initGenerators();
List<Path> paths = Files.walk(Paths.get(RES_DIR)).filter(
List<Path> outputPaths = new ArrayList<>();
try (Stream<Path> paths = Files.walk(Paths.get(RES_DIR))) {
outputPaths = paths.filter(
p -> p.getFileName().toString().matches(".*_v0_.*\\.xml")).collect(Collectors.toList());
}
boolean dirty = false;
StringBuffer b = new StringBuffer();
for (Path path : paths) {
StringBuilder b = new StringBuilder();
for (Path path : outputPaths) {
Path otherPath = Paths.get(path.toString().replace("_v0_","_v1_"));
TreeContext src = TreeIoUtils.fromXml().generateFromFile(path.toString());
TreeContext dst = TreeIoUtils.fromXml().generateFromFile(otherPath.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class BenchmarkCollector {

Expand All @@ -46,10 +48,14 @@ public static void main(String[] args) throws Exception {

public static void collectTrees(String dir) throws Exception {
Run.initGenerators();
List<Path> paths = Files.walk(Paths.get(dir)).filter(
p -> p.getFileName().toString().matches(".*_v0\\.(java|js|rb|c)")).collect(Collectors.toList());
List<Path> outputPaths = new ArrayList<>();
try (Stream<Path> paths = Files.walk(Paths.get(dir))) {
outputPaths = paths.filter(
p -> p.getFileName().toString().matches(".*_v0\\.(java|js|rb|c)")
).collect(Collectors.toList());
}
Files.createDirectories(Paths.get(OUTPUT_DIR));
for (Path path : paths) {
for (Path path : outputPaths) {
Path otherPath = Paths.get(path.toString().replace("_v0.","_v1."));
String oldName = path.toString().replaceAll("[^a-zA-Z0-9_]", "_");
String newName = otherPath.toString().replaceAll("[^a-zA-Z0-9_]", "_");
Expand Down
Loading

1 comment on commit 556171f

@monperrus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! is 2.1.2 released on Maven Central? (we would then update gumtree-spoon).

Please sign in to comment.