Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build with Maven
Expand Down
5 changes: 5 additions & 0 deletions virage/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
/.classpath
/.project
/.settings/
/.bloop/
/.metals/
/.vscode/
/src/main/resources/generated/
/.apt_generated/
/.apt_generated_tests/
101 changes: 60 additions & 41 deletions virage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,24 @@
<skipTests>false</skipTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.version>3.8.1</maven.version>
<maven.clean.version>3.3.1</maven.clean.version>
<maven.install.version>3.1.1</maven.install.version>
<maven.jar.version>3.3.0</maven.jar.version>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<jdk.version>17</jdk.version>
<scala.version>2.13.12</scala.version>
<log4j.version>2.20.0</log4j.version>
<spotbugs.version>4.7.3</spotbugs.version>
<junit.jupiter.version>5.10.0</junit.jupiter.version>
<surefire.version>3.1.2</surefire.version>
<maven.version>3.6.3</maven.version>
<jdk.version>21</jdk.version>
<maven.clean.version>3.4.1</maven.clean.version>
<maven.install.version>3.1.4</maven.install.version>
<maven.exec.version>3.5.0</maven.exec.version>
<maven.jar.version>3.4.2</maven.jar.version>
<maven.resources.version>3.3.1</maven.resources.version>
<maven.checkstyle.version>3.6.0</maven.checkstyle.version>
<maven.buildhelper.version>3.6.0</maven.buildhelper.version>
<maven.reports.version>3.9.0</maven.reports.version>
<maven.compiler.release>${jdk.version}</maven.compiler.release>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
<maven.compiler.target>${jdk.version}</maven.compiler.target>
<scala.version>2.13.16</scala.version>
<log4j.version>2.24.3</log4j.version>
<spotbugs.version>4.9.2.0</spotbugs.version>
<junit.jupiter.version>5.12.0</junit.jupiter.version>
<surefire.version>3.5.2</surefire.version>
<swi.home.dir>/usr/lib/swi-prolog</swi.home.dir>
<main.class>edu.kit.kastel.formal.virage.core.VirageMain</main.class>
</properties>
Expand Down Expand Up @@ -108,7 +113,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-engine</artifactId>
<version>1.10.0</version>
<version>1.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -135,45 +140,45 @@
<dependency>
<groupId>com.github.SWI-Prolog</groupId>
<artifactId>packages-jpl</artifactId>
<version>V9.1.15</version>
<version>V9.3.21</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.5.0</version>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.14.0</version>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
<version>2.18.3</version>
</dependency>
<!-- <dependency> <groupId>com.github.VeriVote</groupId> <artifactId>ViRAGe</artifactId>
<version>master-SNAPSHOT</version> </dependency> -->
<!-- https://mvnrepository.com/artifact/de.unruh/scala-isabelle -->
<dependency>
<groupId>de.unruh</groupId>
<artifactId>scala-isabelle_2.13</artifactId>
<version>0.4.2-RC1</version>
<version>0.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.9.0</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
<version>1.10.1</version>
</dependency>
<dependency>
<groupId>com.github.ferstl</groupId>
<artifactId>depgraph-maven-plugin</artifactId>
<version>4.0.2</version>
<version>4.0.3</version>
</dependency>
</dependencies>

Expand All @@ -190,6 +195,7 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
Expand All @@ -207,6 +213,14 @@
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>${user.home}/.virage/</directory>
<includes>
<include>settings.properties</include>
</includes>
</resource>
</resources>
</build>
</profile>
</profiles>
Expand All @@ -222,12 +236,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.clean.version}</version>
<version>${maven.resources.version}</version>
</plugin>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.8.1</version>
<version>4.9.2</version>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
Expand All @@ -251,7 +265,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.14.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<compilerArgument>-Xlint:deprecation</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -278,15 +297,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
<version>3.21.0</version>
<configuration>
<locales>en</locales>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven.jar.version}</version>
<version>${maven.checkstyle.version}</version>
<configuration>
<configLocation>checks.xml</configLocation>
<encoding>UTF-8</encoding>
Expand All @@ -309,14 +328,14 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.12.3</version>
<version>10.21.4</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.version}.5</version>
<version>${spotbugs.version}</version>
<configuration>
<xmlOutput>true</xmlOutput>
<failOnError>false</failOnError>
Expand All @@ -336,15 +355,15 @@
<dependencies>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.4.0</version>
<version>${maven.buildhelper.version}</version>
<executions>
<execution>
<id>add-source</id>
Expand All @@ -364,7 +383,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-versions</id>
Expand All @@ -374,7 +393,7 @@
<configuration>
<rules>
<requireMavenVersion>
<version>3.3.9</version>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${jdk.version}</version>
Expand All @@ -387,7 +406,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.16.0</version>
<version>2.18.0</version>
<configuration>
<rulesUri>file:///${basedir}/rules.xml</rulesUri>
<allowSnapshots>false</allowSnapshots>
Expand All @@ -407,7 +426,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<executions>
<execution>
<id>read-settings</id>
Expand All @@ -417,7 +436,7 @@
</goals>
<configuration>
<files>
<file>${user.home}/.virage/settings</file>
<file>${user.home}/.virage/settings.properties</file>
</files>
<!-- settings will not be there on first startup. -->
<!-- This is fine, as ViRAGe will copy it and enforce a restart if
Expand Down Expand Up @@ -455,7 +474,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<version>${maven.exec.version}</version>
<executions>
<execution>
<id>execute</id>
Expand Down Expand Up @@ -487,7 +506,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${maven.jar.version}</version>
<version>${maven.checkstyle.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -497,12 +516,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<version>3.11.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.5</version>
<version>${maven.reports.version}</version>
<reportSets>
<reportSet>
<reports>
Expand All @@ -525,7 +544,7 @@
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.7.2.1</version>
<version>${spotbugs.version}</version>
<reportSets>
<reportSet>
<reports>
Expand Down
22 changes: 20 additions & 2 deletions virage/src/main/java/edu/kit/kastel/formal/util/ProcessUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.StringTokenizer;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down Expand Up @@ -40,6 +41,24 @@ public static void start(final String editorExecutable, final File path) {
}
}

/**
* Wrapper method for process execution, either strip and escape or simply format.
*
* @param cmd the command string, multiple ones separated by blanks
* @param escape flag for determining whether to strip and escape or not
* @return the resulting process
* @throws IOException if an I/O error occurs
*/
public static Process exec(final String cmd, final boolean escape) throws IOException {
final String command = escape ? StringUtils.stripAndEscape(cmd) : String.format(cmd);
final StringTokenizer st = new StringTokenizer(command);
final String[] cmdarray = new String[st.countTokens()];
for (int i = 0; st.hasMoreTokens(); i++) {
cmdarray[i] = st.nextToken();
}
return new ProcessBuilder(cmdarray).start();
}

/**
* Executes a terminating command and prints its output to System.out/System.err, respectively.
* <b>Does not return if the command is non-terminating!</b>
Expand All @@ -52,8 +71,7 @@ public static void start(final String editorExecutable, final File path) {
*/
public static Output runTerminatingProcess(final String command)
throws IOException, InterruptedException {
final Runtime rt = Runtime.getRuntime();
final Process p = rt.exec(StringUtils.stripAndEscape(command));
final Process p = exec(command, true);
final int status = p.waitFor();
final String stdErr = new String(p.getErrorStream().readAllBytes(), StandardCharsets.UTF_8);
final String stdOut = new String(p.getInputStream().readAllBytes(), StandardCharsets.UTF_8);
Expand Down
Loading
Loading