no message
This commit is contained in:
1
.idea/workspace.xml
generated
1
.idea/workspace.xml
generated
@@ -9,7 +9,6 @@
|
|||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforsBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforsBar.java" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ import Common.Current;
|
|||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.GlobalProperties;
|
import Common.GlobalProperties;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import ProjectData.LanguageName;
|
|
||||||
import Repository.RepositoryRefuseException;
|
|
||||||
import Repository.Server.ServerCode;
|
import Repository.Server.ServerCode;
|
||||||
import Repository.Server.ServerExchangeUnit_2021;
|
|
||||||
import TestingSystem.Common.TasksPackageState;
|
import TestingSystem.Common.TasksPackageState;
|
||||||
import TestingSystem.Common.TestingPlanner;
|
import TestingSystem.Common.TestingPlanner;
|
||||||
import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
|
import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
|
||||||
@@ -25,6 +22,20 @@ import java.util.Date;
|
|||||||
public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||||
File workspace;
|
File workspace;
|
||||||
ServerSapfor sapfor;
|
ServerSapfor sapfor;
|
||||||
|
//--
|
||||||
|
File repo;
|
||||||
|
File repoSapforHome;
|
||||||
|
File repo_bin;
|
||||||
|
File repo_out;
|
||||||
|
File repo_err;
|
||||||
|
//--
|
||||||
|
public SapforTestingPlanner() {
|
||||||
|
repo = new File(Global.Home, "Repo");
|
||||||
|
repoSapforHome = Paths.get(Global.Home, "Repo", Constants.SAPFOR_REPOSITORY_BIN).toFile();
|
||||||
|
repo_bin = new File(repoSapforHome, "Sapfor_F");
|
||||||
|
repo_out = new File(repoSapforHome, Constants.out_file);
|
||||||
|
repo_err = new File(repoSapforHome, Constants.err_file);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
protected ServerCode getActivePackagesCode() {
|
protected ServerCode getActivePackagesCode() {
|
||||||
return ServerCode.GetFirstActiveSapforPackages;
|
return ServerCode.GetFirstActiveSapforPackages;
|
||||||
@@ -149,28 +160,19 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
|||||||
//--
|
//--
|
||||||
@Override
|
@Override
|
||||||
public void perform() throws Exception {
|
public void perform() throws Exception {
|
||||||
compileSapfor();
|
checkServerSapforsForCompilation();
|
||||||
super.perform();
|
super.perform();
|
||||||
}
|
}
|
||||||
|
//--------------------
|
||||||
public void getServerSapforForCompilation() throws Exception {
|
public void getServerSapforForCompilation() throws Exception {
|
||||||
sapfor= (ServerSapfor) ServerCommand(ServerCode.GetSapforForCompilation);
|
sapfor = (ServerSapfor) ServerCommand(ServerCode.GetSapforForCompilation);
|
||||||
}
|
}
|
||||||
void UpdateSapforState(ServerSapforState state_in) throws Exception {
|
void UpdateSapforState(ServerSapforState state_in) throws Exception {
|
||||||
sapfor.state = state_in;
|
sapfor.state = state_in;
|
||||||
ServerCommand(ServerCode.EditObject, sapfor);
|
ServerCommand(ServerCode.EditObject, sapfor);
|
||||||
}
|
}
|
||||||
public void compileSapfor() throws Exception {
|
void SyncronizeRepository() throws Exception {
|
||||||
sapfor = null;
|
System.out.println("Синхронизация репозитория...");
|
||||||
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...");
|
System.out.println("Синхронизация ветви DVM...");
|
||||||
Utils.startScript(repo, repo, "dvm_checkout",
|
Utils.startScript(repo, repo, "dvm_checkout",
|
||||||
"svn checkout " +
|
"svn checkout " +
|
||||||
@@ -181,10 +183,17 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
|||||||
"svn checkout " +
|
"svn checkout " +
|
||||||
Constants.REPOSITORY_AUTHENTICATION +
|
Constants.REPOSITORY_AUTHENTICATION +
|
||||||
" " + Constants.SAPFOR_REPOSITORY + " 1>spf_out.txt 2>spf_err.txt\n").waitFor();
|
" " + Constants.SAPFOR_REPOSITORY + " 1>spf_out.txt 2>spf_err.txt\n").waitFor();
|
||||||
|
}
|
||||||
|
void CompileSapfor() throws Exception {
|
||||||
|
System.out.println("Сборка SAPFOR...");
|
||||||
|
//-
|
||||||
if (repo_bin.exists())
|
if (repo_bin.exists())
|
||||||
FileUtils.forceDelete(repo_bin);
|
FileUtils.forceDelete(repo_bin);
|
||||||
|
if (repo_out.exists())
|
||||||
|
FileUtils.forceDelete(repo_out);
|
||||||
|
if (repo_err.exists())
|
||||||
|
FileUtils.forceDelete(repo_err);
|
||||||
//--
|
//--
|
||||||
System.out.println("Сборка SAPFOR...");
|
|
||||||
Utils.startScript(repoSapforHome, repoSapforHome, "build_sapfor",
|
Utils.startScript(repoSapforHome, repoSapforHome, "build_sapfor",
|
||||||
"cmake ../ 1>" +
|
"cmake ../ 1>" +
|
||||||
Constants.out_file +
|
Constants.out_file +
|
||||||
@@ -195,58 +204,33 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
|||||||
" 2>>" +
|
" 2>>" +
|
||||||
Constants.err_file +
|
Constants.err_file +
|
||||||
"\n").waitFor();
|
"\n").waitFor();
|
||||||
//--
|
}
|
||||||
System.out.println("DONE");
|
//--------------------
|
||||||
System.out.println("Result file is " + Utils.Brackets(repo_bin.getAbsolutePath()));
|
public void checkServerSapforsForCompilation() throws Exception {
|
||||||
//---
|
sapfor = null;
|
||||||
System.out.println("Обработка результатов");
|
getServerSapforForCompilation();
|
||||||
//---
|
if (sapfor != null) {
|
||||||
File sapforsDirectory = new File(testingSystemHome, "Sapfors");
|
SyncronizeRepository();
|
||||||
File sapforHome = new File(sapforsDirectory, Utils.getDateName("sapfor"));
|
//-
|
||||||
sapforHome.mkdir();
|
File sapforHome = new File(Global.SapforsDirectory, Utils.getDateName("sapfor"));
|
||||||
|
File sapforBin = new File(sapforHome, "Sapfor_F");
|
||||||
File sapforOut = new File(sapforHome, Constants.out_file);
|
File sapforOut = new File(sapforHome, Constants.out_file);
|
||||||
File sapforErr = new File(sapforHome, Constants.err_file);
|
File sapforErr = new File(sapforHome, Constants.err_file);
|
||||||
//--
|
//-
|
||||||
System.out.println(repo_bin.getAbsolutePath());
|
CompileSapfor();
|
||||||
System.out.println(repo_out.getAbsolutePath());
|
sapforHome.mkdir();
|
||||||
System.out.println(repo_err.getAbsolutePath());
|
|
||||||
System.out.println("====================");
|
|
||||||
//--
|
//--
|
||||||
if (repo_out.exists())
|
if (repo_out.exists())
|
||||||
FileUtils.copyFile(repo_out, sapforOut);
|
FileUtils.copyFile(repo_out, sapforOut);
|
||||||
if (repo_err.exists())
|
if (repo_err.exists())
|
||||||
FileUtils.copyFile(repo_err, sapforErr);
|
FileUtils.copyFile(repo_err, sapforErr);
|
||||||
///-----
|
|
||||||
//---
|
|
||||||
if (repo_bin.exists()) {
|
if (repo_bin.exists()) {
|
||||||
System.out.println("assembly found!");
|
System.out.println("Сборка SAPFOR успешно выполнена");
|
||||||
// response = new ServerExchangeUnit_2021(ServerCode.OK);
|
|
||||||
//создать папку. Для того чтобы скопировать из репозитория.
|
|
||||||
File sapforBin = new File(sapforHome, "Sapfor_F");
|
|
||||||
FileUtils.copyFile(repo_bin, sapforBin);
|
FileUtils.copyFile(repo_bin, sapforBin);
|
||||||
sapforBin.setExecutable(true, false);
|
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);
|
UpdateSapforState(ServerSapforState.Done);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
else {
|
|
||||||
UpdateSapforState(ServerSapforState.DoneWithErrors);
|
UpdateSapforState(ServerSapforState.DoneWithErrors);
|
||||||
//---
|
|
||||||
// EmailSapforAssembly(current_version, false);
|
|
||||||
//---
|
|
||||||
// throw new RepositoryRefuseException("Бинарный файл SAPFOR не найден!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user