Search in sources :

Example 1 with ApplicationDeploymentClasspathBuilder

use of io.quarkus.gradle.dependency.ApplicationDeploymentClasspathBuilder in project quarkus by quarkusio.

the class GradleApplicationModelBuilder method buildAll.

@Override
public Object buildAll(String modelName, ModelParameter parameter, Project project) {
    final LaunchMode mode = LaunchMode.valueOf(parameter.getMode());
    final List<org.gradle.api.artifacts.Dependency> enforcedPlatforms = ToolingUtils.getEnforcedPlatforms(project);
    final PlatformImports platformImports = resolvePlatformImports(project, enforcedPlatforms);
    final ResolvedDependency appArtifact = getProjectArtifact(project, mode);
    final ApplicationModelBuilder modelBuilder = new ApplicationModelBuilder().setAppArtifact(appArtifact).addReloadableWorkspaceModule(appArtifact.getKey()).setPlatformImports(platformImports);
    final ApplicationDeploymentClasspathBuilder classpathBuilder = new ApplicationDeploymentClasspathBuilder(project, mode, enforcedPlatforms);
    final Configuration classpathConfig = classpathBuilder.getRuntimeConfiguration();
    final Configuration deploymentConfig = classpathBuilder.getDeploymentConfiguration();
    final Map<ArtifactKey, ResolvedDependencyBuilder> appDependencies = new LinkedHashMap<>();
    collectDependencies(classpathConfig.getResolvedConfiguration(), mode, project, appDependencies, modelBuilder, appArtifact.getWorkspaceModule().mutable());
    collectExtensionDependencies(project, deploymentConfig, appDependencies);
    for (ResolvedDependencyBuilder d : appDependencies.values()) {
        modelBuilder.addDependency(d.build());
    }
    return modelBuilder.build();
}
Also used : ApplicationDeploymentClasspathBuilder(io.quarkus.gradle.dependency.ApplicationDeploymentClasspathBuilder) ArtifactKey(io.quarkus.maven.dependency.ArtifactKey) Configuration(org.gradle.api.artifacts.Configuration) ResolvedConfiguration(org.gradle.api.artifacts.ResolvedConfiguration) ApplicationModelBuilder(io.quarkus.bootstrap.model.ApplicationModelBuilder) PlatformImports(io.quarkus.bootstrap.model.PlatformImports) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) ResolvedDependency(io.quarkus.maven.dependency.ResolvedDependency) ArtifactDependency(io.quarkus.maven.dependency.ArtifactDependency) Dependency(io.quarkus.maven.dependency.Dependency) DefaultExternalModuleDependency(org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency) ResolvedDependencyBuilder(io.quarkus.maven.dependency.ResolvedDependencyBuilder) LinkedHashMap(java.util.LinkedHashMap) LaunchMode(io.quarkus.runtime.LaunchMode)

Aggregations

ApplicationModelBuilder (io.quarkus.bootstrap.model.ApplicationModelBuilder)1 PlatformImports (io.quarkus.bootstrap.model.PlatformImports)1 ApplicationDeploymentClasspathBuilder (io.quarkus.gradle.dependency.ApplicationDeploymentClasspathBuilder)1 ArtifactDependency (io.quarkus.maven.dependency.ArtifactDependency)1 ArtifactKey (io.quarkus.maven.dependency.ArtifactKey)1 Dependency (io.quarkus.maven.dependency.Dependency)1 ResolvedDependency (io.quarkus.maven.dependency.ResolvedDependency)1 ResolvedDependencyBuilder (io.quarkus.maven.dependency.ResolvedDependencyBuilder)1 LaunchMode (io.quarkus.runtime.LaunchMode)1 LinkedHashMap (java.util.LinkedHashMap)1 Configuration (org.gradle.api.artifacts.Configuration)1 ResolvedConfiguration (org.gradle.api.artifacts.ResolvedConfiguration)1 DefaultExternalModuleDependency (org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency)1