chore: ZigConfigEditor flattened imports
This commit is contained in:
parent
695fe43c28
commit
bd6eec8da1
4 changed files with 42 additions and 24 deletions
|
@ -17,7 +17,9 @@
|
|||
package com.falsepattern.zigbrains.debugger.execution.binary;
|
||||
|
||||
import com.falsepattern.zigbrains.common.util.CollectionUtil;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.ArgsConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.FilePathConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.ZigConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigExecConfigBase;
|
||||
import com.intellij.execution.Executor;
|
||||
import com.intellij.execution.configurations.ConfigurationFactory;
|
||||
|
@ -32,8 +34,8 @@ import java.util.List;
|
|||
|
||||
@Getter
|
||||
public class ZigExecConfigBinary extends ZigExecConfigBase<ZigExecConfigBinary> {
|
||||
private ZigConfigEditor.FilePathConfigurable exePath = new ZigConfigEditor.FilePathConfigurable("exePath", "Executable program path (not the zig compiler)");
|
||||
private ZigConfigEditor.ArgsConfigurable args = new ZigConfigEditor.ArgsConfigurable("args", "Command line arguments");
|
||||
private FilePathConfigurable exePath = new FilePathConfigurable("exePath", "Executable program path (not the zig compiler)");
|
||||
private ArgsConfigurable args = new ArgsConfigurable("args", "Command line arguments");
|
||||
|
||||
public ZigExecConfigBinary(@NotNull Project project, @NotNull ConfigurationFactory factory) {
|
||||
super(project, factory, "Zig-compiled native executable");
|
||||
|
@ -59,7 +61,7 @@ public class ZigExecConfigBinary extends ZigExecConfigBase<ZigExecConfigBinary>
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<ZigConfigEditor.ZigConfigurable<?>> getConfigurables() {
|
||||
public @NotNull List<ZigConfigurable<?>> getConfigurables() {
|
||||
return CollectionUtil.concat(super.getConfigurables(), exePath, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@ package com.falsepattern.zigbrains.project.execution.build;
|
|||
|
||||
import com.falsepattern.zigbrains.common.ZBFeatures;
|
||||
import com.falsepattern.zigbrains.common.util.CollectionUtil;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.ArgsConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.CheckboxConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.FilePathConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigExecConfigBase;
|
||||
import com.falsepattern.zigbrains.project.util.CLIUtil;
|
||||
import com.intellij.execution.ExecutionException;
|
||||
|
@ -34,13 +36,15 @@ import org.jetbrains.annotations.Nullable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.*;
|
||||
|
||||
@Getter
|
||||
public class ZigExecConfigBuild extends ZigExecConfigBase<ZigExecConfigBuild> {
|
||||
private ZigConfigEditor.ArgsConfigurable buildSteps = new ZigConfigEditor.ArgsConfigurable("buildSteps", "Build steps");
|
||||
private ZigConfigEditor.ArgsConfigurable extraArgs = new ZigConfigEditor.ArgsConfigurable("extraArgs", "Extra command line arguments");
|
||||
private ZigConfigEditor.CheckboxConfigurable colored = ZigConfigEditor.coloredConfigurable("colored");
|
||||
private ZigConfigEditor.FilePathConfigurable exePath = new ZigConfigEditor.FilePathConfigurable("exePath", "Output executable created by the build (debugging, autodetect if empty)");
|
||||
private ZigConfigEditor.ArgsConfigurable exeArgs = new ZigConfigEditor.ArgsConfigurable("exeArgs", "Command line arguments for executable (debugging)");
|
||||
private ArgsConfigurable buildSteps = new ArgsConfigurable("buildSteps", "Build steps");
|
||||
private ArgsConfigurable extraArgs = new ArgsConfigurable("extraArgs", "Extra command line arguments");
|
||||
private CheckboxConfigurable colored = coloredConfigurable("colored");
|
||||
private FilePathConfigurable exePath = new FilePathConfigurable("exePath", "Output executable created by the build (debugging, autodetect if empty)");
|
||||
private ArgsConfigurable exeArgs = new ArgsConfigurable("exeArgs", "Command line arguments for executable (debugging)");
|
||||
public ZigExecConfigBuild(@NotNull Project project, @NotNull ConfigurationFactory factory) {
|
||||
super(project, factory, "Zig Build");
|
||||
}
|
||||
|
@ -75,7 +79,7 @@ public class ZigExecConfigBuild extends ZigExecConfigBase<ZigExecConfigBuild> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<ZigConfigEditor.ZigConfigurable<?>> getConfigurables() {
|
||||
public @NotNull List<ZigConfigurable<?>> getConfigurables() {
|
||||
val baseCfg = CollectionUtil.concat(super.getConfigurables(), buildSteps, extraArgs, colored);
|
||||
if (ZBFeatures.debug()) {
|
||||
return CollectionUtil.concat(baseCfg, exePath, exeArgs);
|
||||
|
|
|
@ -17,7 +17,11 @@
|
|||
package com.falsepattern.zigbrains.project.execution.run;
|
||||
|
||||
import com.falsepattern.zigbrains.common.util.CollectionUtil;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.ArgsConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.CheckboxConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.FilePathConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.OptimizationConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.ZigConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigExecConfigBase;
|
||||
import com.falsepattern.zigbrains.project.util.CLIUtil;
|
||||
import com.intellij.execution.Executor;
|
||||
|
@ -32,13 +36,15 @@ import org.jetbrains.annotations.Nullable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.coloredConfigurable;
|
||||
|
||||
@Getter
|
||||
public class ZigExecConfigRun extends ZigExecConfigBase<ZigExecConfigRun> {
|
||||
private ZigConfigEditor.FilePathConfigurable filePath = new ZigConfigEditor.FilePathConfigurable("filePath", "File Path");
|
||||
private ZigConfigEditor.CheckboxConfigurable colored = ZigConfigEditor.coloredConfigurable("colored");
|
||||
private ZigConfigEditor.OptimizationConfigurable optimization = new ZigConfigEditor.OptimizationConfigurable("optimization");
|
||||
private ZigConfigEditor.ArgsConfigurable compilerArgs = new ZigConfigEditor.ArgsConfigurable("compilerArgs", "Extra compiler command line arguments");
|
||||
private ZigConfigEditor.ArgsConfigurable exeArgs = new ZigConfigEditor.ArgsConfigurable("exeArgs", "Output program command line arguments");
|
||||
private FilePathConfigurable filePath = new FilePathConfigurable("filePath", "File Path");
|
||||
private CheckboxConfigurable colored = coloredConfigurable("colored");
|
||||
private OptimizationConfigurable optimization = new OptimizationConfigurable("optimization");
|
||||
private ArgsConfigurable compilerArgs = new ArgsConfigurable("compilerArgs", "Extra compiler command line arguments");
|
||||
private ArgsConfigurable exeArgs = new ArgsConfigurable("exeArgs", "Output program command line arguments");
|
||||
public ZigExecConfigRun(@NotNull Project project, @NotNull ConfigurationFactory factory) {
|
||||
super(project, factory, "Zig Run");
|
||||
}
|
||||
|
@ -77,7 +83,7 @@ public class ZigExecConfigRun extends ZigExecConfigBase<ZigExecConfigRun> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<ZigConfigEditor.ZigConfigurable<?>> getConfigurables() {
|
||||
public @NotNull List<ZigConfigurable<?>> getConfigurables() {
|
||||
return CollectionUtil.concat(super.getConfigurables(), filePath, optimization, colored, compilerArgs, exeArgs);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,11 @@ package com.falsepattern.zigbrains.project.execution.test;
|
|||
|
||||
import com.falsepattern.zigbrains.common.util.CollectionUtil;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ProfileStateBase;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.ArgsConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.CheckboxConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.FilePathConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.OptimizationConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.ZigConfigurable;
|
||||
import com.falsepattern.zigbrains.project.execution.base.ZigExecConfigBase;
|
||||
import com.falsepattern.zigbrains.project.util.CLIUtil;
|
||||
import com.intellij.execution.Executor;
|
||||
|
@ -33,12 +37,14 @@ import org.jetbrains.annotations.Nullable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.falsepattern.zigbrains.project.execution.base.ZigConfigEditor.coloredConfigurable;
|
||||
|
||||
@Getter
|
||||
public class ZigExecConfigTest extends ZigExecConfigBase<ZigExecConfigTest> {
|
||||
private ZigConfigEditor.FilePathConfigurable filePath = new ZigConfigEditor.FilePathConfigurable("filePath", "File path");
|
||||
private ZigConfigEditor.CheckboxConfigurable colored = ZigConfigEditor.coloredConfigurable("colored");
|
||||
private ZigConfigEditor.OptimizationConfigurable optimization = new ZigConfigEditor.OptimizationConfigurable("optimization");
|
||||
private ZigConfigEditor.ArgsConfigurable compilerArgs = new ZigConfigEditor.ArgsConfigurable("compilerArgs", "Extra compiler command line arguments");
|
||||
private FilePathConfigurable filePath = new FilePathConfigurable("filePath", "File path");
|
||||
private CheckboxConfigurable colored = coloredConfigurable("colored");
|
||||
private OptimizationConfigurable optimization = new OptimizationConfigurable("optimization");
|
||||
private ArgsConfigurable compilerArgs = new ArgsConfigurable("compilerArgs", "Extra compiler command line arguments");
|
||||
public ZigExecConfigTest(@NotNull Project project, @NotNull ConfigurationFactory factory) {
|
||||
super(project, factory, "Zig Test");
|
||||
}
|
||||
|
@ -80,7 +86,7 @@ public class ZigExecConfigTest extends ZigExecConfigBase<ZigExecConfigTest> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<ZigConfigEditor.ZigConfigurable<?>> getConfigurables() {
|
||||
public @NotNull List<ZigConfigurable<?>> getConfigurables() {
|
||||
return CollectionUtil.concat(super.getConfigurables(), filePath, optimization, colored, compilerArgs);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue