code improvements, add pipeline stages

This commit is contained in:
2026-03-24 13:42:15 +00:00
parent 47a077bffc
commit 31c59f670e
16 changed files with 289 additions and 179 deletions
@@ -7,7 +7,7 @@ public class BuildStack {
public final ReadOnlyList<ProjectId> topologicalOrder;
public final ReadOnlyList<ProjectId> reverseTopologicalOrder;
public BuildStack(ReadOnlyList<ProjectId> topologicalOrder) {
public BuildStack(final ReadOnlyList<ProjectId> topologicalOrder) {
this.topologicalOrder = topologicalOrder;
this.reverseTopologicalOrder = topologicalOrder.invert();
}
@@ -2,23 +2,12 @@ package p.studio.compiler.models;
import p.studio.compiler.source.identifiers.ProjectId;
import java.util.stream.Stream;
public record ResolvedWorkspace(
ProjectId projectId,
ProjectId mainProjectId,
FrontendSpec frontendSpec,
WorkspaceGraph graph,
BuildStack stack) {
public ProjectDescriptor mainProject() {
return graph.projectDescriptor(projectId);
}
public Stream<ProjectId> topologicalOrder() {
return stack.topologicalOrder.stream();
}
public Stream<ProjectId> reverseTopologicalOrder() {
return stack.reverseTopologicalOrder.stream();
return graph.projectDescriptor(mainProjectId);
}
}
@@ -1,11 +1,11 @@
package p.studio.compiler.models;
import p.studio.compiler.source.identifiers.ProjectId;
import p.studio.compiler.source.tables.ProjectTable;
import p.studio.compiler.source.tables.ProjectTableReader;
import p.studio.utilities.structures.ReadOnlyList;
public record WorkspaceGraph(
ProjectTable projectTable,
ProjectTableReader projectTable,
ReadOnlyList<ReadOnlyList<ProjectId>> dependenciesByProjectId) {
public ProjectDescriptor projectDescriptor(final ProjectId projectId) {