Browse Source

Merge branch 'master' into java-9-rework

Timur Sağlam 5 years ago
parent
commit
d7528db4c6

+ 23 - 0
.github/dependabot.yml

@@ -0,0 +1,23 @@
+version: 2
+updates:
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "weekly"
+      day: "wednesday"
+      time: "11:00"
+      timezone: "Europe/Berlin"
+    commit-message:
+      prefix: "Dependency"
+      include: "scope"
+  - package-ecosystem: "maven"
+    directory: "/"
+    schedule:
+      interval: "weekly"
+      day: "wednesday"
+      time: "11:00"
+      timezone: "Europe/Berlin"
+    commit-message:
+      prefix: "Dependency"
+      include: "scope"
+

+ 49 - 0
.github/workflows/maven.yml

@@ -0,0 +1,49 @@
+name: Maven Workflow
+
+on:
+  push: 
+  pull_request:
+    types: [opened, synchronize, reopened]
+  
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2.3.4
+
+    - name: Set up JDK
+      uses: actions/setup-java@v2
+      with:
+        java-version: 11
+        distribution: 'zulu'
+        
+    - name: Run Maven Install
+      run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
+    
+    - name: Run Tests
+      run: mvn test -B
+      
+    - name: Build Assembly
+      working-directory: jplag
+      run: mvn clean generate-sources package assembly:single
+      
+    - name: Upload Assembly
+      uses: actions/upload-artifact@v2
+      with:
+        name: "JPlag"
+        path: "jplag/target/jplag-*-jar-with-dependencies.jar"
+        
+    - name: Publish Release
+      uses: marvinpinto/action-automatic-releases@latest
+      if: startsWith(github.ref, 'refs/tags/v')
+      with:
+        repo_token: "${{ secrets.GITHUB_TOKEN }}"
+        draft: true
+        files: |
+          jplag/target/jplag-*-jar-with-dependencies.jar
+      
+

+ 0 - 15
.travis.yml

@@ -1,15 +0,0 @@
-jdk: openjdk11
-language: java
-cache:
-  directories:
-    - $HOME/.m2
-before_deploy:
-  - mvn clean generate-sources assembly:assembly -f jplag/pom.xml -U
-deploy:
-  provider: releases
-  api_key: $OAUTH
-  file_glob: true
-  file: jplag/target/jplag*with-dependencies*.jar
-  skip_cleanup: true
-  on:
-    tags: true

+ 5 - 11
README.md

@@ -16,11 +16,9 @@ This fork focuses on the development of a new Java API for JPlag.
 
 You'll find the generated JAR with all dependencies in  `jplag/target`.
 
-## (Breaking) Changes
+## (Breaking) Changes coming with the v3.0.0 release
 
-> Note: The following list of changes doesn't claim to be complete and is intended to give a rough overview of the changes introduced with this fork.
-
-This fork made the following (breaking) changes to the JPlag repository:
+> Note: The following list is incomplete and gives a rough overview of the changes. In case you depend on missing features we refer to the [legacy release v2.12.1](https://github.com/jplag/jplag/releases/tag/v2.12.1-SNAPSHOT) and the [legacy branch](https://github.com/jplag/jplag/tree/legacy).
 
 * Removed folders related to (deprecated) web services: `adminTool`, `atujplag`, `homepage`, `maven-libs`, `webService`, and `wsClient`
 * Deleted unnecessary resources from `jplag/src/main/resources`
@@ -34,11 +32,6 @@ This fork made the following (breaking) changes to the JPlag repository:
 * The new `JPlagComparison` class replaces the old `AllMatches` class.
 * We removed `AvgComparator`, `AvgReversedComparator`, `MaxComparator`, `MaxReversedComparator`, `MinComparator`, and `MinReversedComparator` from the `JPlagComparison` (previously `AllMatches`) class. All comparisons are now sorted by average similarity. The `JPlagResult` and `JPlagComparison` classes should make adding a custom sorting logic very straightforward if that's required.
 
-In addition, without referring to any specifics, this fork also includes:
-* Tons of code formatting & restructuring
-* Renaming of classes, files, and functions 
-* Deletion of unused code
-
 ## Usage
 
 ### CLI
@@ -101,8 +94,9 @@ report.writeResult(result);
 ```
 
 #### Class Diagram
-
-![UMLClassDiagram.png](UMLClassDiagram.png)
+<p align="center">
+	<img alt="UMLClassDiagram.png" src="UMLClassDiagram.png?raw=true" width="800">
+</p>
 
 ## Concepts
 

+ 0 - 3
jplag.frontend.chars/src/main/java/jplag/chars/CharToken.java

@@ -5,12 +5,9 @@ public class CharToken extends jplag.Token {
 
 	private int index;
 
-	private Parser parser;
-
 	public CharToken(int type, String file, int index, Parser parser) {
 		super(type, file, -1);
 		this.index = index;
-		this.parser = parser;
 	}
 
 	public CharToken(int type, String file, Parser parser) {

+ 1 - 2
jplag.frontend.java-1.1exp/src/main/java/jplag/javax/Language.java

@@ -1,9 +1,8 @@
 package jplag.javax;
 
-import java.io.*;
+import java.io.File;
 
 import jplag.ProgramI;
-import jplag.javax.Parser;
 
 public class Language implements jplag.Language {
 	private Parser parser;

+ 2 - 0
jplag.frontend.python-3/src/main/java/jplag/python3/Python3Token.java

@@ -2,6 +2,8 @@ package jplag.python3;
 
 public class Python3Token extends jplag.Token implements Python3TokenConstants {
 
+    private static final long serialVersionUID = 1485877548175917943L;
+    
     private int line, column, length;
 
     public Python3Token(int type, String file, int line, int column, int length) {

+ 1 - 1
jplag.frontend.text/src/main/java/jplag/text/TextToken.java

@@ -7,7 +7,7 @@ public class TextToken extends jplag.Token {
         text = text.toLowerCase();
         Integer obj = (Integer) parser.tokenStructure.table.get(text);
         if(obj == null) {
-            obj = new Integer(parser.tokenStructure.serial);
+            obj = Integer.valueOf(parser.tokenStructure.serial);
             if(parser.tokenStructure.serial == Integer.MAX_VALUE)
                 parser.outOfSerials();
             else

+ 3 - 3
jplag.parent/pom.xml

@@ -289,7 +289,7 @@
 			<dependency>
 				<groupId>com.sun.xml.messaging.saaj</groupId>
 				<artifactId>saaj-impl</artifactId>
-				<version>1.3.20</version>
+				<version>2.0.1</version>
 			</dependency>
 			<dependency>
 				<groupId>javax.mail</groupId>
@@ -299,7 +299,7 @@
 			<dependency>
 				<groupId>com.sun.xml.rpc</groupId>
 				<artifactId>jaxrpc-impl</artifactId>
-				<version>1.1.3_01</version>
+				<version>1.1.6</version>
 			</dependency>
 			<dependency>
 				<groupId>javax.xml</groupId>
@@ -314,7 +314,7 @@
 			<dependency>
 				<groupId>org.apache.ant</groupId>
 				<artifactId>ant</artifactId>
-				<version>1.10.9</version>
+				<version>1.10.10</version>
 			</dependency>
 			<dependency>
 				<groupId>edu.kit.ipd.jplag</groupId>

+ 1 - 1
jplag/pom.xml

@@ -139,7 +139,7 @@
           <dependency>
             <groupId>net.sf.proguard</groupId>
             <artifactId>proguard-base</artifactId>
-            <version>4.9</version>
+            <version>6.2.2</version>
             <scope>runtime</scope>
           </dependency>
         </dependencies>