|
|
@ -37,7 +37,7 @@ class ComponentState extends ChangeNotifier { |
|
|
|
await state.setCurrentComponent( |
|
|
|
await state.setCurrentComponent( |
|
|
|
project: proj, |
|
|
|
project: proj, |
|
|
|
component: comp, |
|
|
|
component: comp, |
|
|
|
onDependencyNeeded: (projId, compId) async => _dependenciesMap['$projId/$compId'], |
|
|
|
onDependencyNeeded: (projId, compId) async => _dependenciesMap['${projId == "self" ? proj.projectId : projId}/$compId'], |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
return SimulatedComponent( |
|
|
|
return SimulatedComponent( |
|
|
@ -108,14 +108,30 @@ class ComponentState extends ChangeNotifier { |
|
|
|
|
|
|
|
|
|
|
|
// Load dependencies |
|
|
|
// Load dependencies |
|
|
|
final unsatisfiedDependencies = <String>[]; |
|
|
|
final unsatisfiedDependencies = <String>[]; |
|
|
|
for (final depId in component.dependencies) { |
|
|
|
final neededDependencies = component.dependencies.toList(); |
|
|
|
final splitted = depId.split('/'); |
|
|
|
while (neededDependencies.isNotEmpty) { |
|
|
|
final maybeDep = await onDependencyNeeded(splitted[0], splitted[1]); |
|
|
|
final tmp = neededDependencies.toList(); |
|
|
|
if (maybeDep == null) { |
|
|
|
neededDependencies.clear(); |
|
|
|
unsatisfiedDependencies.add(depId); |
|
|
|
for (final depId in tmp) { |
|
|
|
} |
|
|
|
if (!hasDependency(depId)) { |
|
|
|
else { |
|
|
|
final splitted = depId.split('/'); |
|
|
|
addDependency(depId, maybeDep); |
|
|
|
final maybeDep = await onDependencyNeeded(splitted[0], splitted[1]); |
|
|
|
|
|
|
|
if (maybeDep == null) { |
|
|
|
|
|
|
|
unsatisfiedDependencies.add(depId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
addDependency(depId, maybeDep); |
|
|
|
|
|
|
|
neededDependencies.addAll( |
|
|
|
|
|
|
|
maybeDep.item2.dependencies |
|
|
|
|
|
|
|
.map((depId) { |
|
|
|
|
|
|
|
final splitted = depId.split('/'); |
|
|
|
|
|
|
|
final projectId = splitted[0] == 'self' ? maybeDep.item1.projectId : splitted[0]; |
|
|
|
|
|
|
|
return '$projectId/${splitted[1]}'; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.where((depId) => !hasDependency(depId)) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (unsatisfiedDependencies.isNotEmpty) { |
|
|
|
if (unsatisfiedDependencies.isNotEmpty) { |
|
|
|