-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve output of ProjectGraphTask and include topological sort. #1326
Conversation
src/main/kotlin/com/autonomousapps/internal/graph/GraphWriter.kt
Outdated
Show resolved
Hide resolved
❌ Test workflow failed:
|
❌ Test workflow failed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to publish a new version of graph-support before I can merge.
|
||
final class WorkPlanSpec extends AbstractJvmSpec { | ||
|
||
@PendingFeature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix test or delete feature and test.
/** | ||
* Returns the [graph] sorted into topological order, ascending. Each node in the graph is paired with its depth. | ||
* | ||
* TODO(tsr): shortest path is wrong, I need the _longest_ path. | ||
*/ | ||
fun topological(graph: Graph<Coordinates>): String { | ||
val root = graph.root() | ||
val top = graph.topological(root) | ||
// val paths = graph.shortestPaths(root) | ||
|
||
return buildString { | ||
top.forEach { node -> | ||
appendLine(node.maybeProjectCoordinates(buildPath).gav()) | ||
// append(" ") | ||
// appendLine("${paths.distanceTo(node)}") | ||
} | ||
} | ||
} | ||
|
||
// TODO replace with Hu's algorithm (for scheduling concurrent work), and push relevant bits into Graphs.kt. | ||
fun workPlan(graph: Graph<Coordinates>): String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up.
❌ Test workflow failed:
|
a17103e
to
551a52e
Compare
❌ Test workflow failed:
|
551a52e
to
1a4efb8
Compare
❌ Test workflow failed:
|
1. improve output of ProjectGraphTask. 2. generate merged graph of all variants in a project. 3. generate merged graph for entire build. 4. incubating support for generating work plan.
1a4efb8
to
7b23159
Compare
In a follow-up, I will add a task at the root level for doing this globally in one pass.