Skip to content

Commit

Permalink
Plugin test projects should not use "target/test-classes" in .classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Dec 11, 2023
1 parent cf168df commit 2b19d66
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ private void configureJavaProject(ProjectDescriptor descriptor, JavaProjectFacto
factory.addProjectNatures(JavaCore.NATURE_ID);
factory.addBuilderIds(JavaCore.BUILDER_ID);
for (SourceFolderDescriptor sourceFolder : descriptor.getSourceFolders()) {
String output = sourceFolder.isTest() ? (needsM2eIntegration(descriptor) ? "target/test-classes" : "test-bin") : null;
String output = sourceFolder.isTest() ?
(needsM2eIntegration(descriptor) ?
(needsTychoIntegration(descriptor) ?
"target/classes" : // Tycho will generate into target/classes for eclipse-plugin-test projects
"target/test-classes")
: "test-bin") : null;
factory.addSourceFolder(sourceFolder.getPath(), output, sourceFolder.isTest());
}
factory.setJreContainerEntry(JREContainerProvider.getJREContainerEntry(descriptor.getBree()));
Expand Down Expand Up @@ -287,6 +292,10 @@ private boolean needsM2eIntegration(ProjectDescriptor descriptor) {
return descriptor.isPartOfMavenBuild() && descriptor.getConfig().needsMavenBuild();
}

private boolean needsTychoIntegration(ProjectDescriptor descriptor) {
return descriptor.isPartOfMavenBuild() && descriptor.getConfig().needsTychoBuild();
}

private boolean needsBuildshipIntegration(ProjectDescriptor descriptor) {
return descriptor.isPartOfGradleBuild() && descriptor.getConfig().needsGradleBuild();
}
Expand Down

0 comments on commit 2b19d66

Please sign in to comment.