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

scalafmtOnCompile bad interaction with mixed scalaVersion build #47

Open
eed3si9n opened this issue Aug 25, 2017 · 2 comments
Open

scalafmtOnCompile bad interaction with mixed scalaVersion build #47

eed3si9n opened this issue Aug 25, 2017 · 2 comments

Comments

@eed3si9n
Copy link

eed3si9n commented Aug 25, 2017

steps

  1. using sbt 1 with addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
  2. scalafmtOnCompile := true
  3. Suppose we have a multi-project build where utilLogging project supports Scala 2.10 and 2.12 but utilCache supports only 2.12 and that utilCache depends on utilLogging.
  4. +compile

problem

During the + cycle, onLoad hook gets triggered even when scalaVersions do not match up, calling utilCache/update. This causes resolution error saying utilLogging_2.12 can't be found from external resolvers.

expectation

No errors.

notes

The following workaround seems to work for me:

    inThisBuild(
      Seq(
        scalafmtOnCompile := true,
        scalafmtOnCompile in Sbt := false,
      )),
@drewhk
Copy link

drewhk commented Sep 12, 2017

I think I have a very similar issue, except I see broken classfile exceptions (likely because we have exportJars in some subprojects)

@drewhk
Copy link

drewhk commented Sep 13, 2017

My issue is likely unrelated, so please ignore it.

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