Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ private void registerTasks(Project project, QuarkusPluginExtension quarkusExt) {
QuarkusBuildDependencies.class,
task -> {
configureQuarkusBuildTask(project, task, quarkusBuildAppModelTask, serviceProvider);

task.getOutputs().doNotCacheIf("Dependencies are never cached", t -> true);
});
project.afterEvaluate(evaluated -> addDependencyOnJandexIfConfigured(evaluated, quarkusBuildDependencies));

Property<Boolean> cacheLargeArtifacts = quarkusExt.getCacheLargeArtifacts();

Expand Down Expand Up @@ -646,7 +646,7 @@ private void visitProjectDep(Project project, Project dep, Set<String> visited)
}

private void setupQuarkusBuildTaskDeps(Project project, Project dep, Set<String> visited) {
if (!visited.add(dep.getGroup() + ":" + dep.getName())) {
if (!visited.add(dep.getPath())) {
return;
}

Expand All @@ -663,18 +663,24 @@ private void setupQuarkusBuildTaskDeps(Project project, Project dep, Set<String>
});

getLazyTask(project, QUARKUS_DEV_TASK_NAME).ifPresent(quarkusDev -> {
for (String taskName : new String[] { JavaPlugin.PROCESS_RESOURCES_TASK_NAME,
// This is the task of the 'org.kordamp.gradle.jandex' Gradle plugin
"jandex",
// This is the task of the 'com.github.vlsi.jandex' Gradle plugin
"processJandexIndex" }) {
getLazyTask(dep, taskName).ifPresent(t -> quarkusDev.configure(qd -> qd.dependsOn(t)));
}
getLazyTask(project, JavaPlugin.PROCESS_RESOURCES_TASK_NAME)
.ifPresent(t -> quarkusDev.configure(qd -> qd.dependsOn(t)));
addDependencyOnJandexIfConfigured(dep, quarkusDev);
});

visitProjectDependencies(project, dep, visited);
}

private void addDependencyOnJandexIfConfigured(Project project, TaskProvider<? extends Task> quarkusTask) {
for (String taskName : new String[] {
// This is the task of the 'org.kordamp.gradle.jandex' Gradle plugin
"jandex",
// This is the task of the 'com.github.vlsi.jandex' Gradle plugin
"processJandexIndex" }) {
getLazyTask(project, taskName).ifPresent(t -> quarkusTask.configure(qd -> qd.mustRunAfter(t)));
}
}

protected void visitProjectDependencies(Project project, Project dep, Set<String> visited) {
final Configuration compileConfig = dep.getConfigurations().findByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME);
if (compileConfig != null) {
Expand All @@ -689,10 +695,10 @@ protected void visitProjectDependencies(Project project, Project dep, Set<String
.forEach(d -> {
Project depProject = null;

if (d instanceof ProjectDependency) {
depProject = dep.project(((ProjectDependency) d).getPath());
} else if (d instanceof ExternalModuleDependency) {
depProject = ToolingUtils.findIncludedProject(project, (ExternalModuleDependency) d);
if (d instanceof ProjectDependency projectDep) {
depProject = dep.project(projectDep.getPath());
} else if (d instanceof ExternalModuleDependency externalModuleDep) {
depProject = ToolingUtils.findIncludedProject(project, externalModuleDep);
}

if (depProject == null) {
Expand All @@ -711,13 +717,9 @@ protected void visitProjectDependencies(Project project, Project dep, Set<String
private void visitLocalProject(Project project, Project localProject, Set<String> visited) {
// local dependency, so we collect also its dependencies
visitProjectDep(project, localProject, visited);

ExtensionDependency<?> extensionDependency = DependencyUtils
.getExtensionInfoOrNull(project, localProject);

if (extensionDependency instanceof ProjectExtensionDependency) {
visitProjectDep(project,
((ProjectExtensionDependency) extensionDependency).getDeploymentModule(), visited);
ExtensionDependency<?> extensionDependency = DependencyUtils.getExtensionInfoOrNull(project, localProject);
if (extensionDependency instanceof ProjectExtensionDependency projectExtDep) {
visitProjectDep(project, projectExtDep.getDeploymentModule(), visited);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'io.quarkus'
id 'org.kordamp.gradle.jandex' // this plugin is applied to make the dependencies on the Jandex tasks are properly setup and the build doesn't fail
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subprojects {
}

dependencies {
implementation 'io.quarkus:quarkus-resteasy'
implementation 'io.quarkus:quarkus-rest'

implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'io.quarkus'
id 'java-library'
id "org.kordamp.gradle.jandex" version "1.1.0"
id 'org.kordamp.gradle.jandex'
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformGroupId=io.quarkus
quarkusPlatformGroupId=io.quarkus
kordampJandexVersion=2.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pluginManagement {

plugins {
id 'io.quarkus' version "${quarkusPluginVersion}"
id 'org.kordamp.gradle.jandex' version "${kordampJandexVersion}"
}
}

Expand Down
Loading