Перенос.

This commit is contained in:
2023-09-17 22:13:42 +03:00
parent dd2e0ca7e0
commit 629d8b8477
1239 changed files with 61161 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.Utils.Utils;
import Repository.Component.Component;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.PassException;
import Visual_DVM_2021.Passes.ProcessPass;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
public class BuildComponent extends ProcessPass<Component> {
@Override
protected PassCode_2021 necessary() {
return PassCode_2021.DownloadRepository;
}
@Override
protected boolean resetsNecessary() {
return true;
}
@Override
protected boolean canStart(Object... args) throws Exception {
target = Current.getComponent();
return true;
}
@Override
protected void performPreparation() throws Exception {
Utils.forceDeleteWithCheck(target.getAssemblyFile());
}
@Override
protected void body() throws Exception {
ShowMessage1("Сборка " + target.getComponentType().getDescription());
PerformScript(target.getAssemblyCommand());
if (!target.getAssemblyFile().exists())
throw new PassException("Сборка не найдена");
Files.copy(target.getAssemblyFile().toPath(),
target.getNewFile().toPath(), StandardCopyOption.REPLACE_EXISTING);
if (!target.getNewFile().exists())
throw new PassException("Не удалось скопировать сборку для установки");
}
}