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

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

16
.idea/workspace.xml generated
View File

@@ -7,15 +7,15 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadDvmRepository.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Sapfor/Sapfor_F.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Sapfor/Sapfor_F.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Visualizer_2.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Visualizer_2.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadRepository.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/BuildComponent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/BuildComponent.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadSapforRepository.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -94,7 +94,7 @@
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" />
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="509" />
<property name="extract.method.default.visibility" value="public" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/icons" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/_VisualDVM/Passes/All" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.27322906" />
@@ -107,11 +107,11 @@
<recent name="controls.Trees" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\_VisualDVM\Passes\All" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\versions" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\libs" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\icons\Transformations" />
<recent name="C:\Users\misha\Documents\visual_sapfor_2023\src\Common\icons" />
</key>
<key name="MoveMembersDialog.RECENTS_KEY">
<recent name="_VisualDVM.ComponentsServer.Component.Sapfor.Sapfor" />

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("Не удалось обновить репозиторий");
//-->>