Skip to content

Commit

Permalink
Merge pull request #37185 from aloubyansky/remove-dependency-flags-re…
Browse files Browse the repository at this point in the history
…moved

Removed DependencyFlags.REMOVED
  • Loading branch information
gsmet authored Nov 21, 2023
2 parents e56b8ec + 6ebbc22 commit d443437
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,5 @@ protected void assertAppModel(ApplicationModel model) throws Exception {
expected.add(new ArtifactDependency(ArtifactCoords.jar("io.quarkus.bootstrap.test", "dep-g", "1"),
DependencyFlags.RUNTIME_CP, DependencyFlags.DEPLOYMENT_CP));
assertEquals(expected, getDependenciesWithFlag(model, DependencyFlags.RUNTIME_CP));

expected = new HashSet<>();
expected.add(new ArtifactDependency(ArtifactCoords.jar("io.quarkus.bootstrap.test", "ext-a-dep", "1"),
DependencyFlags.REMOVED));
expected.add(new ArtifactDependency(ArtifactCoords.jar("org.banned", "dep-e", "1"), DependencyFlags.REMOVED));
expected.add(new ArtifactDependency(ArtifactCoords.jar("org.banned.too", "dep-d", "1"), DependencyFlags.REMOVED));
expected.add(new ArtifactDependency(ArtifactCoords.jar("org.banned", "dep-f", "1"), DependencyFlags.REMOVED));
assertEquals(expected, getDependenciesWithFlag(model, DependencyFlags.REMOVED));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,31 +240,28 @@ private boolean isExcluded(ArtifactCoords coords) {
List<ResolvedDependency> buildDependencies() {
for (ArtifactKey key : parentFirstArtifacts) {
final ResolvedDependencyBuilder d = dependencies.get(key);
if (d != null && !d.isFlagSet(DependencyFlags.REMOVED)) {
if (d != null) {
d.setFlags(DependencyFlags.CLASSLOADER_PARENT_FIRST);
}
}
for (ArtifactKey key : runnerParentFirstArtifacts) {
final ResolvedDependencyBuilder d = dependencies.get(key);
if (d != null && !d.isFlagSet(DependencyFlags.REMOVED)) {
if (d != null) {
d.setFlags(DependencyFlags.CLASSLOADER_RUNNER_PARENT_FIRST);
}
}
for (ArtifactKey key : lesserPriorityArtifacts) {
final ResolvedDependencyBuilder d = dependencies.get(key);
if (d != null && !d.isFlagSet(DependencyFlags.REMOVED)) {
if (d != null) {
d.setFlags(DependencyFlags.CLASSLOADER_LESSER_PRIORITY);
}
}

final List<ResolvedDependency> result = new ArrayList<>(dependencies.size());
for (ResolvedDependencyBuilder db : this.dependencies.values()) {
if (isExcluded(db.getArtifactCoords())) {
db.setFlags(DependencyFlags.REMOVED);
db.clearFlag(DependencyFlags.DEPLOYMENT_CP);
db.clearFlag(DependencyFlags.RUNTIME_CP);
if (!isExcluded(db.getArtifactCoords())) {
result.add(db.build());
}
result.add(db.build());
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ public interface DependencyFlags {
// once the processing of the whole tree has completed.
int VISITED = 0b00100000000000;

/**
* Dependencies that were removed from the application model
* following {@code removed-artifacts}
* configuration properties collected from extension metadata.
*/
int REMOVED = 0b01000000000000;

/* @formatter:on */

}

0 comments on commit d443437

Please sign in to comment.