no message
This commit is contained in:
@@ -71,7 +71,7 @@ public class AddBugReport extends AddObjectPass<BugReport> {
|
||||
//логи во вложения.
|
||||
File attachementsDir = Current.getProject().getAttachmentsDirectory();
|
||||
Vector<File> logs = new Vector<>();
|
||||
logs.add(Global.Log.getLogFile());
|
||||
logs.add(CommonUtils.MainLog.getLogFile());
|
||||
logs.add(Paths.get(Global.ComponentsDirectory.getAbsolutePath(), "Sapfor_log.txt").toFile());
|
||||
logs.add(Paths.get(Global.ComponentsDirectory.getAbsolutePath(), "Server_log.txt").toFile());
|
||||
logs.add(Global.Components.get(ComponentType.Visualizer_2).getLogFile());
|
||||
|
||||
@@ -29,10 +29,10 @@ public class AddFile extends ChangeFilePass<DBProjectFile> {
|
||||
Log.Writeln_("Имя файла " + CommonUtils.Brackets(fileName) + " содержит кириллицу.");
|
||||
return false;
|
||||
}
|
||||
if (Utils.ContainsForbiddenName(fileName)) {
|
||||
if (CommonUtils.ContainsForbiddenName(fileName)) {
|
||||
Log.Writeln_("Имя файла " + CommonUtils.Brackets(fileName)
|
||||
+ " содержит запрещенные символы." +
|
||||
"\n" + Constants.all_forbidden_characters_string);
|
||||
"\n" + CommonUtils.printAllForbiddenCharacters());
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,6 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.Utils.Utils;
|
||||
import Repository.BugReport.BugReport;
|
||||
import Repository.BugReport.BugReportInterface;
|
||||
import Repository.EmailMessage;
|
||||
@@ -50,7 +49,7 @@ public class AppendBugReportField extends ComponentsRepositoryPass<BugReport> {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.GetObjectCopyByPK, "", new Pair<>(BugReport.class, target.id)));
|
||||
target.SynchronizeFields((BugReport) response.object);
|
||||
oldValue = (String) BugReport.class.getField(fieldName).get(target);
|
||||
newValue = oldValue + "\n" + CommonUtils.Brackets(Utils.print_date(
|
||||
newValue = oldValue + "\n" + CommonUtils.Brackets(CommonUtils.print_date(
|
||||
new Date())) + " " + Current.getAccount().name
|
||||
+ " : " + addition;
|
||||
//2. дописываем нужное поле.
|
||||
|
||||
@@ -40,7 +40,7 @@ public class CloseCurrentProject extends Pass_2021<db_project_info> {
|
||||
Global.files_multiselection = false;
|
||||
//--
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getSapfor().cd(new File(Global.Home));
|
||||
Current.getSapfor().cd(new File(CommonUtils.Home));
|
||||
Current.set(Current.Project, null);
|
||||
Current.set(Current.File, null);
|
||||
Current.set(Current.Function, null);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CloseProject extends Pass_2021<db_project_info> {
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Current.getSapfor().ResetAllAnalyses();
|
||||
Current.getSapfor().cd(new File(Global.Home));
|
||||
Current.getSapfor().cd(new File(CommonUtils.Home));
|
||||
Current.set(Current.Project, null);
|
||||
//-
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CombineFiles extends Transformation {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
result = Paths.get(target.last_version.Home.getAbsolutePath(),
|
||||
Global.isWindows ? fd.Result : CommonUtils.toU(fd.Result)).toFile();
|
||||
CommonUtils.isWindows ? fd.Result : CommonUtils.toU(fd.Result)).toFile();
|
||||
//-----------------------
|
||||
//получить список хедеров.
|
||||
//-----------------------
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Compile extends Pass_2021<db_project_info> {
|
||||
|
||||
switch (Current.getMachine().type) {
|
||||
case Local:
|
||||
if (Global.isWindows) {
|
||||
if (CommonUtils.isWindows) {
|
||||
subpass = passes.get(PassCode_2021.WindowsLocalCompilation);
|
||||
} else
|
||||
subpass = passes.get(PassCode_2021.LinuxLocalCompilation);
|
||||
|
||||
@@ -43,7 +43,9 @@ public class CreateGroupFromDirectory extends PublishTests {
|
||||
return false;
|
||||
}
|
||||
if (!Utils.validateProjectFile(dir, Log)) {
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName())
|
||||
+ " содержит запрещённые символы " +
|
||||
CommonUtils.printAllForbiddenCharacters() + ", или кириллицу.");
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
|
||||
@@ -39,7 +39,9 @@ public class CreateGroupFromFiles extends PublishTests{
|
||||
return false;
|
||||
}
|
||||
if (!Utils.validateProjectFile(dir, Log)) {
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName())
|
||||
+ " содержит запрещённые символы "
|
||||
+ CommonUtils.printAllForbiddenCharacters() + ", или кириллицу.");
|
||||
return false;
|
||||
}
|
||||
if (passes.get(PassCode_2021.PublishGroup).Do(dir.getName().toUpperCase())) {
|
||||
|
||||
@@ -94,8 +94,10 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
if (CommonUtils.ContainsCyrillic(dir.getName()) || Utils.ContainsForbiddenName(dir.getName())) {
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
|
||||
if (CommonUtils.ContainsCyrillic(dir.getName()) || CommonUtils.ContainsForbiddenName(dir.getName())) {
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName())
|
||||
+ " содержит запрещённые символы "
|
||||
+ CommonUtils.printAllForbiddenCharacters() + ", или кириллицу.");
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
@@ -114,7 +116,7 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
|
||||
!Utils.isVersion(file)) {
|
||||
subdirs++;
|
||||
}
|
||||
} else if (file.isFile() && !CommonUtils.ContainsCyrillic(file.getName()) && !Utils.ContainsForbiddenName(file.getName())) {
|
||||
} else if (file.isFile() && !CommonUtils.ContainsCyrillic(file.getName()) && !CommonUtils.ContainsForbiddenName(file.getName())) {
|
||||
//если файл. все недопустимые файлы просто игнорируются.
|
||||
ProjectFile projectFile = new ProjectFile(file);
|
||||
if (isNotExcluded(projectFile)) {
|
||||
@@ -187,7 +189,7 @@ public class CreateTestFromDirectory extends Pass_2021<Test> {
|
||||
//--
|
||||
ZipFolderPass zip = new ZipFolderPass();
|
||||
if (zip.Do(tempProject.getAbsolutePath(), tempArchive.getAbsolutePath())) {
|
||||
target.project_archive_bytes = Utils.packFile(tempArchive);
|
||||
target.project_archive_bytes = CommonUtils.fileToBytes(tempArchive);
|
||||
} else throw new PassException("Не удалось создать архив папки с кодом.");
|
||||
return tempProject;
|
||||
}
|
||||
|
||||
@@ -37,8 +37,10 @@ public class CreateTestFromFile extends Pass_2021<Test> {
|
||||
File file_in = (File) args[0];
|
||||
group = (Group) args[1];
|
||||
//--
|
||||
if (CommonUtils.ContainsCyrillic(file_in.getName()) || Utils.ContainsForbiddenName(file_in.getName())) {
|
||||
Log.Writeln_("Имя файла " + CommonUtils.Brackets(file_in.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
|
||||
if (CommonUtils.ContainsCyrillic(file_in.getName()) || CommonUtils.ContainsForbiddenName(file_in.getName())) {
|
||||
Log.Writeln_("Имя файла " + CommonUtils.Brackets(file_in.getName())
|
||||
+ " содержит запрещённые символы " +
|
||||
CommonUtils.printAllForbiddenCharacters() + ", или кириллицу.");
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
@@ -72,7 +74,7 @@ public class CreateTestFromFile extends Pass_2021<Test> {
|
||||
//--
|
||||
ZipFolderPass zip = new ZipFolderPass();
|
||||
if (zip.Do(tempProject.getAbsolutePath(), tempArchive.getAbsolutePath())) {
|
||||
target.project_archive_bytes = Utils.packFile(tempArchive);
|
||||
target.project_archive_bytes = CommonUtils.fileToBytes(tempArchive);
|
||||
} else throw new PassException("Не удалось создать архив папки с кодом.");
|
||||
return tempProject;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class DVMConvertProject extends ComponentsRepositoryPass<db_project_info>
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
ServerExchangeUnit_2021 unit = new ServerExchangeUnit_2021(ServerCode.DVMConvertProject);
|
||||
unit.object = Utils.packFile(archive);
|
||||
unit.object = CommonUtils.fileToBytes(archive);
|
||||
Vector<String> unit_args = new Vector<>();
|
||||
unit_args.add(target.name);
|
||||
unit_args.add(target.languageName.toString());
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import Repository.BugReport.BugReport;
|
||||
@@ -21,7 +22,7 @@ public class DownloadBugReport extends ComponentsRepositoryPass<BugReport> {
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveBugReport, target.id));
|
||||
Utils.unpackFile((byte[]) response.object, BugReportInterface.getArchiveFile(target));
|
||||
CommonUtils.bytesToFile((byte[]) response.object, BugReportInterface.getArchiveFile(target));
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.Utils.Utils;
|
||||
import Repository.Component.Component;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
@@ -11,6 +11,6 @@ public class DownloadComponent extends ComponentsRepositoryPass<Component> {
|
||||
target = Current.getComponent();
|
||||
String packed = target.getComponentType()+"\n"+target.getFileName();
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveComponent, packed));
|
||||
Utils.unpackFile((byte[]) response.object, target.getNewFile());
|
||||
CommonUtils.bytesToFile((byte[]) response.object, target.getNewFile());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
@@ -66,8 +67,8 @@ public class DownloadDVMPackages extends Pass_2021<Vector<Integer>> {
|
||||
File loaded = new File(workspace, Constants.LOADED);
|
||||
Pair<byte[], byte[]> packed_package = p.getValue();
|
||||
//---
|
||||
Utils.unpackFile(packed_package.getKey(), results_zip);
|
||||
Utils.unpackFile(packed_package.getValue(), dvmPackage.getJsonFile());
|
||||
CommonUtils.bytesToFile(packed_package.getKey(), results_zip);
|
||||
CommonUtils.bytesToFile(packed_package.getValue(), dvmPackage.getJsonFile());
|
||||
passes.get(PassCode_2021.UnzipFolderPass).Do(results_zip.getAbsolutePath(), workspace.getAbsolutePath());
|
||||
FileUtils.writeStringToFile(loaded, new Date().toString());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
@@ -49,7 +50,7 @@ public class DownloadSapforPackage extends Pass_2021<SapforPackage> {
|
||||
File workspace = target.getLocalWorkspace();
|
||||
Utils.forceDeleteWithCheck(workspace);
|
||||
File archive = Utils.getTempFileName(String.valueOf(target.id));
|
||||
Utils.unpackFile(packed,archive);
|
||||
CommonUtils.bytesToFile(packed,archive);
|
||||
passes.get(PassCode_2021.UnzipFolderPass).Do(archive.getAbsolutePath(), Global.SapforPackagesDirectory.getAbsolutePath());
|
||||
FileUtils.writeStringToFile(loaded, new Date().toString());
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.Utils.Utils;
|
||||
import Repository.EmailMessage;
|
||||
import Repository.Subscribes.Subscriber;
|
||||
import Repository.Subscribes.UI.SubscriberForm;
|
||||
@@ -26,7 +25,7 @@ public class EditAccount extends Email {
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
Subscriber res = new Subscriber(); // объект для заполнения полей.не более.
|
||||
if (f.ShowDialog("Регистрация", res)) {
|
||||
if (!Utils.validateEmail(res.address, Log)) {
|
||||
if (!CommonUtils.validateEmail(res.address, Log)) {
|
||||
return false;
|
||||
}
|
||||
name = res.name;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import _VisualDVM.Global;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import Visual_DVM_2021.Passes.Transformation;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
@@ -20,7 +19,7 @@ public class EraseBadSymbols extends Transformation {
|
||||
res_text.append(CommonUtils.Translit(c));
|
||||
else res_text.append(' ');
|
||||
}
|
||||
File dst = Paths.get(target.last_version.Home.getAbsolutePath(), Global.isWindows ? file.name : file.name.replace('\\', '/')).toFile();
|
||||
File dst = Paths.get(target.last_version.Home.getAbsolutePath(), CommonUtils.isWindows ? file.name : file.name.replace('\\', '/')).toFile();
|
||||
FileUtils.write(dst, res_text.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Module.Module;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
@@ -17,7 +16,7 @@ public class GCOV extends Precompilation {
|
||||
return new File(workspace, getBinaryName());
|
||||
}
|
||||
protected String getBinaryName() {
|
||||
return Global.isWindows ? "0.exe" : "0";
|
||||
return CommonUtils.isWindows ? "0.exe" : "0";
|
||||
}
|
||||
@Override
|
||||
public boolean needsConfirmations() {
|
||||
@@ -68,7 +67,7 @@ public class GCOV extends Precompilation {
|
||||
if (getBinary().exists()) {
|
||||
ShowMessage1("Запуск для GCOV");
|
||||
name_to_kill = "0.exe";
|
||||
StartProcess(Global.isWindows?"0.exe":"./0", target.run_maxtime);
|
||||
StartProcess(CommonUtils.isWindows?"0.exe":"./0", target.run_maxtime);
|
||||
target.updateRunOut(output);
|
||||
} else {
|
||||
Log.Writeln_("Не удалось собрать проект.");
|
||||
@@ -94,7 +93,7 @@ public class GCOV extends Precompilation {
|
||||
target.db.Update(file);
|
||||
File targetGcov = Paths.get(
|
||||
target.getGCOVDirectory().getAbsolutePath(),
|
||||
(Global.isWindows?file.name:file.getUnixName()) + ".gcov").toFile();
|
||||
(CommonUtils.isWindows?file.name:file.getUnixName()) + ".gcov").toFile();
|
||||
Files.copy(gcov.toPath(), targetGcov.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ public class LocalInitaliseUser extends ProcessPass<User> {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
File workspace = Paths.get(Global.Home, "User").toFile();
|
||||
File workspace = Paths.get(CommonUtils.Home, "User").toFile();
|
||||
target.workspace = workspace.getAbsolutePath();
|
||||
Utils.CheckAndCleanDirectory(workspace);
|
||||
FileUtils.forceMkdir(target.getLocalProjectsDir());
|
||||
FileUtils.forceMkdir(target.getLocalModulesDir());
|
||||
//-
|
||||
if (!Global.isWindows) {
|
||||
if (!CommonUtils.isWindows) {
|
||||
File headerCode = target.getHeaderCodeFile();
|
||||
//-
|
||||
File starterCode = target.getStarterCodeFile();
|
||||
|
||||
@@ -29,7 +29,7 @@ public class OpenBugReportTestProject extends Pass_2021<BugReport> {
|
||||
root = Paths.get(Global.visualiser.getWorkspace().getAbsolutePath(),
|
||||
target.id).toFile();
|
||||
project = Paths.get(root.getAbsolutePath(),
|
||||
Global.isWindows ? CommonUtils.toW(target.project_version)
|
||||
CommonUtils.isWindows ? CommonUtils.toW(target.project_version)
|
||||
: CommonUtils.toU(target.project_version)).toFile();
|
||||
return true;
|
||||
}else {
|
||||
|
||||
@@ -54,12 +54,12 @@ public class OpenCurrentProject extends Pass_2021<db_project_info> {
|
||||
mode = Mode.ProjectInfo;
|
||||
target = (db_project_info) arg;
|
||||
dir = target.Home;
|
||||
Global.Log.Print(DebugPrintLevel.Project, "готовая версия " + CommonUtils.Brackets(dir.getAbsolutePath()));
|
||||
CommonUtils.MainLog.Print(DebugPrintLevel.Project, "готовая версия " + CommonUtils.Brackets(dir.getAbsolutePath()));
|
||||
return needsOpen();
|
||||
}
|
||||
}
|
||||
if ((dir != null) && needsOpen()) {
|
||||
Global.Log.Print(DebugPrintLevel.Project, CommonUtils.Brackets(dir.toString()));
|
||||
CommonUtils.MainLog.Print(DebugPrintLevel.Project, CommonUtils.Brackets(dir.toString()));
|
||||
if (!dir.isDirectory()) {
|
||||
Log.Writeln_(CommonUtils.Brackets(dir) + "\nне является папкой!");
|
||||
return false;
|
||||
@@ -85,7 +85,7 @@ public class OpenCurrentProject extends Pass_2021<db_project_info> {
|
||||
db_project_info root = Current.getRoot();
|
||||
db_project_info project = root.find_version_r(dir);
|
||||
if (project != null) {
|
||||
Global.Log.Print("версия найдена в текущем корне");
|
||||
CommonUtils.MainLog.Print("версия найдена в текущем корне");
|
||||
//версия уже существует. и выстраивать дерево второй раз не нужно.
|
||||
//как и отображать дерево.
|
||||
target = project;
|
||||
@@ -94,7 +94,7 @@ public class OpenCurrentProject extends Pass_2021<db_project_info> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Global.Log.Print(DebugPrintLevel.Project, "построение дерева версий");
|
||||
CommonUtils.MainLog.Print(DebugPrintLevel.Project, "построение дерева версий");
|
||||
target = new db_project_info(dir);
|
||||
new_root = target.CreateVersionsTree();
|
||||
target.Open();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = Current.getProject();
|
||||
if (Global.isWindows) {
|
||||
if (CommonUtils.isWindows) {
|
||||
//--
|
||||
makepath = Global.db.settings.get(SettingName.LocalMakePathWindows).toString();
|
||||
if (makepath.isEmpty()) {
|
||||
@@ -184,7 +184,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
if (Global.isWindows) {
|
||||
if (CommonUtils.isWindows) {
|
||||
name_to_kill = "make.exe";
|
||||
StartProcess(CommonUtils.DQuotes(Global.db.settings.get(SettingName.LocalMakePathWindows).Value) + " -j " + Global.db.settings.get(SettingName.Kernels).toString(),
|
||||
target.compilation_maxtime);
|
||||
@@ -246,7 +246,7 @@ public class Precompilation extends Pass_2021<db_project_info> {
|
||||
}
|
||||
@Override
|
||||
public void Interrupt() throws Exception {
|
||||
if (Global.isWindows) {
|
||||
if (CommonUtils.isWindows) {
|
||||
if (!name_to_kill.isEmpty()) {
|
||||
killed = true;
|
||||
Process killer = Runtime.getRuntime().exec("taskkill /FI \"IMAGENAME eq " + name_to_kill + "\" /F /T");
|
||||
|
||||
@@ -3,7 +3,6 @@ import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.UI;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Account.AccountRole;
|
||||
import Repository.Component.Component;
|
||||
import Repository.Component.ComponentType;
|
||||
@@ -32,7 +31,7 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Global.isWindows) {
|
||||
if (!CommonUtils.isWindows) {
|
||||
Log.Writeln_("Публикация компонент разрешена только для Windows");
|
||||
return false;
|
||||
}
|
||||
@@ -71,7 +70,7 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
|
||||
protected void ServerAction() throws Exception {
|
||||
String change_description = (f.Result == null) ? "не указаны" : f.Result;
|
||||
String change_record_header = String.join(" ",
|
||||
CommonUtils.Brackets(Utils.print_date(new Date())) + ":",
|
||||
CommonUtils.Brackets(CommonUtils.print_date(new Date())) + ":",
|
||||
Current.getAccount().name + CommonUtils.RBrackets(Current.getAccount().email),
|
||||
"публикует версию", CommonUtils.DQuotes(target.version)
|
||||
);
|
||||
@@ -85,14 +84,14 @@ public class PublishComponent extends ComponentsRepositoryPass<Component> {
|
||||
target.getVersionText() + "\n" +
|
||||
change_record;
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishComponent,
|
||||
packed, Utils.packFile(target.getFile())
|
||||
packed, CommonUtils.fileToBytes(target.getFile())
|
||||
));
|
||||
if (target.needs_update_minimal_version) {
|
||||
packed = target.getComponentType().toString() + "\n" +
|
||||
target.getVersionText() + "\n";
|
||||
//--
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.UpdateComponentMinimalVersion,
|
||||
packed, Utils.packFile(target.getFile())
|
||||
packed, CommonUtils.fileToBytes(target.getFile())
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,9 @@ public class ReplaceTestsFromFiles extends TestingSystemPass<Vector<Test>> {
|
||||
return false;
|
||||
}
|
||||
if (!Utils.validateProjectFile(dir, Log)) {
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы " + Constants.all_forbidden_characters_string + ", или кириллицу.");
|
||||
Log.Writeln_("Имя папки " + CommonUtils.Brackets(dir.getName()) + " содержит запрещённые символы "
|
||||
+ CommonUtils.printAllForbiddenCharacters()
|
||||
+ ", или кириллицу.");
|
||||
return false;
|
||||
}
|
||||
if (files.isEmpty()) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Run extends Pass_2021<db_project_info> {
|
||||
protected void body() throws Exception {
|
||||
switch (Current.getMachine().type) {
|
||||
case Local:
|
||||
if (Global.isWindows) {
|
||||
if (CommonUtils.isWindows) {
|
||||
subpass = passes.get(PassCode_2021.WindowsLocalRun);
|
||||
} else
|
||||
subpass = passes.get(PassCode_2021.LinuxLocalRun);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import Common_old.Utils.Utils;
|
||||
import Repository.BugReport.BugReportInterface;
|
||||
import Repository.BugReport.BugReportState;
|
||||
import Repository.Server.ServerCode;
|
||||
@@ -13,7 +13,7 @@ public class SendBugReport extends ComponentsRepositoryPass {
|
||||
//отправить архив.
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport,
|
||||
Current.getBugReport().id,
|
||||
Utils.packFile(BugReportInterface.getArchiveFile(Current.getBugReport()))
|
||||
CommonUtils.fileToBytes(BugReportInterface.getArchiveFile(Current.getBugReport()))
|
||||
));
|
||||
}
|
||||
// синхрон бд
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ShowComponentChangesLog extends ComponentsRepositoryPass<Component>
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.GetComponentChangesLog, target.getComponentType().toString()));
|
||||
Utils.unpackFile((byte[]) response.object, res);
|
||||
CommonUtils.bytesToFile((byte[]) response.object, res);
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Current;
|
||||
import _VisualDVM.Global;
|
||||
import Repository.Component.Component;
|
||||
@@ -21,7 +22,7 @@ public class UpdateComponent extends Pass_2021<Component> {
|
||||
switch (Current.getComponent().getComponentType()) {
|
||||
case Sapfor_F:
|
||||
case Visualizer_2:
|
||||
subPass = Global.isWindows ? PassCode_2021.DownloadComponent : PassCode_2021.BuildComponent;
|
||||
subPass = CommonUtils.isWindows ? PassCode_2021.DownloadComponent : PassCode_2021.BuildComponent;
|
||||
break;
|
||||
case Visualiser:
|
||||
case Instruction:
|
||||
|
||||
Reference in New Issue
Block a user