Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jandex plugin from flaky test #15153

Merged
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 @@ -47,7 +47,6 @@

import io.quarkus.bootstrap.BootstrapConstants;
import io.quarkus.bootstrap.model.AppArtifactKey;
import io.quarkus.bootstrap.resolver.QuarkusGradleModelFactory;
import io.quarkus.bootstrap.resolver.model.ArtifactCoords;
import io.quarkus.bootstrap.resolver.model.Dependency;
import io.quarkus.bootstrap.resolver.model.ModelParameter;
Expand All @@ -68,6 +67,9 @@

public class QuarkusModelBuilder implements ParameterizedToolingModelBuilder<ModelParameter> {

private static final String MAIN_RESOURCES_OUTPUT = "build/resources/main";
private static final String CLASSES_OUTPUT = "build/classes";

private static Configuration classpathConfig(Project project, LaunchMode mode) {
if (LaunchMode.TEST.equals(mode)) {
return project.getConfigurations().getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME);
Expand Down Expand Up @@ -339,7 +341,7 @@ private void collectDependencies(ResolvedConfiguration configuration,
a.getId().getComponentIdentifier() instanceof ProjectComponentIdentifier) {
IncludedBuild includedBuild = includedBuild(project, a.getName());
if (includedBuild != null) {
addSubstitutedProject(dep, includedBuild.getProjectDir(), mode);
addSubstitutedProject(dep, includedBuild.getProjectDir());
} else {
Project projectDep = project.getRootProject()
.findProject(((ProjectComponentIdentifier) a.getId().getComponentIdentifier()).getProjectPath());
Expand Down Expand Up @@ -413,13 +415,25 @@ private void addDevModePaths(final DependencyImpl dep, ResolvedArtifact a, Proje
}
}

private void addSubstitutedProject(final DependencyImpl dep, File projectFile, LaunchMode mode) {
final QuarkusModel quarkusModel = QuarkusGradleModelFactory.create(projectFile, mode.name());
final io.quarkus.bootstrap.resolver.model.SourceSet moduleOutput = quarkusModel.getWorkspace().getMainModule()
.getSourceSet();
dep.addPath(moduleOutput.getResourceDirectory());
for (File sourceDirectory : moduleOutput.getSourceDirectories()) {
dep.addPath(sourceDirectory);
private void addSubstitutedProject(final DependencyImpl dep, File projectFile) {
File mainResourceDirectory = new File(projectFile, MAIN_RESOURCES_OUTPUT);
if (mainResourceDirectory.exists()) {
dep.addPath(mainResourceDirectory);
}
File classesOutput = new File(projectFile, CLASSES_OUTPUT);
File[] languageDirectories = classesOutput.listFiles();
if (languageDirectories == null) {
throw new GradleException(
"The project does not contain a class output directory. " + classesOutput.getPath() + " must exist.");
}
for (File languageDirectory : languageDirectories) {
if (languageDirectory.isDirectory()) {
for (File sourceSet : languageDirectory.listFiles()) {
if (sourceSet.isDirectory() && sourceSet.getName().equals(SourceSet.MAIN_SOURCE_SET_NAME)) {
dep.addPath(sourceSet);
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
plugins {
id 'java'
id 'io.quarkus'
id "org.kordamp.gradle.jandex" version '0.6.0'
}

repositories {
Expand Down