Skip to content

Commit

Permalink
Merge branch 'develop' into antlr-utils-rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
brodmo committed Sep 13, 2023
2 parents 3efd496 + 48acddb commit b263bc5
Show file tree
Hide file tree
Showing 104 changed files with 3,401 additions and 1,349 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@v4
with:
token: ${{ secrets.SDQ_DEV_DEPLOY_TOKEN }}
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@ name: Build

on:
push:
paths:
- ".github/workflows/maven.yml"
- "**/pom.xml"
- "**.java"
- "**.g4"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/maven.yml"
- "**/pom.xml"
- "**.java"
- "**.g4"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -26,7 +36,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
publish-maven-central:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
Expand All @@ -29,7 +29,7 @@ jobs:
publish-release-artifact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/report-viewer-build-test.yml"
- "report-viewer/**"

jobs:
pre_job:
Expand All @@ -23,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/report-viewer-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ on:
push:
branches:
- develop
paths:
- ".github/workflows/report-viewer-dev.yml"
- "report-viewer/**"

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/report-viewer-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/report-viewer-e2e.yml"
- "report-viewer/**"

jobs:
pre_job:
Expand All @@ -23,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/report-viewer-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
workflow_dispatch:
push:
path:
- report-viewer/**
- ".github/workflows/report-viewer-lint.yml"
- "report-viewer/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/report-viewer-lint.yml"
- "report-viewer/**"

jobs:
pre_job:
Expand All @@ -27,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/report-viewer-prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ name: Report Viewer Prettier Check Workflow # Checks the report viewer against t
on:
workflow_dispatch:
push:
path:
- report-viewer/**
paths:
- ".github/workflows/report-viewer-prettier.yml"
- "report-viewer/**"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/report-viewer-prettier.yml"
- "report-viewer/**"


jobs:
pre_job:
Expand All @@ -26,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/report-viewer-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/report-viewer-unit.yml"
- "report-viewer/**"

jobs:
pre_job:
Expand All @@ -23,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/report-viewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/sonarcloud-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches:
- main
- develop
paths:
- ".github/workflows/sonarcloud-branch.yml"
- "**/pom.xml"
- "**.java"
- "**.g4"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -16,7 +21,7 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
needs: get-info

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/spotless.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: Spotless Style Check

on:
push:
push:
paths:
- ".github/workflows/spotless.yml"
- "**/pom.xml"
- "**.java"
- "**.g4"
pull_request:
types: [opened, synchronize, reopened]
paths:
- ".github/workflows/spotless.yml"
- "**/pom.xml"
- "**.java"
- "**.g4"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -26,7 +36,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
Expand Down
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,25 @@ JPlag is a system that finds similarities among multiple sets of source code fil

In the following, a list of all supported languages with their supported language version is provided. A language can be selected from the command line using subcommands (jplag [jplag options] <language name> [language options]). Alternatively you can use the legacy "-l" argument.

| Language | Version | CLI Argument Name | [state](https://github.com/jplag/JPlag/wiki/2.-Supported-Languages) | parser |
|--------------------------------------------------------|--------:|-------------------|:-------------------------------------------------------------------:|:---------:|
| [Java](https://www.java.com) | 17 | java | mature | JavaC |
| [C/C++](https://isocpp.org) | 11 | cpp | legacy | JavaCC |
| [C/C++](https://isocpp.org) | 14 | cpp2 | beta | ANTLR 4 |
| [C#](https://docs.microsoft.com/en-us/dotnet/csharp/) | 6 | csharp | beta | ANTLR 4 |
| [Go](https://go.dev) | 1.17 | golang | beta | ANTLR 4 |
| [Kotlin](https://kotlinlang.org) | 1.3 | kotlin | beta | ANTLR 4 |
| [Python](https://www.python.org) | 3.6 | python3 | legacy | ANTLR 4 |
| [R](https://www.r-project.org/) | 3.5.0 | rlang | beta | ANTLR 4 |
| [Rust](https://www.rust-lang.org/) | 1.60.0 | rust | beta | ANTLR 4 |
| [Scala](https://www.scala-lang.org) | 2.13.8 | scala | beta | Scalameta |
| [Scheme](http://www.scheme-reports.org) | ? | scheme | unknown | JavaCC |
| [Swift](https://www.swift.org) | 5.4 | swift | beta | ANTLR 4 |
| [EMF Metamodel](https://www.eclipse.org/modeling/emf/) | 2.25.0 | emf | beta | EMF |
| [EMF Model](https://www.eclipse.org/modeling/emf/) | 2.25.0 | emf-model | alpha | EMF |
| [LLVM IR](https://llvm.org) | 15 | llvmir | beta | ANTLR 4 |
| Text (naive) | - | text | legacy | CoreNLP |
| Language | Version | CLI Argument Name | [state](https://github.com/jplag/JPlag/wiki/2.-Supported-Languages) | parser |
|------------------------------------------------------------|---------------------------------------------------------------------------------------:|-------------------|:-------------------------------------------------------------------:|:---------:|
| [Java](https://www.java.com) | 17 | java | mature | JavaC |
| [C/C++](https://isocpp.org) | 11 | cpp | legacy | JavaCC |
| [C/C++](https://isocpp.org) | 14 | cpp2 | beta | ANTLR 4 |
| [C#](https://docs.microsoft.com/en-us/dotnet/csharp/) | 6 | csharp | beta | ANTLR 4 |
| [Go](https://go.dev) | 1.17 | golang | beta | ANTLR 4 |
| [Kotlin](https://kotlinlang.org) | 1.3 | kotlin | beta | ANTLR 4 |
| [Python](https://www.python.org) | 3.6 | python3 | legacy | ANTLR 4 |
| [R](https://www.r-project.org/) | 3.5.0 | rlang | beta | ANTLR 4 |
| [Rust](https://www.rust-lang.org/) | 1.60.0 | rust | beta | ANTLR 4 |
| [Scala](https://www.scala-lang.org) | 2.13.8 | scala | beta | Scalameta |
| [Scheme](http://www.scheme-reports.org) | ? | scheme | unknown | JavaCC |
| [Swift](https://www.swift.org) | 5.4 | swift | beta | ANTLR 4 |
| [EMF Metamodel](https://www.eclipse.org/modeling/emf/) | 2.25.0 | emf | beta | EMF |
| [EMF Model](https://www.eclipse.org/modeling/emf/) | 2.25.0 | emf-model | alpha | EMF |
| [LLVM IR](https://llvm.org) | 15 | llvmir | beta | ANTLR 4 |
| [TypeScript](https://www.typescriptlang.org/) / JavaScript | [~5](https://github.com/antlr/grammars-v4/tree/master/javascript/typescript/README.md) | typescript | beta | ANTLR 4 |
| Text (naive) | - | text | legacy | CoreNLP |

## Download and Installation
You need Java SE 17 to run or build JPlag.
Expand Down Expand Up @@ -161,6 +162,7 @@ Commands:
scxml
swift
text
typescript
```

### Java API
Expand Down
7 changes: 6 additions & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
<artifactId>emf-model</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>de.jplag</groupId>
<artifactId>typescript</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>de.jplag</groupId>
<artifactId>llvmir</artifactId>
Expand All @@ -116,7 +121,7 @@
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.4</version>
<version>4.7.5</version>
</dependency>
</dependencies>
<build>
Expand Down
2 changes: 1 addition & 1 deletion cli/src/test/java/de/jplag/cli/LanguageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void testInvalidLanguage() {
@Test
void testLoading() {
var languages = LanguageLoader.getAllAvailableLanguages();
assertEquals(17, languages.size(), "Loaded Languages: " + languages.keySet());
assertEquals(18, languages.size(), "Loaded Languages: " + languages.keySet());
}

@Test
Expand Down
5 changes: 5 additions & 0 deletions coverage-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
<artifactId>emf-model</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>de.jplag</groupId>
<artifactId>typescript</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>de.jplag</groupId>
<artifactId>llvmir</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion language-antlr-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.13.0</version>
<version>4.13.1</version>
</dependency>
<dependency>
<groupId>de.jplag</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import de.jplag.antlr.*;

public class TestParserAdapter extends AbstractAntlrParserAdapter<TestParser> {
private static final TestListener testListener = new TestListener();
private static final TestListener listener = new TestListener();

@Override
protected Lexer createLexer(CharStream input) {
Expand All @@ -27,6 +27,6 @@ protected ParserRuleContext getEntryContext(TestParser parser) {

@Override
protected AbstractAntlrListener getListener() {
return testListener;
return listener;
}
}
Loading

0 comments on commit b263bc5

Please sign in to comment.