mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-04 20:22:14 +03:00
toposort discovered projects to improve selection of main
project
This commit is contained in:
parent
cd223d4669
commit
0ef1821bdc
@ -507,13 +507,6 @@
|
||||
self))
|
||||
discoveredProjects;
|
||||
|
||||
# attrset of projects by key
|
||||
projects =
|
||||
l.listToAttrs
|
||||
(l.map
|
||||
(proj: l.nameValuePair proj.key proj)
|
||||
projectsList);
|
||||
|
||||
# unresolved impure projects cannot be resolved on the fly
|
||||
projectsImpureUnresolved =
|
||||
l.filter (project: project.impure && ! project.resolved) projectsList;
|
||||
|
@ -23,15 +23,23 @@
|
||||
(discoverer: discoverer.discover {inherit tree;})
|
||||
allDiscoverers);
|
||||
|
||||
rootProjectName = l.head discoveredProjects;
|
||||
discoveredProjectsSorted = let
|
||||
toposorted =
|
||||
l.toposort
|
||||
(p1: p2: l.hasPrefix p1.relPath p2.relPath)
|
||||
discoveredProjects;
|
||||
in
|
||||
toposorted.result;
|
||||
|
||||
rootProject = l.head discoveredProjectsSorted;
|
||||
|
||||
projectsExtended =
|
||||
l.forEach discoveredProjects
|
||||
l.forEach discoveredProjectsSorted
|
||||
(proj:
|
||||
proj
|
||||
// {
|
||||
translator = l.head proj.translators;
|
||||
dreamLockPath = getDreamLockPath proj rootProjectName;
|
||||
dreamLockPath = getDreamLockPath proj rootProject;
|
||||
});
|
||||
in
|
||||
applyProjectSettings projectsExtended settings;
|
||||
|
Loading…
Reference in New Issue
Block a user