no message
This commit is contained in:
@@ -4,7 +4,10 @@ import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.GlobalProperties;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.LanguageName;
|
||||
import Repository.RepositoryRefuseException;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.TestingPlanner;
|
||||
import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
|
||||
@@ -12,10 +15,12 @@ import TestingSystem.SAPFOR.Json.SapforTest_json;
|
||||
import TestingSystem.SAPFOR.Json.SapforTestingSet_json;
|
||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
import TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
File workspace;
|
||||
@@ -144,17 +149,105 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
//--
|
||||
@Override
|
||||
public void perform() throws Exception {
|
||||
compileSapfors();
|
||||
compileSapfor();
|
||||
super.perform();
|
||||
}
|
||||
public void getServerSapforForCompilation() throws Exception {
|
||||
sapfor= (ServerSapfor) ServerCommand(ServerCode.GetSapforForCompilation);
|
||||
}
|
||||
public void compileSapfors() throws Exception {
|
||||
void UpdateSapforState(ServerSapforState state_in) throws Exception {
|
||||
sapfor.state = state_in;
|
||||
ServerCommand(ServerCode.EditObject, sapfor);
|
||||
}
|
||||
public void compileSapfor() throws Exception {
|
||||
sapfor = null;
|
||||
getServerSapforForCompilation();
|
||||
if (sapfor != null) {
|
||||
//--
|
||||
File testingSystemHome = new File(Global.Home);
|
||||
File repo = new File(testingSystemHome, "Repo");
|
||||
File repoSapforHome = Paths.get(repo.getAbsolutePath(), Constants.SAPFOR_REPOSITORY_BIN).toFile();
|
||||
File repo_bin = new File(repoSapforHome, "Sapfor_F");
|
||||
File repo_out = new File(repoSapforHome, Constants.out_file);
|
||||
File repo_err = new File(repoSapforHome, Constants.err_file);
|
||||
//--
|
||||
System.out.println("Синхронизация ветви DVM...");
|
||||
Utils.startScript(repo, repo, "dvm_checkout",
|
||||
"svn checkout " +
|
||||
Constants.REPOSITORY_AUTHENTICATION +
|
||||
" " + Constants.DVM_REPOSITORY + " 1>dvm_out.txt 2>dvm_err.txt\n").waitFor();
|
||||
System.out.println("Синхронизация ветви SAPFOR...");
|
||||
Utils.startScript(repo, repo, "spf_checkout",
|
||||
"svn checkout " +
|
||||
Constants.REPOSITORY_AUTHENTICATION +
|
||||
" " + Constants.SAPFOR_REPOSITORY + " 1>spf_out.txt 2>spf_err.txt\n").waitFor();
|
||||
if (repo_bin.exists())
|
||||
FileUtils.forceDelete(repo_bin);
|
||||
//--
|
||||
System.out.println("Сборка SAPFOR...");
|
||||
Utils.startScript(repoSapforHome, repoSapforHome, "build_sapfor",
|
||||
"cmake ../ 1>" +
|
||||
Constants.out_file +
|
||||
" 2>" +
|
||||
Constants.err_file +
|
||||
"\nmake -j 14 1>>" +
|
||||
Constants.out_file +
|
||||
" 2>>" +
|
||||
Constants.err_file +
|
||||
"\n").waitFor();
|
||||
//--
|
||||
System.out.println("DONE");
|
||||
System.out.println("Result file is " + Utils.Brackets(repo_bin.getAbsolutePath()));
|
||||
//---
|
||||
System.out.println("Обработка результатов");
|
||||
//---
|
||||
File sapforsDirectory = new File(testingSystemHome, "Sapfors");
|
||||
File sapforHome = new File(sapforsDirectory, Utils.getDateName("sapfor"));
|
||||
sapforHome.mkdir();
|
||||
File sapforOut = new File(sapforHome, Constants.out_file);
|
||||
File sapforErr = new File(sapforHome, Constants.err_file);
|
||||
//--
|
||||
System.out.println(repo_bin.getAbsolutePath());
|
||||
System.out.println(repo_out.getAbsolutePath());
|
||||
System.out.println(repo_err.getAbsolutePath());
|
||||
System.out.println("====================");
|
||||
//--
|
||||
if (repo_out.exists())
|
||||
FileUtils.copyFile(repo_out, sapforOut);
|
||||
if (repo_err.exists())
|
||||
FileUtils.copyFile(repo_err, sapforErr);
|
||||
///-----
|
||||
//---
|
||||
if (repo_bin.exists()) {
|
||||
System.out.println("assembly found!");
|
||||
// response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
//создать папку. Для того чтобы скопировать из репозитория.
|
||||
File sapforBin = new File(sapforHome, "Sapfor_F");
|
||||
FileUtils.copyFile(repo_bin, sapforBin);
|
||||
sapforBin.setExecutable(true, false);
|
||||
// //-->>>
|
||||
/*
|
||||
ServerSapfor serverSapfor = new ServerSapfor();
|
||||
serverSapfor.home_path = sapforHome.getAbsolutePath();
|
||||
serverSapfor.call_command = sapforBin.getAbsolutePath();
|
||||
serverSapfor.languageName = LanguageName.fortran;
|
||||
serverSapfor.buildDate = new Date().getTime();
|
||||
response.object = serverSapfor;
|
||||
serverSapfor.version = String.valueOf(current_version);
|
||||
*/
|
||||
//---
|
||||
// EmailSapforAssembly(current_version, true);
|
||||
//---
|
||||
UpdateSapforState(ServerSapforState.Done);
|
||||
}
|
||||
|
||||
else {
|
||||
UpdateSapforState(ServerSapforState.DoneWithErrors);
|
||||
//---
|
||||
// EmailSapforAssembly(current_version, false);
|
||||
//---
|
||||
// throw new RepositoryRefuseException("Бинарный файл SAPFOR не найден!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@ import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class ServerSapforsBar extends DataMenuBar {
|
||||
public ServerSapforsBar() {
|
||||
super("версии SAPFOR",
|
||||
PassCode_2021.CompileServerSapfor
|
||||
// PassCode_2021.InstallServerSapfor, PassCode_2021.DeleteServerSapfor
|
||||
PassCode_2021.CompileServerSapfor,
|
||||
// PassCode_2021.InstallServerSapfor,
|
||||
PassCode_2021.DeleteServerSapfor
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user