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

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

@@ -0,0 +1,40 @@
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 DownloadSapforRepository extends ProcessPass {
File sapforHome;
@Override
public String getDescription() {
return "Загрузка репозитория";
}
@Override
protected boolean canStart(Object... args) throws Exception {
sapforHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
"SAPFOR").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() +
"\ngit pull ");
} else {
Utils.CleanDirectory(dst);
PerformScript("cd Repo\ngit clone " + src + "\n"); //export
FileUtils.write(loadedFile, "");
}
}
@Override
protected void body() throws Exception {
ShowProgress(1, 0, true);
synchronize(Constants.SAPFOR_REPOSITORY, sapforHome);
ShowProgress(1, 1, true);
}
}