Skip to content
Merged
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
51 changes: 25 additions & 26 deletions latte/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
<version>0.0.1-SNAPSHOT</version>

<name>latte</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- versions -->
<version.spoon>10.4.2</version.spoon>
</properties>

Expand All @@ -28,52 +26,55 @@
<version>2.11.0</version>
</dependency>


<dependency>
<groupId>org.javatuples</groupId>
<artifactId>javatuples</artifactId>
<version>1.2</version>
</dependency>


<dependency>
<groupId>org.jboss.maven.surefire.modular</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>1.0.0.Alpha3</version>
<type>maven-plugin</type>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.4</version> <!-- Version is fine -->
<scope>test</scope>
</dependency>


<!-- JUnit Jupiter Params (for Parameterized tests) -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.4</version>
<artifactId>junit-jupiter-params</artifactId>
<version>5.11.4</version> <!-- Same version for consistency -->
<scope>test</scope>
</dependency>

<!-- JUnit Jupiter Engine (for running tests) -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.11.4</version> <!-- Same version for consistency -->
<scope>test</scope>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.12</version>
</dependency>


<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>2.1.0-alpha1</version>
<type>pom</type>
</dependency>


<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback</artifactId>
<version>0.5</version>
<type>pom</type>
</dependency>


<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
Expand All @@ -87,24 +88,23 @@
<version>4.11</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/fr.inria.gforge.spoon/spoon-core -->
<dependency>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-core</artifactId>
<version>${version.spoon}</version>
</dependency>

<!-- Spoon Core Dependency -->
<dependency>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-core</artifactId>
<version>${version.spoon}</version>
</dependency>

</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<pluginManagement>
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
Expand All @@ -115,7 +115,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>3.0.0-M5</version> <!-- Updated to newer version for better JUnit 5 support -->
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -129,7 +129,6 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
Expand Down
11 changes: 7 additions & 4 deletions latte/src/main/java/api/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public static void main( String[] args ){
if (args.length == 0) {
System.out.println("Please enter the path to the file you want to process");
String allPath = "latte/src/main/java/examples/MyStackTest.java";
launcher(allPath);
launcher(allPath, true);

} else if (args.length == 1 && args[0].equals("-multi")) {
// Analyze multiple files from command line
Scanner scanner = new Scanner(System.in);
while(scanner.hasNextLine()){
String filePath = scanner.nextLine();
launcher(filePath);
launcher(filePath, true);
}
scanner.close();
}
Expand All @@ -47,7 +47,7 @@ public static void main( String[] args ){
*
* @param filePath
*/
public static void launcher(String filePath) {
public static void launcher(String filePath, boolean justJson) {

if (filePath == null) throw new InvalidParameterException("The path to the file is null");

Expand Down Expand Up @@ -109,6 +109,9 @@ public static void launcher(String filePath) {
sp.getEndLine(), sp.getEndColumn(), e.getMessage(), e.getFullMessage());
String json = new Gson().toJson(error); // using Gson to convert object to JSON
System.err.println(json);
if (!justJson)
throw e;


} finally {
// Delete the output directory
Expand Down Expand Up @@ -138,4 +141,4 @@ public static boolean deleteDirectory(File directory) {
}
return isDeleted;
}
}
}
Loading