no message
This commit is contained in:
@@ -242,31 +242,11 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
||||
}
|
||||
@Override
|
||||
protected boolean CheckModules() throws Exception {
|
||||
RemoteFile modulesDirectory = new RemoteFile(user.workspace, "modules");
|
||||
RemoteFile version = new RemoteFile(modulesDirectory, "version.h");
|
||||
int current_version = Constants.Nan;
|
||||
int actual_version = Constants.planner_version;
|
||||
if (user.connection.Exists(version)) {
|
||||
try {
|
||||
current_version = Integer.parseInt(user.connection.readFromFile(version));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (current_version < actual_version) {
|
||||
Print("Закачка кода модулей...");
|
||||
for (String resource_name : Constants.resourses_names) {
|
||||
Print(resource_name);
|
||||
user.connection.putResource(modulesDirectory, resource_name);
|
||||
}
|
||||
//--
|
||||
Print("Сборка модулей...");
|
||||
String modules_log = user.connection.compileModules(modulesDirectory);
|
||||
if (!modules_log.isEmpty()) {
|
||||
testingPackage.description = modules_log;
|
||||
testingPackage.state = TasksPackageState.Aborted;
|
||||
return false;
|
||||
}
|
||||
String log = user.connection.CheckModulesVersion();
|
||||
if (!log.isEmpty()) {
|
||||
testingPackage.description = log;
|
||||
testingPackage.state = TasksPackageState.Aborted;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package TestingSystem.DVM;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Machine.Machine;
|
||||
@@ -491,14 +490,14 @@ public class UserConnection {
|
||||
ShellDisconnect();
|
||||
return readFromFile(outFile).replace("\n", "").replace("\r", "");
|
||||
}
|
||||
//--
|
||||
//-- проверка существования рабочего пространства.
|
||||
public void CheckUserInitialization(String email) throws Exception {
|
||||
RemoteFile userWorkspace = new RemoteFile(user.workspace, true);
|
||||
if (!Exists(userWorkspace)){
|
||||
if (!Exists(userWorkspace)) {
|
||||
System.out.println("создание папки пользователя");
|
||||
sftpChannel.mkdir(userWorkspace.full_name);
|
||||
//--
|
||||
RemoteFile modulesDirectory= new RemoteFile(userWorkspace, "modules");
|
||||
RemoteFile modulesDirectory = new RemoteFile(userWorkspace, "modules");
|
||||
RemoteFile projectsDirectory = new RemoteFile(userWorkspace, "projects");
|
||||
RemoteFile testsDirectory = new RemoteFile(userWorkspace, "tests");
|
||||
//--
|
||||
@@ -525,4 +524,29 @@ public class UserConnection {
|
||||
user.connection.writeToFile("", info);
|
||||
}
|
||||
}
|
||||
}
|
||||
//--
|
||||
public String CheckModulesVersion() throws Exception {
|
||||
RemoteFile modulesDirectory = new RemoteFile(user.workspace, "modules");
|
||||
RemoteFile version = new RemoteFile(modulesDirectory, "version.h");
|
||||
int current_version = Constants.Nan;
|
||||
int actual_version = Constants.planner_version;
|
||||
if (Exists(version)) {
|
||||
try {
|
||||
current_version = Integer.parseInt(readFromFile(version));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (current_version < actual_version) {
|
||||
System.out.println("Закачка кода модулей...");
|
||||
for (String resource_name : Constants.resourses_names) {
|
||||
System.out.println(resource_name);
|
||||
putResource(modulesDirectory, resource_name);
|
||||
}
|
||||
//--
|
||||
System.out.println("Сборка модулей...");
|
||||
return compileModules(modulesDirectory);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user