сборка компонент под юниксом через гит
This commit is contained in:
@@ -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("Сборка не найдена");
|
||||
|
||||
37
src/_VisualDVM/Passes/All/DownloadDvmRepository.java
Normal file
37
src/_VisualDVM/Passes/All/DownloadDvmRepository.java
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user