Skip to content
Snippets Groups Projects
Commit 6461faf4 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Async exec for executing the deploy script.


Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent e7b920de
No related branches found
No related tags found
No related merge requests found
SSHDeploymentGeneratorEasyStartMenu.java 542428f44fe8d3686265887fa3ae8602e52b2d04 YELLOW
SSHDeploymentGeneratorExecutionTarget.java 4f148980269e30d34502c758e331ae7ac8f8f09b YELLOW
SSHDeploymentGeneratorExecutionTarget.java 24096492dd3d358fcd721a0dfec26d46ef2e0705 YELLOW
......@@ -19,6 +19,7 @@ import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import java.io.IOException;
import org.eclipse.swt.widgets.Display;
import org.fortiss.af3.deployment.ui.generator.DeploymentGeneratorExecutionTarget;
import org.fortiss.af3.platform.modelsconference.ui.AF3PlatformModelsConferencUIActivator;
import org.fortiss.af3.project.extension.data.Executable;
......@@ -36,19 +37,28 @@ public class SSHDeploymentGeneratorExecutionTarget extends DeploymentGeneratorEx
Runtime r = Runtime.getRuntime();
int retCode = -1;
try {
Process p = r.exec("deploy");
retCode = p.waitFor();
} catch(IOException e) {
e.printStackTrace();
} catch(InterruptedException e) {
e.printStackTrace();
}
if(retCode != 0) {
error(AF3PlatformModelsConferencUIActivator.getDefault(),
"Generated code could not be deployed.");
}
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
Process p;
int retCode = -1;
try {
p = r.exec("deploy");
retCode = p.waitFor();
} catch(InterruptedException e) {
error(AF3PlatformModelsConferencUIActivator.getDefault(),
"InterruptedException when deploying:\n" + e);
} catch(IOException e) {
error(AF3PlatformModelsConferencUIActivator.getDefault(),
"IOException when deploying:\n" + e);
}
if(retCode != 0) {
error(AF3PlatformModelsConferencUIActivator.getDefault(),
"Generated code could not be deployed.");
}
}
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment