Skip to content

Commit 3463bfb

Browse files
committed
feat: cleaned-up redundant external generators, dockerfile now using dist-miniaml.
1 parent 72e1ea4 commit 3463bfb

File tree

37 files changed

+142
-1275
lines changed

37 files changed

+142
-1275
lines changed

.github/workflows/build-test-gumtree.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ concurrency:
1717

1818
jobs:
1919
build-test-deploy:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04
2121
container: gumtreediff/gumtree:latest
2222
environment: MavenCentral
2323
if: ${{ !(contains(github.event.head_commit.message, '[no ci]') || startsWith(github.event.head_commit.message, 'doc')) }}
2424
steps:
2525
- name: checkout gumtree
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5
2727
with:
2828
submodules: recursive
2929
show-progress: ''
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup Gradle
3535
uses: gradle/actions/setup-gradle@v4
3636
- name: build gumtree and run benchmarks
37-
run: ./gradlew -PtestNative build :benchmark:runOnDefects4J :benchmark:runOnGhJava :benchmark:execNotebook
37+
run: ./gradlew build :benchmark:runOnDefects4J :benchmark:runOnGhJava :benchmark:execNotebook
3838
- name: upload benchmarks results
3939
uses: actions/upload-artifact@v4
4040
with:
@@ -70,7 +70,7 @@ jobs:
7070
- name: set up docker buildx
7171
uses: docker/setup-buildx-action@v3
7272
- name: Cache Docker layers
73-
uses: actions/cache@v3
73+
uses: actions/cache@v4
7474
with:
7575
path: /tmp/.buildx-cache
7676
key: ${{ runner.os }}-buildx
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
plugins {
2+
id 'java-conv'
3+
}
4+
5+
test.onlyIf { rootProject.hasProperty('testExternal') }

buildSrc/src/main/groovy/java-native-conv.gradle

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ dependencies {
1010
implementation project(':core')
1111
implementation project(':client')
1212
implementation project(':client.diff')
13-
implementation project(':gen.c')
1413
implementation project(':gen.css')
1514
implementation project(':gen.javaparser')
1615
implementation project(':gen.jdt')
1716
implementation project(':gen.js')
18-
implementation project(':gen.js-acorn')
19-
implementation project(':gen.python')
2017
implementation project(':gen.srcml')
21-
implementation project(':gen.treesitter')
2218
implementation project(':gen.treesitter-ng')
2319
implementation project(':gen.xml')
2420
implementation project(':gen.yaml')

docker/Dockerfile

Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,13 @@
1-
FROM ubuntu:noble
1+
FROM openjdk:21-slim as build-stage
22

3-
ARG DEBIAN_FRONTEND=noninteractive
4-
ENV TZ=GMT
5-
6-
# Install all required packages
7-
RUN apt-get update \
8-
&& apt-get install -y --no-install-recommends openjdk-17-jdk wget git gdebi-core \
9-
build-essential ocaml libnum-ocaml-dev \
10-
python3-dev nodejs npm python3-venv \
11-
tzdata ca-certificates p11-kit
12-
13-
RUN python3 -m venv /opt/venv
14-
15-
ENV PATH="/opt/venv/bin:$PATH"
16-
17-
RUN pip install pandas plotnine scipy jupyter
18-
19-
# Set locale
20-
ENV LANG=C.UTF-8
21-
22-
ARG TARGETARCH
23-
24-
# Install srcML
25-
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
26-
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.10_arm64.deb && \
27-
gdebi srcml_1.1.0-1_ubuntu24.10_arm64.deb -n; \
28-
else \
29-
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.04_amd64.deb && \
30-
gdebi srcml_1.1.0-1_ubuntu24.04_amd64.deb -n; \
31-
fi
32-
33-
# Install cgum
34-
RUN git clone https://github.com/GumTreeDiff/cgum.git /opt/cgum --depth 1 \
35-
&& make -C /opt/cgum \
36-
&& ln -s /opt/cgum/cgum /usr/bin/cgum
37-
38-
# Install pythonparser
39-
RUN git clone https://github.com/GumTreeDiff/pythonparser.git /opt/pythonparser --depth 1 \
40-
&& ln -s /opt/pythonparser/pythonparser /usr/bin/pythonparser \
41-
&& pip3 install parso
42-
43-
# Install jsparser
44-
RUN git clone https://github.com/GumTreeDiff/jsparser.git /opt/jsparser --depth 1 \
45-
&& ln -s /opt/jsparser/jsparser /usr/bin/jsparser \
46-
&& npm --prefix /opt/jsparser/ install /opt/jsparser/
3+
# Compiles gumtree
4+
COPY . /opt/gumtree
5+
RUN /opt/gumtree/gradlew -p /opt/gumtree build
476

48-
# Install tree-sitter-parser
49-
RUN git clone --recurse-submodules --shallow-submodules https://github.com/GumTreeDiff/tree-sitter-parser.git /opt/tree-sitter-parser --depth 1 \
50-
&& ln -s /opt/tree-sitter-parser/tree-sitter-parser.py /usr/bin/tree-sitter-parser.py \
51-
&& pip3 install tree_sitter pyyaml
7+
FROM openjdk:21-slim as final-stage
528

53-
# Install gumtree
54-
COPY . /opt/gumtree
55-
RUN /opt/gumtree/gradlew -PtestNative -p /opt/gumtree build \
56-
&& ln -s /opt/gumtree/dist/build/install/gumtree/bin/gumtree /usr/bin/gumtree
9+
# Copy gumtree-native distribution from build-stage.
10+
COPY --from=build-stage /opt/gumtree/dist-minimal/build/install/gumtree/ /opt/gumtree
5711

5812
# Define volume diff to make available files to diff
5913
RUN mkdir -p /diff/left /diff/right
@@ -63,4 +17,4 @@ VOLUME /diff/left /diff/right
6317
# Expose port 4567 for webdiff
6418
EXPOSE 4567
6519

66-
ENTRYPOINT ["gumtree"]
20+
ENTRYPOINT ["/opt/gumtree/bin/gumtree"]

docker/Dockerfile-external

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
FROM ubuntu:noble
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
ENV TZ=GMT
5+
6+
# Install all required packages
7+
RUN apt-get update \
8+
&& apt-get install -y --no-install-recommends openjdk-17-jdk wget git gdebi-core \
9+
build-essential ocaml libnum-ocaml-dev \
10+
python3-dev nodejs npm python3-venv \
11+
tzdata ca-certificates p11-kit
12+
13+
RUN python3 -m venv /opt/venv
14+
15+
ENV PATH="/opt/venv/bin:$PATH"
16+
17+
RUN pip install pandas plotnine scipy jupyter
18+
19+
# Set locale
20+
ENV LANG=C.UTF-8
21+
22+
ARG TARGETARCH
23+
24+
# Install srcML
25+
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
26+
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.10_arm64.deb && \
27+
gdebi srcml_1.1.0-1_ubuntu24.10_arm64.deb -n; \
28+
else \
29+
wget https://github.com/srcML/srcML/releases/download/v1.1.0/srcml_1.1.0-1_ubuntu24.04_amd64.deb && \
30+
gdebi srcml_1.1.0-1_ubuntu24.04_amd64.deb -n; \
31+
fi
32+
33+
# Install cgum
34+
RUN git clone https://github.com/GumTreeDiff/cgum.git /opt/cgum --depth 1 \
35+
&& make -C /opt/cgum \
36+
&& ln -s /opt/cgum/cgum /usr/bin/cgum
37+
38+
# Install pythonparser
39+
RUN git clone https://github.com/GumTreeDiff/pythonparser.git /opt/pythonparser --depth 1 \
40+
&& ln -s /opt/pythonparser/pythonparser /usr/bin/pythonparser \
41+
&& pip3 install parso
42+
43+
# Install jsparser
44+
RUN git clone https://github.com/GumTreeDiff/jsparser.git /opt/jsparser --depth 1 \
45+
&& ln -s /opt/jsparser/jsparser /usr/bin/jsparser \
46+
&& npm --prefix /opt/jsparser/ install /opt/jsparser/
47+
48+
# Install tree-sitter-parser
49+
RUN git clone --recurse-submodules --shallow-submodules https://github.com/GumTreeDiff/tree-sitter-parser.git /opt/tree-sitter-parser --depth 1 \
50+
&& ln -s /opt/tree-sitter-parser/tree-sitter-parser.py /usr/bin/tree-sitter-parser.py \
51+
&& pip3 install tree_sitter pyyaml
52+
53+
# Install gumtree
54+
COPY . /opt/gumtree
55+
RUN /opt/gumtree/gradlew -PtestNative -p /opt/gumtree build \
56+
&& ln -s /opt/gumtree/dist/build/install/gumtree/bin/gumtree /usr/bin/gumtree
57+
58+
# Define volume diff to make available files to diff
59+
RUN mkdir -p /diff/left /diff/right
60+
WORKDIR /diff
61+
VOLUME /diff/left /diff/right
62+
63+
# Expose port 4567 for webdiff
64+
EXPOSE 4567
65+
66+
ENTRYPOINT ["gumtree"]

docker/Dockerfile-native

Lines changed: 0 additions & 20 deletions
This file was deleted.

gen.c/build.gradle

Lines changed: 0 additions & 10 deletions
This file was deleted.

gen.c/src/main/java/com/github/gumtreediff/gen/c/CTreeGenerator.java

Lines changed: 0 additions & 64 deletions
This file was deleted.

gen.c/src/test/java/com/github/gumtreediff/gen/c/TestCGenerator.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)