Commit dfea71e8 authored by Jaime Arias's avatar Jaime Arias
Browse files

returning imi and tex files

parent 751446dc
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**|target/generated-sources/annotations/" kind="src" output="target/classes" path="target"> <classpathentry excluding="**|target/generated-test-sources/test-annotations/|target/generated-sources/annotations/" kind="src" output="target/classes" path="target">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
...@@ -33,13 +33,10 @@ ...@@ -33,13 +33,10 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-sources/test-annotations"> <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations"> <classpathentry kind="src" path="target/generated-sources/annotations">
......
...@@ -46,6 +46,15 @@ ...@@ -46,6 +46,15 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
......
...@@ -3,8 +3,10 @@ package org.cosyverif.service.adt2amas; ...@@ -3,8 +3,10 @@ package org.cosyverif.service.adt2amas;
import org.cosyverif.alligator.service.AnnotatedService.Task; import org.cosyverif.alligator.service.AnnotatedService.Task;
import java.io.File; import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Arrays;
import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.CommandLine;
import org.cosyverif.alligator.service.BinaryService; import org.cosyverif.alligator.service.BinaryService;
...@@ -59,8 +61,8 @@ public class EAMASTranslation extends BinaryService{ ...@@ -59,8 +61,8 @@ public class EAMASTranslation extends BinaryService{
runnable.setExecutable(true); runnable.setExecutable(true);
final CommandLine command = new CommandLine("./adt2amas"); final CommandLine command = new CommandLine("./adt2amas");
command.addArguments("transform --model " + model.getName()); // command.addArguments("transform --model " + model.getName());
command.addArguments("transform --model treasure-hunters");
return task(command) return task(command)
.workingDirectory(baseDirectory()) .workingDirectory(baseDirectory())
...@@ -68,7 +70,7 @@ public class EAMASTranslation extends BinaryService{ ...@@ -68,7 +70,7 @@ public class EAMASTranslation extends BinaryService{
@Override @Override
public void fallback(String line){ public void fallback(String line){
try{ try{
getOutputFiles(model); getOutputFiles();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -80,7 +82,18 @@ public class EAMASTranslation extends BinaryService{ ...@@ -80,7 +82,18 @@ public class EAMASTranslation extends BinaryService{
}); });
} }
private void getOutputFiles(File modelFile) throws IOException { private void getOutputFiles() throws IOException {
File directory = new File(baseDirectory().getAbsolutePath());
File[] files = directory.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.endsWith(".imi") || name.endsWith(".tex");
}
});
Arrays.sort(files);
imitatorFile = files[0];
latexFile = files[1];
} }
@Example(name = "Example of the minimal scheduling algorithm", @Example(name = "Example of the minimal scheduling algorithm",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment