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

Refactoring: dont remove and re-add output dirs from classpath #558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/main/java/sbt_inc/SbtIncrementalCompiler.java
Expand Up @@ -152,13 +152,10 @@ public void compile(
Path classesDirectory,
List<String> scalacOptions,
List<String> javacOptions) {
List<Path> fullClasspath = new ArrayList<>();
fullClasspath.add(classesDirectory);
fullClasspath.addAll(classpathElements);

CompileOptions options =
CompileOptions.of(
fullClasspath.stream()
classpathElements.stream()
.map(PlainVirtualFile::new)
.toArray(VirtualFile[]::new), // classpath
sources.stream().map(PlainVirtualFile::new).toArray(VirtualFile[]::new), // sources
Expand Down
1 change: 0 additions & 1 deletion src/main/java/scala_maven/ScalaCompileMojo.java
Expand Up @@ -71,7 +71,6 @@ protected List<File> getSourceDirectories() throws Exception {
@Override
protected Set<File> getClasspathElements() throws Exception {
final Set<File> back = FileUtils.fromStrings(project.getCompileClasspathElements());
back.remove(new File(project.getBuild().getOutputDirectory()));
addAdditionalDependencies(back);
if (classpath != null && classpath.getAdd() != null) {
getLog().warn("using 'classpath' is deprecated, use 'additionalDependencies' instead");
Expand Down
1 change: 0 additions & 1 deletion src/main/java/scala_maven/ScalaCompilerSupport.java
Expand Up @@ -357,7 +357,6 @@ private int incrementalCompile(
instance);
}

classpathElements.remove(outputDir);
List<String> scalacOptions = getScalaOptions();
List<String> javacOptions = getJavacOptions();

Expand Down
1 change: 0 additions & 1 deletion src/main/java/scala_maven/ScalaTestCompileMojo.java
Expand Up @@ -60,7 +60,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
@Override
protected Set<File> getClasspathElements() throws Exception {
Set<File> back = FileUtils.fromStrings(project.getTestClasspathElements());
back.remove(new File(project.getBuild().getTestOutputDirectory()));
addAdditionalDependencies(back);
return back;
}
Expand Down