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 for dev-mode-only conditional dependencies
- Loading branch information
Alexey Loubyansky
committed
Nov 15, 2024
1 parent
45fa5d3
commit e5d0ae0
Showing
16 changed files
with
492 additions
and
163 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
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
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
88 changes: 88 additions & 0 deletions
88
...test/java/io/quarkus/bootstrap/resolver/test/ConditionalDependenciesDevModelTestCase.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,88 @@ | ||
package io.quarkus.bootstrap.resolver.test; | ||
|
||
import io.quarkus.bootstrap.app.QuarkusBootstrap; | ||
import io.quarkus.bootstrap.resolver.BootstrapAppModelResolver; | ||
import io.quarkus.bootstrap.resolver.CollectDependenciesBase; | ||
import io.quarkus.bootstrap.resolver.TsArtifact; | ||
import io.quarkus.bootstrap.resolver.TsQuarkusExt; | ||
import io.quarkus.bootstrap.resolver.maven.workspace.LocalProject; | ||
import io.quarkus.maven.dependency.DependencyFlags; | ||
|
||
public class ConditionalDependenciesDevModelTestCase extends CollectDependenciesBase { | ||
|
||
@Override | ||
protected BootstrapAppModelResolver newAppModelResolver(LocalProject currentProject) throws Exception { | ||
var resolver = super.newAppModelResolver(currentProject); | ||
resolver.setIncubatingModelResolver(false); | ||
return resolver; | ||
} | ||
|
||
@Override | ||
protected QuarkusBootstrap.Mode getBootstrapMode() { | ||
return QuarkusBootstrap.Mode.DEV; | ||
} | ||
|
||
@Override | ||
protected void setupDependencies() { | ||
|
||
final TsQuarkusExt extA = new TsQuarkusExt("ext-a"); | ||
install(extA, false); | ||
addCollectedDeploymentDep(extA.getDeployment()); | ||
|
||
installAsDep(extA.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
|
||
final TsQuarkusExt extB = new TsQuarkusExt("ext-b"); | ||
install(extB, false); | ||
addCollectedDep(extB.getRuntime(), DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extB.getDeployment()); | ||
|
||
final TsQuarkusExt extC = new TsQuarkusExt("ext-c"); | ||
extC.setDependencyCondition(extB); | ||
install(extC, false); | ||
addCollectedDep(extC.getRuntime(), DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extC.getDeployment()); | ||
|
||
final TsQuarkusExt extD = new TsQuarkusExt("ext-d"); | ||
install(extD, false); | ||
installAsDep(extD.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extD.getDeployment()); | ||
|
||
final TsArtifact libE = TsArtifact.jar("lib-e"); | ||
install(libE, true); | ||
final TsArtifact libEBuildTIme = TsArtifact.jar("lib-e-build-time"); | ||
install(libEBuildTIme); | ||
addCollectedDeploymentDep(libEBuildTIme); | ||
|
||
final TsQuarkusExt extE = new TsQuarkusExt("ext-e"); | ||
extE.setDependencyCondition(extD); | ||
extE.getRuntime().addDependency(libE); | ||
extE.getDeployment().addDependency(libEBuildTIme); | ||
install(extE, false); | ||
addCollectedDep(extE.getRuntime(), DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extE.getDeployment()); | ||
|
||
final TsQuarkusExt extF = new TsQuarkusExt("ext-f"); | ||
extF.setConditionalDeps(extC, extE); | ||
install(extF, false); | ||
installAsDep(extF.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extF.getDeployment()); | ||
|
||
final TsQuarkusExt extG = new TsQuarkusExt("ext-g"); | ||
extG.setConditionalDevDeps(extB); | ||
install(extG, false); | ||
installAsDep(extG.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extG.getDeployment()); | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
...est/java/io/quarkus/bootstrap/resolver/test/ConditionalDependenciesProdModelTestCase.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,78 @@ | ||
package io.quarkus.bootstrap.resolver.test; | ||
|
||
import io.quarkus.bootstrap.resolver.BootstrapAppModelResolver; | ||
import io.quarkus.bootstrap.resolver.CollectDependenciesBase; | ||
import io.quarkus.bootstrap.resolver.TsArtifact; | ||
import io.quarkus.bootstrap.resolver.TsQuarkusExt; | ||
import io.quarkus.bootstrap.resolver.maven.workspace.LocalProject; | ||
import io.quarkus.maven.dependency.DependencyFlags; | ||
|
||
public class ConditionalDependenciesProdModelTestCase 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"); | ||
install(extA, false); | ||
addCollectedDeploymentDep(extA.getDeployment()); | ||
|
||
installAsDep(extA.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
|
||
final TsQuarkusExt extB = new TsQuarkusExt("ext-b"); | ||
install(extB, false); | ||
|
||
final TsQuarkusExt extC = new TsQuarkusExt("ext-c"); | ||
extC.setDependencyCondition(extB); | ||
install(extC, false); | ||
|
||
final TsQuarkusExt extD = new TsQuarkusExt("ext-d"); | ||
install(extD, false); | ||
installAsDep(extD.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extD.getDeployment()); | ||
|
||
final TsArtifact libE = TsArtifact.jar("lib-e"); | ||
install(libE, true); | ||
final TsArtifact libEBuildTIme = TsArtifact.jar("lib-e-build-time"); | ||
install(libEBuildTIme); | ||
addCollectedDeploymentDep(libEBuildTIme); | ||
|
||
final TsQuarkusExt extE = new TsQuarkusExt("ext-e"); | ||
extE.setDependencyCondition(extD); | ||
extE.getRuntime().addDependency(libE); | ||
extE.getDeployment().addDependency(libEBuildTIme); | ||
install(extE, false); | ||
addCollectedDep(extE.getRuntime(), DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extE.getDeployment()); | ||
|
||
final TsQuarkusExt extF = new TsQuarkusExt("ext-f"); | ||
extF.setConditionalDeps(extC, extE); | ||
install(extF, false); | ||
installAsDep(extF.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extF.getDeployment()); | ||
|
||
final TsQuarkusExt extG = new TsQuarkusExt("ext-g"); | ||
extG.setConditionalDevDeps(extB); | ||
install(extG, false); | ||
installAsDep(extG.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extG.getDeployment()); | ||
} | ||
} |
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
63 changes: 63 additions & 0 deletions
63
...arkus/bootstrap/resolver/test/DevModeConditionalDependencyWithExtraConditionTestCase.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,63 @@ | ||
package io.quarkus.bootstrap.resolver.test; | ||
|
||
import io.quarkus.bootstrap.app.QuarkusBootstrap; | ||
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 DevModeConditionalDependencyWithExtraConditionTestCase extends CollectDependenciesBase { | ||
|
||
@Override | ||
protected BootstrapAppModelResolver newAppModelResolver(LocalProject currentProject) throws Exception { | ||
var resolver = super.newAppModelResolver(currentProject); | ||
resolver.setIncubatingModelResolver(false); | ||
return resolver; | ||
} | ||
|
||
@Override | ||
protected QuarkusBootstrap.Mode getBootstrapMode() { | ||
return QuarkusBootstrap.Mode.DEV; | ||
} | ||
|
||
@Override | ||
protected void setupDependencies() { | ||
|
||
final TsQuarkusExt extA = new TsQuarkusExt("ext-a"); | ||
install(extA, false); | ||
addCollectedDeploymentDep(extA.getDeployment()); | ||
|
||
installAsDep(extA.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
|
||
final TsQuarkusExt extB = new TsQuarkusExt("ext-b"); | ||
install(extB, false); | ||
addCollectedDep(extB.getRuntime(), DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extB.getDeployment()); | ||
|
||
final TsQuarkusExt extC = new TsQuarkusExt("ext-c"); | ||
extC.setDependencyCondition(extA); | ||
install(extC, false); | ||
addCollectedDep(extC.getRuntime(), DependencyFlags.RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extC.getDeployment()); | ||
|
||
final TsQuarkusExt extD = new TsQuarkusExt("ext-d"); | ||
install(extD, false); | ||
|
||
final TsQuarkusExt extE = new TsQuarkusExt("ext-e"); | ||
extE.setDependencyCondition(extD); | ||
install(extE, false); | ||
|
||
final TsQuarkusExt extG = new TsQuarkusExt("ext-g"); | ||
extG.setConditionalDevDeps(extB, extC, extE); | ||
install(extG, false); | ||
installAsDep(extG.getRuntime(), | ||
DependencyFlags.DIRECT | ||
| DependencyFlags.RUNTIME_EXTENSION_ARTIFACT | ||
| DependencyFlags.TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT); | ||
addCollectedDeploymentDep(extG.getDeployment()); | ||
} | ||
} |
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.