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.
An option to resolve only the runtime part of the ApplicationModel
- Loading branch information
1 parent
123ea8e
commit e04ebf3
Showing
4 changed files
with
125 additions
and
14 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
...src/test/java/io/quarkus/bootstrap/resolver/test/RuntimeOnlyApplicationModelTestCase.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,82 @@ | ||
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 RuntimeOnlyApplicationModelTestCase extends CollectDependenciesBase { | ||
|
||
private static final boolean runtimeOnly = true; | ||
|
||
@Override | ||
protected BootstrapAppModelResolver newAppModelResolver(LocalProject currentProject) throws Exception { | ||
var resolver = super.newAppModelResolver(currentProject); | ||
resolver.setIncubatingModelResolver(false); | ||
resolver.setRuntimeModelOnly(runtimeOnly); | ||
return resolver; | ||
} | ||
|
||
@Override | ||
protected void setupDependencies() { | ||
|
||
final TsQuarkusExt extA = new TsQuarkusExt("ext-a"); | ||
install(extA, false); | ||
if (!runtimeOnly) { | ||
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); | ||
if (!runtimeOnly) { | ||
addCollectedDeploymentDep(extD.getDeployment()); | ||
} | ||
|
||
final TsArtifact libE = TsArtifact.jar("lib-e"); | ||
install(libE, true); | ||
final TsArtifact libEBuildTIme = TsArtifact.jar("lib-e-build-time"); | ||
install(libEBuildTIme); | ||
if (!runtimeOnly) { | ||
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); | ||
if (!runtimeOnly) { | ||
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); | ||
if (!runtimeOnly) { | ||
addCollectedDeploymentDep(extF.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
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