Code Monkey home page Code Monkey logo

Comments (8)

DavidGregory084 avatar DavidGregory084 commented on July 16, 2024 4

Sorry for the silence on this one folks - I'm going mad trying to find a way to solve this without breaking any of the previous behaviours of the library and while still accomodating the ways that folks set the various keys of the library. The combination of +=, ++= and sbt scope delegation is very hard to navigate.

from sbt-tpolecat.

BalmungSan avatar BalmungSan commented on July 16, 2024 1

Sorry for adding more salt to the wound, but I just found that sbt-tpolecat also causes problems with metals / semanticdb; where this plugin ends up removing the required scalac flags for it to work properly.

Apparently, the issue is related to the exclusions rule.
I didn't test with main sources, but if I do this:

Test / tpolecatExcludeOptions ++= ScalacOptions.defaultConsoleExclude

Then metals is broken on the test files.

from sbt-tpolecat.

sjrd avatar sjrd commented on July 16, 2024 1

PR available: #126

from sbt-tpolecat.

objektwerks avatar objektwerks commented on July 16, 2024

I just stumbled across this issue via this project ( github.com/objektwerks/scalajs/blob/master/build.sbt ). To avoid getting this error during sbt clean test ( java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val ), I had to add scalacOptions ++= Seq("-scalajs") to the build.sbt. Apparently sbt-tpolecat was removing the -scalajs option added by the Scalajs plugin ( addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1") ).

from sbt-tpolecat.

DavidGregory084 avatar DavidGregory084 commented on July 16, 2024

Unfortunately the obvious fix to this - appending the existing scalacOptions.value to the resulting scalacOptions after this plugin is applied - doesn't resolve the issue, or at least it causes more issues.
I've started a discussion in sbt (sbt/sbt#6986) about how to resolve this so hopefully we will get some good advice there.

from sbt-tpolecat.

objektwerks avatar objektwerks commented on July 16, 2024

Beyond simple tasks, Sbt is like an extreme sport. So be careful. :)

from sbt-tpolecat.

davesmith00000 avatar davesmith00000 commented on July 16, 2024

Just bumping this issue, it only occurred for me when I tried to go from sbt-tpolecat version 0.3.1 to 0.4.1. Same output as originally shown:

[info] Running scalafix on 1 Scala sources (incremental)
[warn] The `-scalajs` flag was missing from `compile / scalacOptions`, but it is required to produce Scala.js IR.
[warn] Linking, running and/or testing will probably go wrong.
[warn] The most likely cause is that you used `scalacOptions := ...` instead of using `++=`.

from sbt-tpolecat.

keynmol avatar keynmol commented on July 16, 2024

I can confirm that reproducer no longer works with a locally published version of the plugin 🎉

from sbt-tpolecat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.