промежуточный. проверка версии сапфора при асинхроноой сборке, из репозитория. Завтра доделаю и закоммичу

This commit is contained in:
2024-05-16 01:26:03 +03:00
parent 8a4371fc86
commit 630d6b3985
5 changed files with 88 additions and 43 deletions

View File

@@ -5,6 +5,7 @@ import Common.Global;
import Common.GlobalProperties;
import Common.Utils.Utils;
import ProjectData.LanguageName;
import Repository.Component.Sapfor.Sapfor;
import Repository.RepositoryRefuseException;
import Repository.Server.ServerCode;
import TestingSystem.Common.TasksPackageState;
@@ -213,28 +214,6 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
Constants.err_file +
"\n").waitFor();
}
int getSapforRepositoryVersion() throws Exception {
int res = Constants.Nan;
File versionFile = Paths.get(repo.getAbsolutePath(), "/sapfor/experts/Sapfor_2017/_src/Utils/version.h").toFile();
if (versionFile.exists()) {
List<String> data = FileUtils.readLines(versionFile);
for (String s : data) {
if (s.startsWith("#define VERSION_SPF ")) {
String[] version_data = s.split("\"");
if (version_data.length > 0) {
String version_s = version_data[1];
//-
try {
res = Integer.parseInt(version_s);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
}
}
return res;
}
//--------------------
public void checkServerSapforsForCompilation() throws Exception {
sapfor = null;
@@ -246,7 +225,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
//--
SyncronizeRepository();
max_version = (int) ServerCommand(ServerCode.GetMaxSapforVersion);
current_version = getSapforRepositoryVersion();
current_version = Sapfor.readVersionFromCode(Paths.get(repo.getAbsolutePath(), "/sapfor/experts/Sapfor_2017/_src/Utils/version.h").toFile());
if (current_version==max_version){
System.out.println("Версия SAPFOR " + max_version + " уже собрана!");
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(ServerSapfor.class,sapfor.id));