Commit 978b91f5 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Update on build configuration after refactoring on graph package

parent 7517959a
......@@ -4,7 +4,7 @@ apply plugin: 'application'
sourceSets {
main {
java {
srcDir "${rootProject.absPath}/src/main/java/ui/graph"
srcDir "${rootProject.absPath}/src/main/java/graph"
srcDir "${rootProject.absPath}/src/main/java/ui/util"
srcDir "${rootProject.absPath}/src/main/java/ui/file"
srcDir "${rootProject.absPath}/src/main/java/vcd"
......
/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici
*
*
* ludovic.apvrille AT telecom-paritech.fr
* andrea.enrici AT telecom-paristech.fr
*
*
* This software is a computer program whose purpose is to allow the
* edition of TURTLE analysis, design and deployment diagrams, to
* allow the generation of RT-LOTOS or Java code from this diagram,
* and at last to allow the analysis of formal validation traces
* obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
* from INRIA Rhone-Alpes.
*
*
* This software is governed by the CeCILL license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
......@@ -32,27 +32,26 @@
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL license and that you accept its terms.
*/
import graph.AUTGraph;
import myutil.FileUtils;
import myutil.TraceManager;
import graph.AUTGraph;
import java.io.File;
/**
* Class GraphMinimize
* Command line application for minimizing graphs
* Apps of the package show, minimize and convert
* Creation: 11/01/2017
* @version 1.10 11/01/2017
* @author Ludovic APVRILLE
* Class GraphMinimize
* Command line application for minimizing graphs
* Apps of the package show, minimize and convert
* Creation: 11/01/2017
*
* @author Ludovic APVRILLE
* @version 1.10 11/01/2017
*/
public class GraphMinimize {
......@@ -66,44 +65,44 @@ public class GraphMinimize {
public static void printUsage() {
System.out.println("GraphMinimize: usage");
System.out.println("GraphShow <inputfile> <outputfile>");
System.out.println("<options> are optional. There might be : -debug -tauonly");
System.out.println("<options> are optional. There might be : -debug -tauonly");
System.out.println("<inputfile> should be in AUT format, and be readable");
System.out.println("<outputfile> will be in AUT format, and be writable");
System.out.println("<outputfile> will be in AUT format, and be writable");
}
public static boolean checkArgs(String [] args) {
public static boolean checkArgs(String[] args) {
return !(args.length < 2);
}
public static boolean hasDebug(String [] args) {
for (String s: args) {
if (s.equals("-debug")) {
return true;
}
}
return false;
public static boolean hasDebug(String[] args) {
for (String s : args) {
if (s.equals("-debug")) {
return true;
}
}
return false;
}
public static boolean hasTauOnly(String [] args) {
for (String s: args) {
if (s.equals("-tauonly")) {
return true;
}
}
return false;
public static boolean hasTauOnly(String[] args) {
for (String s : args) {
if (s.equals("-tauonly")) {
return true;
}
}
return false;
}
public static String getInputFile(String [] args) {
return args[args.length-2];
public static String getInputFile(String[] args) {
return args[args.length - 2];
}
public static String getOutputFile(String [] args) {
return args[args.length-1];
public static String getOutputFile(String[] args) {
return args[args.length - 1];
}
public static String prepareFiles(String _inputFile) {
File inputFile = new File(_inputFile);
......@@ -114,7 +113,7 @@ public class GraphMinimize {
}
return FileUtils.loadFileData(inputFile);
} catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
return null;
......@@ -135,29 +134,29 @@ public class GraphMinimize {
int nbOfOptions = 0;
if (hasDebug(args)) {
TraceManager.devPolicy = TraceManager.TO_CONSOLE;
TraceManager.devPolicy = TraceManager.TO_CONSOLE;
} else {
TraceManager.devPolicy = TraceManager.TO_DEVNULL;
}
TraceManager.devPolicy = TraceManager.TO_DEVNULL;
}
String graphData = prepareFiles(getInputFile(args));
if (graphData == null) {
String graphData = prepareFiles(getInputFile(args));
if (graphData == null) {
printUsage();
return;
}
AUTGraph graph = new AUTGraph();
graph.buildGraph(graphData);
AUTGraph graph = new AUTGraph();
graph.buildGraph(graphData);
System.out.println("Graph has " + graph.getNbOfStates() + " and " + graph.getNbOfTransitions() + " transitions.");
System.out.println("Graph has " + graph.getNbOfStates() + " and " + graph.getNbOfTransitions() + " transitions.");
System.out.println("Minimizing graph");
graph.minimizeTau(hasTauOnly(args));
System.out.println("Minimizing graph");
graph.minimizeTau(hasTauOnly(args));
graph.display(true);
graph.display(true);
}
} // Class GraphShow
......@@ -4,7 +4,7 @@ apply plugin: 'application'
sourceSets {
main {
java {
srcDir "${rootProject.absPath}/src/main/java/ui/graph"
srcDir "${rootProject.absPath}/src/main/java/graph"
srcDir "${rootProject.absPath}/src/main/java/common"
srcDir "${rootProject.absPath}/src/main/java/ui/util"
srcDir "${rootProject.absPath}/src/main/java/ui/file"
......
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