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

Test-Dependencies in Multiprojects #9

Open
atais opened this issue Aug 23, 2017 · 2 comments
Open

Test-Dependencies in Multiprojects #9

atais opened this issue Aug 23, 2017 · 2 comments

Comments

@atais
Copy link

atais commented Aug 23, 2017

Hello,

I have a cross-compiled project common which contains classes in src/test/scala that I want to share with other modules (in tests).

Following SO: https://stackoverflow.com/questions/8193904/sbt-test-dependencies-in-multiprojects-make-the-test-code-available-to-dependen

I wanted to make it as such:

lazy val common = (project in file("common"))
  .settings(...)
  .cross

lazy val common_2_11 = common("2.11.8")
lazy val common_2_10 = common("2.10.6")

lazy val project1= (project in file("project1"))
  .settings(...)
  .dependsOn(common_2_11 % "compile->compile;test->test")

But later I have also

lazy val main = (project in file("."))
  .aggregate(project1, project2, project3)
  .settings(
    ...
  )

And I get a following error:

[info] Loading project definition from 
/home/project
/home/project/build.sbt:194: error: type mismatch;
 found   : com.lucidchart.sbtcross.BaseProject
 required: sbt.ProjectReference
  .aggregate(project1, project2, project3)
                ^
sbt.compiler.EvalException: Type error in expression

How can I solve this?

@mhertogs
Copy link

I ran into this issue and was able to fix using following code:

.dependsOn(new sbt.Project.Constructor(common_2_11).%("compile->compile;test->test"))

@er1c
Copy link

er1c commented Jun 17, 2020

this killed me, spent 3 hours on this today!

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

3 participants