This commit is contained in:
bQUARKz 2026-02-24 18:54:27 +00:00
parent 9373996f86
commit a3d512d8ce
Signed by: bquarkz
SSH Key Fingerprint: SHA256:Z7dgqoglWwoK6j6u4QC87OveEq74WOhFN+gitsxtkf8
4 changed files with 11 additions and 17 deletions

View File

@ -1,10 +1,5 @@
package p.studio.compiler.messages; package p.studio.compiler.messages;
import lombok.Getter; public record BuilderPipelineConfig(
import lombok.Setter; boolean explain,
String rootProjectPath) {}
@Getter
@Setter
public class BuilderPipelineConfig {
private String rootProjectPath;
}

View File

@ -4,7 +4,7 @@ import lombok.extern.slf4j.Slf4j;
import p.studio.compiler.exceptions.BuildException; import p.studio.compiler.exceptions.BuildException;
import p.studio.compiler.messages.BuilderPipelineConfig; import p.studio.compiler.messages.BuilderPipelineConfig;
import p.studio.compiler.models.BuilderPipelineContext; 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.logs.LogAggregator;
import p.studio.utilities.structures.ReadOnlyCollection; import p.studio.utilities.structures.ReadOnlyCollection;
@ -16,7 +16,7 @@ public class BuilderPipelineService {
static { static {
final var stages = List.<PipelineStage>of( final var stages = List.<PipelineStage>of(
new DepsPipelineStage() new DependencyPipelineStage()
); );
INSTANCE = new BuilderPipelineService(stages); INSTANCE = new BuilderPipelineService(stages);
} }

View File

@ -11,19 +11,19 @@ import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
public class DepsPipelineStage implements PipelineStage { public class DependencyPipelineStage implements PipelineStage {
@Override @Override
public BuildingIssues run(final BuilderPipelineContext ctx, LogAggregator logs) { public BuildingIssues run(final BuilderPipelineContext ctx, LogAggregator logs) {
final Path rootCanonPath; final Path rootCanonPath;
try { try {
rootCanonPath = Paths.get(ctx.config.getRootProjectPath()).toRealPath(); rootCanonPath = Paths.get(ctx.config.rootProjectPath()).toRealPath();
} catch (IOException e) { } catch (IOException e) {
return BuildingIssues.empty() return BuildingIssues.empty()
.add(builder -> builder.error(true) .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); final var dependencyConfig = new DependencyConfig(ctx.config.explain(), rootCanonPath);
ctx.resolvedWorkspace = DependencyService.INSTANCE.run(cfg, logs); ctx.resolvedWorkspace = DependencyService.INSTANCE.run(dependencyConfig, logs);
ctx.resolvedWorkspace.topologicalOrder().forEach(pd -> logs.info("Project [ " + pd.getName() + " ] read")); ctx.resolvedWorkspace.topologicalOrder().forEach(pd -> logs.info("Project [ " + pd.getName() + " ] read"));
return BuildingIssues.empty(); return BuildingIssues.empty();
} }

View File

@ -51,8 +51,7 @@ public class BuilderWorkspace implements Workspace {
buildButton.textProperty().bind(Container.i18n().bind(I18n.WORKSPACE_BUILDER_BUTTON_RUN)); buildButton.textProperty().bind(Container.i18n().bind(I18n.WORKSPACE_BUILDER_BUTTON_RUN));
buildButton.setOnAction(e -> { buildButton.setOnAction(e -> {
final var logAggregator = LogAggregator.with(logs::appendText); final var logAggregator = LogAggregator.with(logs::appendText);
final var config = new BuilderPipelineConfig(); final var config = new BuilderPipelineConfig(false, "../test-projects/main");
config.setRootProjectPath("../test-projects/main");
BuilderPipelineService.INSTANCE.run(config, logAggregator); BuilderPipelineService.INSTANCE.run(config, logAggregator);
}); });
return new ToolBar(buildButton); return new ToolBar(buildButton);