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

Compile / unmanagedSourceDirectories not working anymore when using projectMatrix #83

Open
kostaskougios opened this issue Sep 28, 2023 · 1 comment

Comments

@kostaskougios
Copy link

I tried to use sbt-projectmatrix today but got into an issue with my generated source files. i.e.

lazy val ls = projectMatrix
  .jvmPlatform(scalaVersions = Seq(scala3Version))
  .settings(
    Compile / unmanagedSourceDirectories += baseDirectory.value / "src" / "main" / "generated"
  )

When I was using project, the generated folder was correctly seen as a src directory and scala files were compiling. When using projectMatrix, the generated folder is not seen as a source directory (when running with sbt and also in IntelliJ after reimporting)

@keynmol
Copy link
Contributor

keynmol commented Sep 28, 2023

@kostaskougios I believe this is because projectmatrix hijacks the baseDirectory value and sets it to

.sbt/matrix/<module-name>

I think in your case you can use sourceDirectory.value which the plugin keeps sane: https://github.com/sbt/sbt-projectmatrix/blob/develop/src/main/scala/sbt/internal/ProjectMatrix.scala#L269

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