ソースを参照

Merge pull request #702 from jplag/emf-fixes

EMF modeling language fixes
Timur Sağlam 4 年 前
親
コミット
f41a454235

+ 2 - 3
README.md

@@ -28,8 +28,7 @@ In the following, a list of all supported languages with their supported languag
 | [Scala](https://www.scala-lang.org)                              |  2.13.8 | scala                 | beta | Scalameta |
 | [Scala](https://www.scala-lang.org)                              |  2.13.8 | scala                 | beta | Scalameta |
 | [Scheme](http://www.scheme-reports.org)                          |       ? | scheme                | unknown | JavaCC |
 | [Scheme](http://www.scheme-reports.org)                          |       ? | scheme                | unknown | JavaCC |
 | [Swift](https://www.swift.org)                                   |     5.4 | swift                 | beta | ANTLR 4 |
 | [Swift](https://www.swift.org)                                   |     5.4 | swift                 | beta | ANTLR 4 |
-| [EMF Metamodel](https://www.eclipse.org/modeling/emf/)           |  2.25.0 | emf-metamodel         | alpha | EMF |
-| [EMF Metamodel](https://www.eclipse.org/modeling/emf/) (dynamic) |  2.25.0 | emf-metamodel-dynamic | alpha | EMF |
+| [EMF Metamodel](https://www.eclipse.org/modeling/emf/)           |  2.25.0 | emf                   | alpha | EMF |
 | Text (naive)                                                     |       - | text                  | legacy | CoreNLP |
 | Text (naive)                                                     |       - | text                  | legacy | CoreNLP |
 
 
 ## Download and Installation
 ## Download and Installation
@@ -67,7 +66,7 @@ named arguments:
   -h, --help             show this help message and exit
   -h, --help             show this help message and exit
   -new NEW [NEW ...]     Root-directory with submissions to check for plagiarism (same as the root directory)
   -new NEW [NEW ...]     Root-directory with submissions to check for plagiarism (same as the root directory)
   -old OLD [OLD ...]     Root-directory with prior submissions to compare against
   -old OLD [OLD ...]     Root-directory with prior submissions to compare against
-  -l {cpp,csharp,emf-metamodel,emf-metamodel-dynamic,go,java,kotlin,python3,rlang,scala,scheme,swift,text}
+  -l {cpp,csharp,emf,go,java,kotlin,python3,rlang,scala,scheme,swift,text}
                          Select the language to parse the submissions (default: java)
                          Select the language to parse the submissions (default: java)
   -bc BC                 Path of  the  directory  containing  the  base  code  (common  framework  used  in  all
   -bc BC                 Path of  the  directory  containing  the  base  code  (common  framework  used  in  all
                          submissions)
                          submissions)

+ 0 - 5
cli/pom.xml

@@ -85,11 +85,6 @@
             <artifactId>emf-metamodel</artifactId>
             <artifactId>emf-metamodel</artifactId>
             <version>${revision}</version>
             <version>${revision}</version>
         </dependency>
         </dependency>
-        <dependency>
-            <groupId>de.jplag</groupId>
-            <artifactId>emf-metamodel-dynamic</artifactId>
-            <version>${revision}</version>
-        </dependency>
         <!-- CLI -->
         <!-- CLI -->
         <dependency>
         <dependency>
             <groupId>org.kohsuke.metainf-services</groupId>
             <groupId>org.kohsuke.metainf-services</groupId>

+ 1 - 1
cli/src/test/java/de/jplag/cli/LanguageTest.java

@@ -31,7 +31,7 @@ class LanguageTest extends CommandLineInterfaceTest {
     @Test
     @Test
     void testLoading() {
     void testLoading() {
         var languages = LanguageLoader.getAllAvailableLanguages();
         var languages = LanguageLoader.getAllAvailableLanguages();
-        Assertions.assertEquals(13, languages.size(), "Loaded Languages: " + languages.keySet());
+        Assertions.assertEquals(12, languages.size(), "Loaded Languages: " + languages.keySet());
     }
     }
 
 
     @Test
     @Test

+ 1 - 1
languages/emf-metamodel-dynamic/src/main/java/de/jplag/emf/dynamic/Language.java

@@ -12,7 +12,7 @@ import de.jplag.emf.dynamic.parser.DynamicEcoreParser;
 @MetaInfServices(de.jplag.Language.class)
 @MetaInfServices(de.jplag.Language.class)
 public class Language extends de.jplag.emf.Language {
 public class Language extends de.jplag.emf.Language {
     private static final String NAME = "EMF metamodels (dynamically created token set)";
     private static final String NAME = "EMF metamodels (dynamically created token set)";
-    public static final String IDENTIFIER = "emf-metamodel-dynamic";
+    public static final String IDENTIFIER = "emf-dynamic";
 
 
     private static final int DEFAULT_MIN_TOKEN_MATCH = 10;
     private static final int DEFAULT_MIN_TOKEN_MATCH = 10;
 
 

+ 1 - 1
languages/emf-metamodel/src/main/java/de/jplag/emf/Language.java

@@ -21,7 +21,7 @@ public class Language implements de.jplag.Language {
     public static final String FILE_ENDING = "." + EcorePackage.eNAME;
     public static final String FILE_ENDING = "." + EcorePackage.eNAME;
 
 
     private static final String NAME = "EMF metamodel";
     private static final String NAME = "EMF metamodel";
-    public static final String IDENTIFIER = "emf-metamodel";
+    public static final String IDENTIFIER = "emf";
     private static final int DEFAULT_MIN_TOKEN_MATCH = 6;
     private static final int DEFAULT_MIN_TOKEN_MATCH = 6;
 
 
     protected final EcoreParser parser;
     protected final EcoreParser parser;

+ 1 - 1
languages/emf-metamodel/src/main/java/de/jplag/emf/util/MetamodelTreeView.java

@@ -85,7 +85,7 @@ public class MetamodelTreeView {
      * @param suffix is the suffix of the file to be written.
      * @param suffix is the suffix of the file to be written.
      */
      */
     public void writeToFile(String suffix) {
     public void writeToFile(String suffix) {
-        File treeViewFile = new File(file, suffix);
+        File treeViewFile = new File(file + suffix);
         try (BufferedWriter writer = new BufferedWriter(new FileWriter(treeViewFile));) {
         try (BufferedWriter writer = new BufferedWriter(new FileWriter(treeViewFile));) {
             if (!treeViewFile.createNewFile()) {
             if (!treeViewFile.createNewFile()) {
                 logger.warn("Overwriting tree view file: {}", treeViewFile);
                 logger.warn("Overwriting tree view file: {}", treeViewFile);