clean up
This commit is contained in:
parent
9373996f86
commit
a3d512d8ce
@ -1,10 +1,5 @@
|
||||
package p.studio.compiler.messages;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class BuilderPipelineConfig {
|
||||
private String rootProjectPath;
|
||||
}
|
||||
public record BuilderPipelineConfig(
|
||||
boolean explain,
|
||||
String rootProjectPath) {}
|
||||
|
||||
@ -4,7 +4,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import p.studio.compiler.exceptions.BuildException;
|
||||
import p.studio.compiler.messages.BuilderPipelineConfig;
|
||||
import p.studio.compiler.models.BuilderPipelineContext;
|
||||
import p.studio.compiler.workspaces.stages.DepsPipelineStage;
|
||||
import p.studio.compiler.workspaces.stages.DependencyPipelineStage;
|
||||
import p.studio.utilities.logs.LogAggregator;
|
||||
import p.studio.utilities.structures.ReadOnlyCollection;
|
||||
|
||||
@ -16,7 +16,7 @@ public class BuilderPipelineService {
|
||||
|
||||
static {
|
||||
final var stages = List.<PipelineStage>of(
|
||||
new DepsPipelineStage()
|
||||
new DependencyPipelineStage()
|
||||
);
|
||||
INSTANCE = new BuilderPipelineService(stages);
|
||||
}
|
||||
|
||||
@ -11,19 +11,19 @@ import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class DepsPipelineStage implements PipelineStage {
|
||||
public class DependencyPipelineStage implements PipelineStage {
|
||||
@Override
|
||||
public BuildingIssues run(final BuilderPipelineContext ctx, LogAggregator logs) {
|
||||
final Path rootCanonPath;
|
||||
try {
|
||||
rootCanonPath = Paths.get(ctx.config.getRootProjectPath()).toRealPath();
|
||||
rootCanonPath = Paths.get(ctx.config.rootProjectPath()).toRealPath();
|
||||
} catch (IOException e) {
|
||||
return BuildingIssues.empty()
|
||||
.add(builder -> builder.error(true)
|
||||
.message("[BUILD]: root project directory no found: " + ctx.config.getRootProjectPath()));
|
||||
.message("[BUILD]: root project directory no found: " + ctx.config.rootProjectPath()));
|
||||
}
|
||||
final var cfg = new DependencyConfig(false, rootCanonPath);
|
||||
ctx.resolvedWorkspace = DependencyService.INSTANCE.run(cfg, logs);
|
||||
final var dependencyConfig = new DependencyConfig(ctx.config.explain(), rootCanonPath);
|
||||
ctx.resolvedWorkspace = DependencyService.INSTANCE.run(dependencyConfig, logs);
|
||||
ctx.resolvedWorkspace.topologicalOrder().forEach(pd -> logs.info("Project [ " + pd.getName() + " ] read"));
|
||||
return BuildingIssues.empty();
|
||||
}
|
||||
@ -51,8 +51,7 @@ public class BuilderWorkspace implements Workspace {
|
||||
buildButton.textProperty().bind(Container.i18n().bind(I18n.WORKSPACE_BUILDER_BUTTON_RUN));
|
||||
buildButton.setOnAction(e -> {
|
||||
final var logAggregator = LogAggregator.with(logs::appendText);
|
||||
final var config = new BuilderPipelineConfig();
|
||||
config.setRootProjectPath("../test-projects/main");
|
||||
final var config = new BuilderPipelineConfig(false, "../test-projects/main");
|
||||
BuilderPipelineService.INSTANCE.run(config, logAggregator);
|
||||
});
|
||||
return new ToolBar(buildButton);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user