сборка компонент под юниксом через гит

This commit is contained in:
2025-03-12 21:47:54 +03:00
parent 8aea85a009
commit 8a6c9804b4
9 changed files with 70 additions and 22 deletions

View File

@@ -11,7 +11,7 @@ public class Sapfor_F extends Sapfor {
}
@Override
public String getAssemblyCommand() {
return "cd Repo/sapfor/experts/Sapfor_2017/_bin\n" +
return "cd Repo/SAPFOR/install\n" +
"cmake ../\n" +
"make -j 4\n";
}
@@ -19,7 +19,7 @@ public class Sapfor_F extends Sapfor {
public File getAssemblyFile() {
return Paths.get(
Global.RepoDirectory.getAbsolutePath(),
"sapfor/experts/Sapfor_2017/_bin/Sapfor_F").toFile();
"SAPFOR/install/Sapfor_F").toFile();
}
@Override
public String getUpdateCommand() {

View File

@@ -73,7 +73,7 @@ public class Visualizer_2 extends OSDComponent {
}
@Override
public String getAssemblyCommand() {
File src_home= Paths.get(Global.RepoDirectory.getAbsolutePath(),"/sapfor/experts/Sapfor_2017/_src/Server").toFile();
File src_home= Paths.get(Global.RepoDirectory.getAbsolutePath(),"SAPFOR/src/Server").toFile();
return "cd " +Utils_.DQuotes(src_home)+
"\n" +
"g++ -O3 -std=c++17 checkUniq.cpp server.cpp -o Visualizer_2 -lpthread -lstdc++fs\n";
@@ -82,7 +82,7 @@ public class Visualizer_2 extends OSDComponent {
public File getAssemblyFile() {
return Paths.get(
Global.RepoDirectory.getAbsolutePath(),
"sapfor/experts/Sapfor_2017/_src/Server/Visualizer_2").toFile();
"SAPFOR/src/Server/Visualizer_2").toFile();
}
public void Connect() throws Exception {
ClearLog();

View File

@@ -26,6 +26,9 @@ public class Constants {
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
public static final String KeyDirectoryName = "Keys";
//--
//SVN (пока оставить для тестов)
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";
//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";

View File

@@ -2,16 +2,18 @@ package _VisualDVM.Passes.All;
import Common.Passes.PassException;
import Common.Utils.Utils_;
import _VisualDVM.ComponentsServer.Component.Component;
import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.ProcessPass;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
public class BuildComponent extends ProcessPass<Component> {
@Override
protected PassCode necessary() {
return PassCode.DownloadRepository;
return PassCode.DownloadSapforRepository;
}
@Override
protected boolean resetsNecessary() {
@@ -29,6 +31,11 @@ public class BuildComponent extends ProcessPass<Component> {
@Override
protected void body() throws Exception {
ShowMessage1("Сборка " + target.getComponentType().getDescription());
if (target.getComponentType().equals(ComponentType.Sapfor_F)){
File RepoSapfor = new File(Global.RepoDirectory, "SAPFOR");
File installationDirectory = new File(RepoSapfor,"install");
Utils_.CheckAndCleanDirectory(installationDirectory);
}
PerformScript(target.getAssemblyCommand());
if (!target.getAssemblyFile().exists())
throw new PassException("Сборка не найдена");

View File

@@ -0,0 +1,37 @@
package _VisualDVM.Passes.All;
import Common.CommonConstants;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.Passes.ProcessPass;
import _VisualDVM.Utils;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.nio.file.Paths;
public class DownloadDvmRepository extends ProcessPass {
File dvmHome;
@Override
protected boolean canStart(Object... args) throws Exception {
dvmHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
"dvm").toFile();
return true;
}
private void synchronize(String src, File dst) throws Exception {
File loadedFile = Paths.get(dst.getAbsolutePath(), CommonConstants.LOADED).toFile();
if (loadedFile.exists()) {
PerformScript("cd " +
dst.getAbsolutePath() +
"\nsvn update " + Constants.REPOSITORY_AUTHENTICATION + "\n");
} else {
Utils.CleanDirectory(dst);
PerformScript("cd Repo\nsvn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + src + "\n"); //export
FileUtils.write(loadedFile, "");
}
}
@Override
protected void body() throws Exception {
ShowProgress(1, 0, true);
synchronize(Constants.DVM_REPOSITORY, dvmHome);
ShowProgress(1, 1, true);
}
}

View File

@@ -8,7 +8,7 @@ import org.apache.commons.io.FileUtils;
import java.io.File;
import java.nio.file.Paths;
public class DownloadRepository extends ProcessPass {
public class DownloadSapforRepository extends ProcessPass {
File sapforHome;
@Override
public String getDescription() {
@@ -23,8 +23,7 @@ public class DownloadRepository extends ProcessPass {
private void synchronize(String src, File dst) throws Exception {
File loadedFile = Paths.get(dst.getAbsolutePath(), CommonConstants.LOADED).toFile();
if (loadedFile.exists()) {
PerformScript("cd " +
dst.getAbsolutePath() +
PerformScript("cd " + dst.getAbsolutePath() +
"\ngit pull ");
} else {
Utils.CleanDirectory(dst);

View File

@@ -1,7 +1,6 @@
package _VisualDVM.Passes;
import Common.Passes.PassCode_;
public enum PassCode implements PassCode_ {
//-
UpdateProperty,
UpdateSapforProperty,
ShowAllParallelVariants,
@@ -132,7 +131,8 @@ public enum PassCode implements PassCode_ {
ShowComponentChangesLog,
UpdateComponent,
BuildComponent,
DownloadRepository,
DownloadSapforRepository,
DownloadDvmRepository,
SaveGraph,
ApplyBugReportSettings,
DownloadBugReport,
@@ -789,8 +789,10 @@ public enum PassCode implements PassCode_ {
return "Обновление компонента";
case BuildComponent:
return "Сборка компонента";
case DownloadRepository:
return "Загрузка репозитория";
case DownloadSapforRepository:
return "Загрузка репозитория SAPFOR";
case DownloadDvmRepository:
return "Загрузка репозитория DVM";
case SaveGraph:
return "Сделать скриншот графа функций";
case ApplyBugReportSettings:

View File

@@ -12,7 +12,7 @@ import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Tasks.TaskState;
import _VisualDVM.Passes.All.DownloadRepository;
import _VisualDVM.Passes.All.DownloadDvmRepository;
import _VisualDVM.Passes.All.ZipFolderPass;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.Files.ProjectFile;
@@ -350,7 +350,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
void RefreshDVMTests() throws Exception {
UserAccount account = new UserAccount("server", Constants.MailAddress);
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
DownloadRepository downloadRepository = new DownloadRepository();
DownloadDvmRepository downloadRepository = new DownloadDvmRepository();
if (!downloadRepository.Do())
throw new RepositoryRefuseException("Не удалось обновить репозиторий");
//-->>