added frontend compile phase
This commit is contained in:
+1
@@ -14,6 +14,7 @@ public class BuilderPipelineContext {
|
||||
public ResolvedWorkspace resolvedWorkspace;
|
||||
|
||||
public FileTable fileTable;
|
||||
public IRBackend irBackend;
|
||||
|
||||
private BuilderPipelineContext(
|
||||
final BuilderPipelineConfig config,
|
||||
|
||||
+17
-2
@@ -1,7 +1,9 @@
|
||||
package p.studio.compiler.workspaces.stages;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import p.studio.compiler.FrontendRegistryService;
|
||||
import p.studio.compiler.messages.BuildingIssueSink;
|
||||
import p.studio.compiler.messages.FrontendPhaseContext;
|
||||
import p.studio.compiler.models.BuilderPipelineContext;
|
||||
import p.studio.compiler.workspaces.PipelineStage;
|
||||
import p.studio.utilities.logs.LogAggregator;
|
||||
@@ -9,7 +11,20 @@ import p.studio.utilities.logs.LogAggregator;
|
||||
@Slf4j
|
||||
public class FrontendPhasePipelineStage implements PipelineStage {
|
||||
@Override
|
||||
public BuildingIssueSink run(BuilderPipelineContext ctx, LogAggregator logs) {
|
||||
return BuildingIssueSink.empty();
|
||||
public BuildingIssueSink run(final BuilderPipelineContext ctx, final LogAggregator logs) {
|
||||
final var frontedSpec = ctx.resolvedWorkspace.frontendSpec();
|
||||
final var service = FrontendRegistryService.getFrontendPhaseService(frontedSpec.getLanguageId());
|
||||
if (service.isEmpty()) {
|
||||
return BuildingIssueSink.empty()
|
||||
.report(builder -> builder
|
||||
.error(true)
|
||||
.message("[BUILD]: unable to find a service for frontend phase: " + frontedSpec.getLanguageId()));
|
||||
}
|
||||
final var projectTable = ctx.resolvedWorkspace.graph().projectTable();
|
||||
final var fileTable = ctx.fileTable;
|
||||
final var frontendPhaseContext = new FrontendPhaseContext(projectTable, fileTable, ctx.resolvedWorkspace.stack());
|
||||
final var issues = BuildingIssueSink.empty();
|
||||
ctx.irBackend = service.get().compile(frontendPhaseContext, logs, issues);
|
||||
return issues;
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -82,7 +82,6 @@ public class LoadSourcesPipelineStage implements PipelineStage {
|
||||
// register in dense tables
|
||||
final var relativePath = pd.getRootPath().relativize(canonPath);
|
||||
final var sourceHandle = new SourceHandle(pId, relativePath, canonPath, size, lastModified, ctx.sourceProviderFactory);
|
||||
logs.using(log).debug("Registering: " + sourceHandle);
|
||||
ctx.fileTable.register(sourceHandle);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user