рефакторинг. переносил текущие объекты в другое место
This commit is contained in:
@@ -19,7 +19,7 @@ public class Compile extends Pass<db_project_info> {
|
||||
CompilationTask compilationTask = null;
|
||||
@Override
|
||||
protected PassCode necessary() {
|
||||
return Current.getProject().languageName.equals(LanguageName.fortran) ? PassCode.SPF_ParseFilesWithOrder : null;
|
||||
return Global.mainModule.getProject().languageName.equals(LanguageName.fortran) ? PassCode.SPF_ParseFilesWithOrder : null;
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
@@ -31,15 +31,15 @@ public class Compile extends Pass<db_project_info> {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
if (Current_.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
|
||||
target = Current.getProject();
|
||||
if (Global.mainModule.Check(Log, Current.Project, Current.Machine, Current.User, Current.Makefile)) {
|
||||
target = Global.mainModule.getProject();
|
||||
subpass = null;
|
||||
compilationTask = null;
|
||||
if (Current.getUser().state != UserState.ready_to_work)
|
||||
Log.Writeln_("Пользователь " + Utils_.Brackets(Current.getUser().login) +
|
||||
if (Global.mainModule.getUser().state != UserState.ready_to_work)
|
||||
Log.Writeln_("Пользователь " + Utils_.Brackets(Global.mainModule.getUser().login) +
|
||||
" не проинициализирован\nПерейдите на вкладку 'Настройки компиляции и запуска',\n" +
|
||||
" и выполните команду 'Инициализация пользователя'\n");
|
||||
Current.getMakefile().Validate(Log);
|
||||
Global.mainModule.getMakefile().Validate(Log);
|
||||
return Log.isEmpty();
|
||||
}
|
||||
return false;
|
||||
@@ -47,9 +47,9 @@ public class Compile extends Pass<db_project_info> {
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
compilationTask = new CompilationTask();
|
||||
compilationTask.machine_id = Current.getMachine().id;
|
||||
compilationTask.user_id = Current.getUser().id;
|
||||
compilationTask.makefile_id = Current.getMakefile().id;
|
||||
compilationTask.machine_id = Global.mainModule.getMachine().id;
|
||||
compilationTask.user_id = Global.mainModule.getUser().id;
|
||||
compilationTask.makefile_id = Global.mainModule.getMakefile().id;
|
||||
compilationTask.project_path = target.Home.getAbsolutePath();
|
||||
compilationTask.project_description = target.description;
|
||||
//------------------------------------------
|
||||
@@ -65,7 +65,7 @@ public class Compile extends Pass<db_project_info> {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
|
||||
switch (Current.getMachine().type) {
|
||||
switch (Global.mainModule.getMachine().type) {
|
||||
case Local:
|
||||
if (Utils_.isWindows()) {
|
||||
subpass = passes.get(PassCode.WindowsLocalCompilation);
|
||||
@@ -74,12 +74,12 @@ public class Compile extends Pass<db_project_info> {
|
||||
break;
|
||||
case Undefined:
|
||||
case MVS_cluster:
|
||||
throw new PassException("Компиляция не реализована для типа машины " + Utils_.DQuotes(Current.getMachine().type));
|
||||
throw new PassException("Компиляция не реализована для типа машины " + Utils_.DQuotes(Global.mainModule.getMachine().type));
|
||||
default:
|
||||
subpass = passes.get(PassCode.RemoteCompilation);
|
||||
break;
|
||||
}
|
||||
subpass.Do(Current.getCompilationTask(), Current.getProject());
|
||||
subpass.Do(Global.mainModule.getCompilationTask(), Global.mainModule.getProject());
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
|
||||
Reference in New Issue
Block a user