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

Scala cross-version support for shared source directory #2005

Closed
fthomas opened this issue Nov 6, 2015 · 3 comments
Closed

Scala cross-version support for shared source directory #2005

fthomas opened this issue Nov 6, 2015 · 3 comments
Assignees
Labels
enhancement Feature request (that does not concern language semantics, see "language")
Milestone

Comments

@fthomas
Copy link
Contributor

fthomas commented Nov 6, 2015

Since version 0.13.8, sbt adds Scala version specific source directories to unmanagedSources, see sbt/sbt#1799 or https://github.com/sbt/sbt/blob/0.13.8/notes/0.13.8.markdown#cross-version-support-for-scala-sources. That means that besides src/main/scala src/main/scala-2.x is added to the list of source directories. This is extremely useful for projects that target multiple Scala versions but want to use different sources per version.

Unfortunately a Scala.js CrossProject with CrossType.Full does not yet add Scala version specific directories for the shared source directory. This is unmanagedSourceDirectories for one of my projects:

> coreJVM/unmanagedSourceDirectories
[info] List(
  $PROJECT_ROOT/core/jvm/src/main/scala-2.11,
  $PROJECT_ROOT/core/jvm/src/main/scala,
  $PROJECT_ROOT/core/jvm/src/main/java,
  $PROJECT_ROOT/core/shared/src/main/scala)
> coreJS/unmanagedSourceDirectories
[info] List(
  $PROJECT_ROOT/core/js/src/main/scala-2.11,
  $PROJECT_ROOT/core/js/src/main/scala,
  $PROJECT_ROOT/core/js/src/main/java,
  $PROJECT_ROOT/core/shared/src/main/scala)

Ideally both lists should also contain $PROJECT_ROOT/core/shared/src/main/scala-2.11.

@sjrd
Copy link
Member

sjrd commented Nov 6, 2015

That would make sense, indeed.

@sjrd sjrd added the enhancement Feature request (that does not concern language semantics, see "language") label Nov 6, 2015
@ghost
Copy link

ghost commented Dec 25, 2015

@sjrd sjrd added this to the v0.6.7 milestone Feb 1, 2016
@sjrd sjrd self-assigned this Feb 2, 2016
@sjrd sjrd added the has-pr label Feb 6, 2016
nicolasstucki added a commit that referenced this issue Feb 8, 2016
Fix #2005: Add cross-version shared source directories.
@fthomas
Copy link
Contributor Author

fthomas commented Feb 8, 2016

Awesome, thanks for implementing this!

@sjrd sjrd removed the has-pr label Feb 11, 2016
sjrd added a commit to sjrd/scala-js-env-phantomjs that referenced this issue May 20, 2017
sjrd added a commit to sjrd/jsdependencies that referenced this issue Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request (that does not concern language semantics, see "language")
Projects
None yet
Development

No branches or pull requests

2 participants