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

Wrong defaults for CrossProject builds in EclipseKeys.eclipseOutput #330

Open
Bathtor opened this issue Feb 13, 2017 · 2 comments
Open

Wrong defaults for CrossProject builds in EclipseKeys.eclipseOutput #330

Bathtor opened this issue Feb 13, 2017 · 2 comments

Comments

@Bathtor
Copy link

Bathtor commented Feb 13, 2017

There appears to be an issue with shared sources in ScalaJS crossProject builds with Eclipse.

Consider a standard setup of

lazy val test = crossProject.in(file(".")).
  settings(
    name := "Test",
    EclipseKeys.useProjectId := true
  ).
  jvmSettings(
    libraryDependencies += "org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided"
  ).
  jsSettings(
    libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.1"
  )

If I import into eclipse like this, Eclipse finds the shared folders, but it sets their output folders to the source folder. See (from .classpath in the JS project):

  <classpathentry kind="src" path="src/main/scala"/>
  <classpathentry kind="src" path="src/main/resources"/>
  <classpathentry kind="src" path="src/test/scala"/>
  <classpathentry kind="src" path="src/test/resources"/>
  <classpathentry output="-Users-lkroll-Documents-Programming-test-shared-src-main-scala" kind="src" path="-Users-lkroll-Documents-Programming-test-shared-src-main-scala"/>
  <classpathentry output="-Users-lkroll-Documents-Programming-test-shared-src-test-scala" kind="src" path="-Users-lkroll-Documents-Programming-test-shared-src-test-scala"/>

When I set eclipseOutput manually to some other folder, it generates the correct output, as seen below.

lazy val test = crossProject.in(file(".")).
  settings(
    name := "Test",
    EclipseKeys.useProjectId := true,
    EclipseKeys.eclipseOutput := Some("./etarget")
  ).
  jvmSettings(
    libraryDependencies += "org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided"
  ).
  jsSettings(
    libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.1"
  )
<classpathentry output="./etarget" kind="src" path="src/main/scala"/>
  <classpathentry output="./etarget" kind="src" path="src/main/resources"/>
  <classpathentry output="./etarget" kind="src" path="src/test/scala"/>
  <classpathentry output="./etarget" kind="src" path="src/test/resources"/>
  <classpathentry output="./etarget" kind="src" path="-Users-lkroll-Documents-Programming-test-shared-src-main-scala"/>
  <classpathentry output="./etarget" kind="src" path="-Users-lkroll-Documents-Programming-test-shared-src-test-scala"/>

I don't know how sbt-eclipse decides what output path to default to when eclipseOutput is None, but at least in this case it's not the right thing.
This might, of course, be an issue on the ScalaJS plugin side, I don't know.

Edit: Sorry forgot to write versions:

  • sbt 0.13.12
  • sbteclipse 5.1.0
  • sbtscalajs 0.6.14
@Blaisorblade
Copy link
Contributor

Possibly affected by fix to #352 (in https://github.com/sbt/sbteclipse/pull/355/files) since that's also about eclipseOutput defaults?

@Bathtor
Copy link
Author

Bathtor commented Feb 19, 2018

I just tried with sbteclipse 5.2.4 (which I think includes that commit) and the issue still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants