no message
This commit is contained in:
@@ -4,6 +4,7 @@ import Common.Utils.Utils;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
import Visual_DVM_2021.Passes.SSH.ConnectionPass_2023;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Vector;
|
||||
@@ -26,10 +27,10 @@ public class RemoteInitialiseUser extends ConnectionPass_2023<RemoteFile> {
|
||||
void put_resource(String res_name, RemoteFile dst_directory) throws Exception {
|
||||
user.connection.putSingleFile(Utils.CreateTempResourceFile(res_name), new RemoteFile(dst_directory, res_name));
|
||||
}
|
||||
void compileModule(String module_name) throws Exception{
|
||||
user.connection.performScript(modulesDirectory,
|
||||
"g++ " +
|
||||
Utils.DQuotes(module_name + ".cpp") + " -o "+ Utils.DQuotes(module_name));
|
||||
void compileModule(String module_name, String flags) throws Exception{
|
||||
String command = "g++ " + flags+" "+ Utils.DQuotes(module_name + ".cpp") + " -o "+ Utils.DQuotes(module_name);
|
||||
ShowMessage2(command);
|
||||
user.connection.performScript(modulesDirectory, command);
|
||||
RemoteFile binary = new RemoteFile(modulesDirectory, module_name);
|
||||
if (!user.connection.Exists(binary)){
|
||||
throw new PassException("Не удалось собрать модуль "+Utils.Brackets(module_name));
|
||||
@@ -37,6 +38,14 @@ public class RemoteInitialiseUser extends ConnectionPass_2023<RemoteFile> {
|
||||
user.connection.sftpChannel.chmod(0777, binary.full_name);
|
||||
}
|
||||
}
|
||||
String getPlannerFlags() throws Exception{
|
||||
String command = "g++ -v --help 2> /dev/null | sed -n '/^ *-std=\\([^<][^ ]\\+\\).*/ {s//\\1/p}' | grep c++";
|
||||
System.out.println(command);
|
||||
Pair<RemoteFile, RemoteFile> res = user.connection.performScript(modulesDirectory, command);
|
||||
RemoteFile out = res.getKey();
|
||||
System.out.println(user.connection.readFromFile(out));
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
String workspace_name = Utils.getDateName("visual_sapfor_workspace");
|
||||
@@ -71,7 +80,7 @@ public class RemoteInitialiseUser extends ConnectionPass_2023<RemoteFile> {
|
||||
"Text.h",
|
||||
"Utils.h"
|
||||
};
|
||||
ShowMessage1("Закачка модулей...");
|
||||
ShowMessage1("Закачка кода модулей...");
|
||||
for (String resource_name : resourses_names) {
|
||||
ShowMessage2(resource_name);
|
||||
File src = Utils.CreateTempResourceFile(resource_name);
|
||||
@@ -80,15 +89,10 @@ public class RemoteInitialiseUser extends ConnectionPass_2023<RemoteFile> {
|
||||
}
|
||||
//-------------------------------------
|
||||
ShowMessage1("Сборка модулей...");
|
||||
String [] modules_names = new String[]{
|
||||
"launcher",
|
||||
"starter",
|
||||
"planner"
|
||||
};
|
||||
for (String module_name: modules_names){
|
||||
ShowMessage2(module_name);
|
||||
compileModule(module_name);
|
||||
}
|
||||
compileModule("launcher","");
|
||||
compileModule("starter","");
|
||||
getPlannerFlags();
|
||||
//compileModule("planner", getPlannerFlags());
|
||||
/*
|
||||
|
||||
//канал на исполнение независим, поэтому переход в папку отдельный
|
||||
|
||||
Reference in New Issue
Block a user