diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d9df7a53..ab08c069 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,9 +9,13 @@
-
-
+
+
+
+
+
+
diff --git a/properties b/properties
index ee5b0e03..ceae57af 100644
--- a/properties
+++ b/properties
@@ -30,9 +30,9 @@
"EmailOnTestingProgress": true,
"CompleteCompilationOptions": false,
"CompleteRunEnvironments": false,
- "lastMachineId": 28,
- "lastUserId": 36,
- "lastCompilerId": 110,
+ "lastMachineId": 1,
+ "lastUserId": 17,
+ "lastCompilerId": 15,
"RegisterOn": false,
"SpacesOn": false,
"EmptyLinesOn": false,
diff --git a/src/_VisualDVM/Constants.java b/src/_VisualDVM/Constants.java
index 6bd7b01e..3b28e688 100644
--- a/src/_VisualDVM/Constants.java
+++ b/src/_VisualDVM/Constants.java
@@ -26,11 +26,9 @@ public class Constants {
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
public static final String KeyDirectoryName = "Keys";
//--
- //SVN vmk-post@yandex.ru
- public static final String REPOSITORY_AUTHENTICATION = "--username dvmhuser --password dvmh2013 --non-interactive";
- public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm";
- public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
- public static final String SAPFOR_REPOSITORY_BIN = "/sapfor/experts/Sapfor_2017/_bin";
+ //GIT
+ public static final String SAPFOR_REPOSITORY = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR.git";
+ public static final String SAPFOR_VERSION_URL= "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR/raw/branch/master/src/Utils/version.h";
//-вывод задач
public final static String parse_out_file = "parse_out.txt";
public final static String parse_err_file = "parse_err.txt";
@@ -49,7 +47,7 @@ public class Constants {
//
//7998 отладочный порт. теперь.
public static final int ComponentsServerPort = 7995; //7795
- public static final int TestingServerPort = 7996; //7996
+ public static final int TestingServerPort = 7998; //7996
public static final int SocketTimeout = 0;
//-
public static final String ServerAddress = "alex-freenas.ddns.net";
@@ -469,8 +467,8 @@ public class Constants {
//
};
public static Vector admins_mails = new Vector_<>(
- "sapfor.tracker@internet.ru",
- "vmk-post@yandex.ru",
- "79854210702@ya.ru"
+ // "sapfor.tracker@internet.ru",
+ "vmk-post@yandex.ru"
+ // "79854210702@ya.ru"
);
}
diff --git a/src/_VisualDVM/Passes/All/DownloadRepository.java b/src/_VisualDVM/Passes/All/DownloadRepository.java
index 89626e4e..08dbf258 100644
--- a/src/_VisualDVM/Passes/All/DownloadRepository.java
+++ b/src/_VisualDVM/Passes/All/DownloadRepository.java
@@ -9,7 +9,6 @@ import org.apache.commons.io.FileUtils;
import java.io.File;
import java.nio.file.Paths;
public class DownloadRepository extends ProcessPass {
- File dvmHome;
File sapforHome;
@Override
public String getDescription() {
@@ -17,10 +16,8 @@ public class DownloadRepository extends ProcessPass {
}
@Override
protected boolean canStart(Object... args) throws Exception {
- dvmHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
- "dvm").toFile();
sapforHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
- "sapfor").toFile();
+ "SAPFOR").toFile();
return true;
}
private void synchronize(String src, File dst) throws Exception {
@@ -28,19 +25,17 @@ public class DownloadRepository extends ProcessPass {
if (loadedFile.exists()) {
PerformScript("cd " +
dst.getAbsolutePath() +
- "\nsvn update " + Constants.REPOSITORY_AUTHENTICATION + "\n");
+ "\ngit pull ");
} else {
Utils.CleanDirectory(dst);
- PerformScript("cd Repo\nsvn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + src + "\n"); //export
+ PerformScript("cd Repo\ngit clone " + src + "\n"); //export
FileUtils.write(loadedFile, "");
}
}
@Override
protected void body() throws Exception {
- ShowProgress(2, 0, true);
- synchronize(Constants.DVM_REPOSITORY, dvmHome);
- ShowProgress(2, 1, true);
+ ShowProgress(1, 0, true);
synchronize(Constants.SAPFOR_REPOSITORY, sapforHome);
- ShowProgress(2, 2, true);
+ ShowProgress(1, 1, true);
}
}
diff --git a/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java b/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java
index 5a66acb4..aa3f4f62 100644
--- a/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java
+++ b/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java
@@ -37,6 +37,7 @@ public class SPF_GetGraphLoops extends SapforAnalysis {
}
@Override
protected void unpack(String packed) throws Exception {
+ System.out.println(Utils_.Brackets(packed));
Vector done_programs = new Vector<>();
String[] splitedPackedGraph = packed.split("\\|");
for (int i = 0; i < splitedPackedGraph.length; i += 2) {
diff --git a/src/_VisualDVM/Repository/Server/ServerCode.java b/src/_VisualDVM/Repository/Server/ServerCode.java
index 5fbfc529..3aec6034 100644
--- a/src/_VisualDVM/Repository/Server/ServerCode.java
+++ b/src/_VisualDVM/Repository/Server/ServerCode.java
@@ -70,9 +70,12 @@ public enum ServerCode {
DeleteUserAccount,
GetDVMPackageCredentials,
CreateBackUp,
- GetFirstEmailToSend;
+ GetFirstEmailToSend,
+ SynchronizeSapforRepoitory;
public String getDescription(){
switch (this){
+ case SynchronizeSapforRepoitory:
+ return "Синхронизация репозитория SAPFOR на сервере";
case Email:
return "Создать сообщение электронной почты на сервере";
case GetFirstEmailToSend:
diff --git a/src/_VisualDVM/TestingSystem/Common/TestingServer.java b/src/_VisualDVM/TestingSystem/Common/TestingServer.java
index e66f77c9..ab2225d2 100644
--- a/src/_VisualDVM/TestingSystem/Common/TestingServer.java
+++ b/src/_VisualDVM/TestingSystem/Common/TestingServer.java
@@ -576,9 +576,9 @@ public class TestingServer extends RepositoryServer {
Utils.startScript(Global.TempDirectory,
Global.TempDirectory,
"get_version",
- "wget --user dvmhuser --password dvmh2013 -P " +
+ "wget -P " +
Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) +
- " http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h"
+ " " + Utils_.DQuotes(Constants.SAPFOR_VERSION_URL)
).waitFor();
if (!versionFile.exists())
throw new RepositoryRefuseException("Не удалось загрузить текущую версию SAPFOR из репозитория!");
@@ -592,11 +592,14 @@ public class TestingServer extends RepositoryServer {
int max_version = db.getInstalledSapforMaxVersion();
int current_version = getSapforActualVersion();
if (current_version > max_version) {
- serverSapfor = new ServerSapfor();
- serverSapfor.sender_name = "server";
- serverSapfor.sender_address = Constants.MailAddress;
- serverSapfor.state = ServerSapforState.Queued;
- db.Insert(serverSapfor);
+ ServerSapfor versionSapfor = db.getSapforForVersion(String.valueOf(current_version));
+ if (versionSapfor == null || !versionSapfor.state.equals(ServerSapforState.DoneWithErrors)) {
+ serverSapfor = new ServerSapfor();
+ serverSapfor.sender_name = "server";
+ serverSapfor.sender_address = Constants.MailAddress;
+ serverSapfor.state = ServerSapforState.Queued;
+ db.Insert(serverSapfor);
+ }
}
}
response.object = serverSapfor;
diff --git a/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java b/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java
index ece357a3..267a6f02 100644
--- a/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java
+++ b/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java
@@ -282,6 +282,13 @@ public class TestsDatabase extends SQLiteDatabase {
}
return null;
}
+ public ServerSapfor getSapforForVersion(String version_in){
+ for (ServerSapfor serverSapfor: serverSapfors.Data.values()){
+ if (serverSapfor.version.equals(version_in))
+ return serverSapfor;
+ }
+ return null;
+ }
public Integer getInstalledSapforMaxVersion() {
int max_version = CommonConstants.Nan;
for (ServerSapfor sapfor : serverSapfors.Data.values()) {
diff --git a/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java b/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java
index d937d07a..e46a3646 100644
--- a/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java
+++ b/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java
@@ -30,20 +30,23 @@ public class SapforTestingPlanner extends TestingPlanner {
ServerSapfor sapfor;
//--
File repo;
- File repoSapforHome;
+ File repo_sapfor;
+ File repo_sapfor_installation_directory;
int max_version;
int current_version;
//--
- File repo_bin;
+ File repo_sapfor_assembly; //бинарник собранный в репозитории.
File repo_out;
File repo_err;
//--
public SapforTestingPlanner() {
repo = new File(Utils_.getHomeDirectory(), "Repo");
- repoSapforHome = Paths.get(Utils_.getHomePath(), "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);
+ repo_sapfor = new File(repo, "SAPFOR");
+ //-
+ repo_sapfor_installation_directory =new File(repo_sapfor, "install");
+ repo_out = new File(repo_sapfor_installation_directory, Constants.out_file);
+ repo_err = new File(repo_sapfor_installation_directory, Constants.err_file);
+ repo_sapfor_assembly = new File(repo_sapfor_installation_directory, "Sapfor_F");
}
@Override
public String packageDescription() {
@@ -231,32 +234,20 @@ public class SapforTestingPlanner extends TestingPlanner {
ServerCommand(ServerCode.EditObject, sapfor);
}
void SyncronizeRepository() throws Exception {
- UpdateSapforState(ServerSapforState.DVMRepositorySynchronization);
- Utils.startScript(repo, repo, "dvm_checkout",
- "svn checkout " +
- Constants.REPOSITORY_AUTHENTICATION +
- " " + Constants.DVM_REPOSITORY + " 1>dvm_out.txt 2>dvm_err.txt\n").waitFor();
UpdateSapforState(ServerSapforState.SAPFORRepositorySynchronization);
- Utils.startScript(repo, repo, "spf_checkout",
- "svn checkout " +
- Constants.REPOSITORY_AUTHENTICATION +
- " " + Constants.SAPFOR_REPOSITORY + " 1>spf_out.txt 2>spf_err.txt\n").waitFor();
+ Utils.CleanDirectory(repo);
+ Utils.startScript(repo, repo, "git_clone",
+ "git clone " + Constants.SAPFOR_REPOSITORY + " " +
+ Utils_.DQuotes(repo_sapfor)+
+ " 1>spf_out.txt 2>spf_err.txt\n").waitFor();
}
void CompileSapfor() throws Exception {
UpdateSapforState(ServerSapforState.Compilation);
//-
- if (repo_bin.exists())
- FileUtils.forceDelete(repo_bin);
- if (repo_out.exists())
- FileUtils.forceDelete(repo_out);
- if (repo_err.exists())
- FileUtils.forceDelete(repo_err);
+ Utils_.CheckAndCleanDirectory(repo_sapfor_installation_directory);
//--
- Utils.startScript(repoSapforHome, repoSapforHome, "build_sapfor",
- "cmake ../ 1>" +
- Constants.out_file +
- " 2>" +
- Constants.err_file +
+ Utils.startScript(repo_sapfor_installation_directory, repo_sapfor_installation_directory, "build_sapfor",
+ "cmake .. 1>" + Constants.out_file + " 2>" + Constants.err_file +
"\nmake -j 14 1>>" +
Constants.out_file +
" 2>>" +
@@ -274,7 +265,8 @@ public class SapforTestingPlanner extends TestingPlanner {
//--
SyncronizeRepository();
max_version = (int) ServerCommand(ServerCode.GetMaxSapforVersion);
- current_version = Sapfor.readVersionFromCode(Paths.get(repo.getAbsolutePath(), "/sapfor/experts/Sapfor_2017/_src/Utils/version.h").toFile());
+ current_version = Sapfor.readVersionFromCode(Paths.get(repo.getAbsolutePath(),
+ "/SAPFOR/src/Utils/version.h").toFile());
if (current_version == max_version) {
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(ServerSapfor.class, sapfor.id));
return;
@@ -284,6 +276,7 @@ public class SapforTestingPlanner extends TestingPlanner {
//--
sapfor.home_path = sapforHome.getAbsolutePath();
sapfor.languageName = LanguageName.fortran;
+ sapfor.version = String.valueOf(current_version);
//--
File sapforBin = new File(sapforHome, "Sapfor_F");
File sapforOut = new File(sapforHome, Constants.out_file);
@@ -296,11 +289,11 @@ public class SapforTestingPlanner extends TestingPlanner {
FileUtils.copyFile(repo_out, sapforOut);
if (repo_err.exists())
FileUtils.copyFile(repo_err, sapforErr);
- if (repo_bin.exists()) {
- FileUtils.copyFile(repo_bin, sapforBin);
+ if (repo_sapfor_assembly.exists()) {
+ FileUtils.copyFile(repo_sapfor_assembly, sapforBin);
sapforBin.setExecutable(true, false);
//--
- sapfor.version = String.valueOf(current_version);
+
sapfor.call_command = sapforBin.getAbsolutePath();
sapfor.buildDate = new Date().getTime();
//--