sbt / sbt/sbt-eclipse

Setting output folder for unmanaged sources

Open
#255 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
712
Forks
163
PR merge metrics
No merged PRs in 30d

Description

I am working on a Java Play app, using Play 2.3.8 which depends on some external classes, in a project with non-standard directory structure. I want the sources to be loaded into Eclipse. Therefore I have the following in my build.sbt

lazy val beetle2Path = file(sys.env.get("BEETLE2PATH").getOrElse("/group/project/onrbee/beetle2"))
unmanagedSourceDirectories in Test += beetle2Path / "src/util"

This generates the following lines in my .classpath

 <classpathentry output="-afs-inf.ed.ac.uk-group-project-onrbee-myrosia-beetle2-src-util" kind="src" path="-afs-inf.ed.ac.uk-group-project-onrbee-myrosia-beetle2-src-util"/>

This results in Eclipse putting compiled classes together with source classes, which is undesirable, of course. Is there a way to set an output directory for unmanaged sources, so that the output could go to the "build" directory in that project tree, ideally? Or even to the default eclipse output directory?
Or am I doing something wrong with the build definition there?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the build.sbt settings and the generated .classpath entry for the unmanagedSourceDirectories setting. Trace how the source path and output path are selected, then verify that generated Eclipse metadata keeps unmanaged sources separate from compiled classes and uses the requested build or default output directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.