forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support conditional dependencies on regular artifacts
- Loading branch information
Alexey Loubyansky
committed
Nov 18, 2024
1 parent
4226a61
commit 6bda7b0
Showing
7 changed files
with
203 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
.../io/quarkus/bootstrap/resolver/test/ConditionalRequiredConditionalDependencyTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package io.quarkus.bootstrap.resolver.test; | ||
|
||
import io.quarkus.bootstrap.resolver.BootstrapAppModelResolver; | ||
import io.quarkus.bootstrap.resolver.CollectDependenciesBase; | ||
import io.quarkus.bootstrap.resolver.TsQuarkusExt; | ||
import io.quarkus.bootstrap.resolver.maven.workspace.LocalProject; | ||
import io.quarkus.maven.dependency.DependencyFlags; | ||
|
||
public class ConditionalRequiredConditionalDependencyTestCase extends CollectDependenciesBase { | ||
|
||
@Override | ||
protected BootstrapAppModelResolver newAppModelResolver(LocalProject currentProject) throws Exception { | ||
var resolver = super.newAppModelResolver(currentProject); | ||
resolver.setIncubatingModelResolver(false); | ||
return resolver; | ||
} | ||
|
||
@Override | ||
protected void setupDependencies() { | ||
|
||
final TsQuarkusExt extA = new TsQuarkusExt("ext-a"); | ||
installAsDep(extA); | ||
|
||
final TsQuarkusExt extB = new TsQuarkusExt("ext-b"); | ||
extB.setDependencyCondition(extA); | ||
install(extB, false); | ||
addCollectedDep(extB.getRuntime(), | ||
DependencyFlags.RUNTIME_CP | ||
| DependencyFlags.DEPLOYMENT_CP | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extB.getDeployment()); | ||
|
||
final TsQuarkusExt extC = new TsQuarkusExt("ext-c"); | ||
extC.setConditionalDeps(extB); | ||
install(extC, false); | ||
addCollectedDep(extC.getRuntime(), | ||
DependencyFlags.RUNTIME_CP | ||
| DependencyFlags.DEPLOYMENT_CP | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extC.getDeployment()); | ||
|
||
final TsQuarkusExt extD = new TsQuarkusExt("ext-d"); | ||
extD.addDependency(extC); | ||
install(extD, false); | ||
addCollectedDep(extD.getRuntime(), | ||
DependencyFlags.RUNTIME_CP | ||
| DependencyFlags.DEPLOYMENT_CP | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extD.getDeployment()); | ||
|
||
final TsQuarkusExt extE = new TsQuarkusExt("ext-e"); | ||
extE.addDependency(extD); | ||
extE.setDependencyCondition(extA); | ||
install(extE, false); | ||
addCollectedDep(extE.getRuntime(), | ||
DependencyFlags.RUNTIME_CP | ||
| DependencyFlags.DEPLOYMENT_CP | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extE.getDeployment()); | ||
|
||
final TsQuarkusExt extF = new TsQuarkusExt("ext-f"); | ||
extF.setConditionalDeps(extE); | ||
installAsDep(extF); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.