Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
aloubyansky committed Jan 30, 2024
1 parent e2cf485 commit cb7bbdd
Showing 1 changed file with 20 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void resolve(CollectRequest collectRtDepsRequest) throws AppModelResolver
this.managedDeps = managedDeps.isEmpty() ? new ArrayList<>() : managedDeps;

var current = System.currentTimeMillis();
processDependencies(root);
processRuntimeDeps(root);
if (doLog)
System.out.println("Process rt deps " + (System.currentTimeMillis() - current) + ", conditional deps "
+ conditionalDepsToProcess.size());
Expand Down Expand Up @@ -185,18 +185,18 @@ public void resolve(CollectRequest collectRtDepsRequest) throws AppModelResolver
if (doLog)
System.out.println("Added deployment " + (System.currentTimeMillis() - current));

if (!CONVERGED_TREE_ONLY && collectReloadableModules) {
for (ResolvedDependencyBuilder db : appBuilder.getDependencies()) {
if (db.isFlagSet(DependencyFlags.RELOADABLE | DependencyFlags.VISITED)) {
continue;
}
clearReloadableFlag(db);
for (var d : appBuilder.getDependencies()) {
if (!d.isFlagSet(DependencyFlags.VISITED) && !d.isFlagSet(DependencyFlags.RELOADABLE)) {
clearReloadableFlag(d);
}
}

for (ResolvedDependencyBuilder db : appBuilder.getDependencies()) {
db.clearFlag(DependencyFlags.VISITED);
appBuilder.addDependency(db);
for (var d : appBuilder.getDependencies()) {
d.clearFlag(DependencyFlags.VISITED);
if (d.isFlagSet(DependencyFlags.RELOADABLE)) {
appBuilder.addReloadableWorkspaceModule(d.getKey());
}
appBuilder.addDependency(d);
}

collectPlatformProperties();
Expand Down Expand Up @@ -314,15 +314,14 @@ private void collectPlatformProperties() throws AppModelResolverException {
appBuilder.setPlatformImports(platformReleases);
}

private void clearReloadableFlag(ResolvedDependencyBuilder db) {
for (ArtifactKey key : db.getDependencies()) {
final ResolvedDependencyBuilder dep = appBuilder.getDependency(key);
if (dep == null || dep.isFlagSet(DependencyFlags.VISITED)) {
continue;
private void clearReloadableFlag(ResolvedDependencyBuilder dep) {
dep.setFlags(DependencyFlags.VISITED);
dep.clearFlag(DependencyFlags.RELOADABLE);
for (ArtifactKey key : dep.getDependencies()) {
final ResolvedDependencyBuilder child = appBuilder.getDependency(key);
if (child != null && !child.isFlagSet(DependencyFlags.VISITED)) {
clearReloadableFlag(child);
}
dep.setFlags(DependencyFlags.VISITED);
dep.clearFlag(DependencyFlags.RELOADABLE);
clearReloadableFlag(dep);
}
}

Expand Down Expand Up @@ -364,7 +363,7 @@ private boolean isRuntimeArtifact(ArtifactKey key) {
return dep != null && dep.isFlagSet(DependencyFlags.RUNTIME_CP);
}

private void processDependencies(DependencyNode root) {
private void processRuntimeDeps(DependencyNode root) {

final AppDep app = new AppDep(root);
app.walkingFlags = COLLECT_TOP_EXTENSION_RUNTIME_NODES | COLLECT_DIRECT_DEPS;
Expand Down Expand Up @@ -538,9 +537,9 @@ void setFlags(byte walkingFlags) {
topExtensionDeps.add(ext);
}
if (isWalkingFlagOn(COLLECT_RELOADABLE_MODULES)) {
if (resolvedDep.getWorkspaceModule() != null) {
if (resolvedDep.getWorkspaceModule() != null
&& !resolvedDep.isFlagSet(DependencyFlags.RUNTIME_EXTENSION_ARTIFACT)) {
resolvedDep.setReloadable();
appBuilder.addReloadableWorkspaceModule(resolvedDep.getKey());
} else {
clearWalkingFlag(COLLECT_RELOADABLE_MODULES);
}
Expand Down Expand Up @@ -635,10 +634,6 @@ private void injectDeploymentDependencies(ExtensionDependency extDep)
+ extDep.info.runtimeArtifact + " is expected");
}

if (resolver.getProjectModuleResolver() != null && collectReloadableModules) {
clearReloadable(deploymentNode);
}

final List<DependencyNode> deploymentDeps = deploymentNode.getChildren();
if (!replaceDirectDepBranch(extDep, deploymentDeps)) {
throw new BootstrapDependencyProcessingException(
Expand Down

0 comments on commit cb7bbdd

Please sign in to comment.