Skip to content

Commit 556171f

Browse files
committed
merged version 2.1.2
2 parents 011eeae + 4b4905d commit 556171f

File tree

120 files changed

+3041
-890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+3041
-890
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ sudo: required
22
dist: trusty
33
before_install: ./.travis_native_dependencies.sh
44
before_script:
5+
- pip2.7 install --upgrade --ignore-installed --user jsontree asttokens
56
- export PATH=$PWD/srcML-src/bin:$PATH
67
- export PATH=$PWD/cgum:$PATH
8+
- export PATH=$PWD/pythonparser:$PATH
79
script: ./gradlew check
810
after_success:
911
- ./gradlew coveralls uploadArchives

.travis_native_dependencies.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# 1) installing srcML
33
# start by boost dependency
44
sudo apt-get update
5-
sudo apt-get install gcc g++ libxml2-dev libxslt1-dev libarchive-dev antlr libantlr-dev libcurl4-openssl-dev libssl-dev ocaml
5+
sudo apt-get install gcc g++ libxml2-dev libxslt1-dev libarchive-dev antlr libantlr-dev libcurl4-openssl-dev libssl-dev
66
wget https://netix.dl.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz
77
tar -xzf boost_1_55_0.tar.gz
88
cd boost_1_55_0
99
./bootstrap.sh --without-libraries=atomic,chrono,context,coroutine,exception,graph,graph_parallel,iostreams,locale,log,math,mpi,python,random,serialization,signals,test,timer,wave
10-
sudo ./b2 link=static cxxflags="-fPIC -static -Wl,--whole-archive" threading=multi install
10+
sudo ./b2 -d0 link=static cxxflags="-fPIC -static -Wl,--whole-archive" threading=multi install
1111
cd ..
1212
# then srcml itself
1313
wget http://131.123.42.38/lmcrs/beta/srcML-src.tar.gz
@@ -17,8 +17,10 @@ cmake .
1717
make
1818
cd ..
1919
# 2) installing cgum
20-
sudo apt-get install ocaml ocaml-native-compilers camlp4
21-
git clone https://github.com/GumTreeDiff/cgum.git --depth 1
20+
sudo apt-get install ocaml ocaml-native-compilers camlp4
21+
git clone --branch v1.0.0 https://github.com/GumTreeDiff/cgum.git --depth 1
2222
cd cgum
2323
make
2424
cd ..
25+
# 3) installing pythonparser
26+
git clone https://github.com/GumTreeDiff/pythonparser.git --depth 1

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog of GumTree
22

3-
## v2.1.1
3+
## v2.1.2
4+
* New dockerfile to run GumTree
5+
* Python tree generator
6+
* JavaParser tree generator
7+
* Several minor bugfixes
8+
9+
## v2.1.1
410
* New integration with antlr4 grammars
511
* Add matlab grammar
612

@@ -16,7 +22,7 @@
1622
* Automatically produce nightlies
1723
* Add new srcML tree generator that can deal with C++, C, C# and Java files
1824
* Add new css tree generator based on ph-css
19-
* Fix no label bug in ruby tree generator
25+
* Fix no label bug in ruby tree generator
2026
* Add custom options to furnish srcml and cgum paths
2127
* Build script can exclude tests requiring an external tool
2228
* Use sparkjava for the web client instead of NanoHTTPd

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# 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)
1+
# GumTree
2+
3+
## Status
4+
5+
* 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)
6+
* 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)
7+
8+
## Description
29

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

14-
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).
21+
## Supported languages
22+
23+
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.
24+
25+
More languages are coming soon, if you want to help contact [me](http://www.labri.fr/perso/falleri).
1526

1627
## Citing GumTree
1728

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

3950
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).
40-
41-
## Nightlies
42-
43-
You can find the latest binaries of GumTree on [Bintray](https://bintray.com/jrfaller/GumTree/nightlies/2.1.0-2017-2#files).

benchmark/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
plugins {
2-
id "me.champeau.gradle.jmh" version "0.4.3"
2+
id "me.champeau.gradle.jmh" version "0.4.5"
33
}
44

5-
apply plugin: 'me.champeau.gradle.jmh'
6-
75
uploadArchives.enabled = false
86
jar.enabled = false
97

benchmark/src/main/java/com/github/gumtree/dist/ActionsCollector.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
import java.nio.file.Files;
3535
import java.nio.file.Path;
3636
import java.nio.file.Paths;
37+
import java.util.ArrayList;
3738
import java.util.List;
3839
import java.util.stream.Collectors;
40+
import java.util.stream.Stream;
3941

4042
public class ActionsCollector {
4143

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

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

8489
public static void checkActions() throws Exception {
8590
Run.initGenerators();
86-
List<Path> paths = Files.walk(Paths.get(RES_DIR)).filter(
91+
List<Path> outputPaths = new ArrayList<>();
92+
try (Stream<Path> paths = Files.walk(Paths.get(RES_DIR))) {
93+
outputPaths = paths.filter(
8794
p -> p.getFileName().toString().matches(".*_v0_.*\\.xml")).collect(Collectors.toList());
95+
}
8896
boolean dirty = false;
89-
StringBuffer b = new StringBuffer();
90-
for (Path path : paths) {
97+
StringBuilder b = new StringBuilder();
98+
for (Path path : outputPaths) {
9199
Path otherPath = Paths.get(path.toString().replace("_v0_","_v1_"));
92100
TreeContext src = TreeIoUtils.fromXml().generateFromFile(path.toString());
93101
TreeContext dst = TreeIoUtils.fromXml().generateFromFile(otherPath.toString());

benchmark/src/main/java/com/github/gumtree/dist/BenchmarkCollector.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
import java.nio.file.Files;
3030
import java.nio.file.Path;
3131
import java.nio.file.Paths;
32+
import java.util.ArrayList;
3233
import java.util.List;
3334
import java.util.stream.Collectors;
35+
import java.util.stream.Stream;
3436

3537
public class BenchmarkCollector {
3638

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

4749
public static void collectTrees(String dir) throws Exception {
4850
Run.initGenerators();
49-
List<Path> paths = Files.walk(Paths.get(dir)).filter(
50-
p -> p.getFileName().toString().matches(".*_v0\\.(java|js|rb|c)")).collect(Collectors.toList());
51+
List<Path> outputPaths = new ArrayList<>();
52+
try (Stream<Path> paths = Files.walk(Paths.get(dir))) {
53+
outputPaths = paths.filter(
54+
p -> p.getFileName().toString().matches(".*_v0\\.(java|js|rb|c)")
55+
).collect(Collectors.toList());
56+
}
5157
Files.createDirectories(Paths.get(OUTPUT_DIR));
52-
for (Path path : paths) {
58+
for (Path path : outputPaths) {
5359
Path otherPath = Paths.get(path.toString().replace("_v0.","_v1."));
5460
String oldName = path.toString().replaceAll("[^a-zA-Z0-9_]", "_");
5561
String newName = otherPath.toString().replaceAll("[^a-zA-Z0-9_]", "_");

0 commit comments

Comments
 (0)