Skip to content

Commit

Permalink
Update StartMAS.java
Browse files Browse the repository at this point in the history
  • Loading branch information
jomifred committed Apr 11, 2024
1 parent 96bbe06 commit 7bf0206
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions jason-cli/src/main/java/jason/cli/mas/StartMAS.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public class StartMAS implements Runnable {
@Option(names = { "--cp" }, defaultValue = "", paramLabel = "<classpath>", description = "directories where java classes can be found (for environment implementation, for instance)")
String classPathArg;

@Option(names = { "--mas2j" }, defaultValue = "", paramLabel = "<mas2j file>", description = "runs jason project without gradle (offline), java classes should be compiled before running")
@Option(names = { "--mas2j" }, defaultValue = "", paramLabel = "<mas2j file>", description = "runs a Jason project")
String mas2j;

@Option(names = { "--use-gradle" }, defaultValue = "", paramLabel = "<mas2j file>", description = "executes the MAS defined in a mas2j file using gradle")
String useGradle;
@Option(names = { "--use-gradle" }, defaultValue = "false", description = "executes the MAS defined in a mas2j file using gradle")
boolean useGradle;

@CommandLine.ParentCommand
protected MAS parent;
Expand Down Expand Up @@ -74,12 +74,16 @@ public void run() {
return;
}

if (!useGradle.isEmpty()) {
if (useGradle) {
if (mas2j.isEmpty()) {
parent.parent.errorMsg("a mas2j file should be informed. E.g., jason mas start --use-gradle --mas2j=t.mas2j");
return;
}
//if (JasonCLI.runningShell)
if (parent.parent.isTerminal())
new Thread(() -> new Run().run(useGradle, true)).start();
new Thread(() -> new Run().run(mas2j, true)).start();
else
new Run().run(useGradle, true);
new Run().run(mas2j, true);
return;
}

Expand Down

0 comments on commit 7bf0206

Please sign in to comment.