Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 22 2015 11:10
    japgolly commented #2066
  • Jun 22 2015 08:25
    keepscoding commented #2044
  • Jun 21 2015 03:24
    xerial commented #157
  • Jun 21 2015 00:10
    eed3si9n unlabeled #2057
  • Jun 21 2015 00:10

    eed3si9n on 0.13

    Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 3 more (compare)

  • Jun 21 2015 00:10
    eed3si9n closed #2057
  • Jun 21 2015 00:10

    eed3si9n on fixbuild

    (compare)

  • Jun 20 2015 18:42
    eed3si9n synchronize #2057
  • Jun 20 2015 18:42

    eed3si9n on fixbuild

    Fix typo (compare)

  • Jun 20 2015 18:23

    eed3si9n on fixbuild

    Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 1 more (compare)

  • Jun 20 2015 18:23
    eed3si9n synchronize #2057
  • Jun 20 2015 14:59

    eed3si9n on scalaversionbump

    (compare)

  • Jun 20 2015 14:59

    eed3si9n on 0.13

    Bumping up Scala version to 2.1… Try to keep bincompat Fixes #1666 and 1 more (compare)

  • Jun 20 2015 14:59
    eed3si9n unlabeled #2068
  • Jun 20 2015 14:59
    eed3si9n closed #2068
  • Jun 20 2015 14:59
    eed3si9n closed #1666
  • Jun 20 2015 14:57
    eed3si9n commented #2068
  • Jun 20 2015 12:55
    dwijnand commented #2068
  • Jun 20 2015 04:51
    eed3si9n synchronize #2068
  • Jun 20 2015 04:51

    eed3si9n on scalaversionbump

    Fixes #1666 (compare)

Hanns Holger Rutz
@Sciss
when using versionScheme, a <properties> section is added to pom, and if I already have pomExtra := { <properties>...</properties> }, sonatype will complain that the POM is invalid as it has two properties entries. Can I add to the properties section?
Ok, I think I need to use pomPostProcess instead
ggpeti
@ggpeti:ggpeti.com
[m]
next question though, is there a way to override a setting from the command line? specifically, I'd like to set crossPaths to false without changing build.sbt, if possible
1 reply
Adelin
@AdelinGhanaem

Hi Everyone, not sure if this is the right place to ask for some help I have a very strange issue with "sbt" dependsOn. When have foo dependsOn(bar) should foo see all libs included in bar? In my case it doesn't neither source codes nor libs.

So the problem was that dependant project is contained some "provided" dependencies and it seems provided dependencies are not inherited by child projects, they need to be defined in the child project as well

Raul Rodriguez
@raul782

Hey folks,

object Tasks {

  /** Creates a runnable sbt task that can be added to application settings in Build.scala or build.sbt
   *
   * @param name        The name used to invoke the task via sbt.
   * @param className   The fully qualified package/className of the `Runnable` task (e.g. com.jaroop.tasks.MyTask).
   * @param description A short description of the task shown when running `sbt tasks`.
   * @return The sbt task to include in sbt settings for an application.
   */
  def register(name: String, className: String, description: String): Setting[InputTask[Unit]] =
    InputKey[Unit](name, description) := Def.inputTaskDyn {
      Def.task {
        val classLoader = new URLClassLoader(dependencyClasspath.value.map(_.data.toURI.toURL).toArray, null)
        val taskClass = classLoader.loadClass(className)
        val args = spaceDelimited("<arg>").parsed.mkString(",")
        val task = taskClass.getConstructor(classOf[String]).newInstance(args).asInstanceOf[Runnable]
        task.run()
      }
    }


  val registeredTasks = Seq(
    register("greeter", "com.company.tasks.Greeter", "Prints a greeting")
  )
}

How do I register this task in sbt?

val scala3Version = "3.0.0"

lazy val root = project
  .in(file("."))
  .settings(
    name := "company",
    version := "0.1.0",

    scalaVersion := scala3Version,

    libraryDependencies ++=
      Seq(
        "com.softwaremill.sttp.client3" %% "core" % "3.3.5",
        "com.novocode" % "junit-interface" % "0.11" % "test"
      ),
    Tasks.registeredTasks
  )
I've tried this, but when running the task it's not getting executed, what am I missing?
audacioustux
@audacioustux:matrix.org
[m]
:point_up: Edit: Hi.. complete noob here. not sure if it's related to sbt-jmh or jmh.. i was trying to reuse Context of org.graalvm.polyglot package in scala3. Context build only working inside methods, but not when using as object val https://github.com/audacioustux/graalpolyscalafail/blob/main/src/main/scala/bench/PolyCtxBench.scala here's repo to reproduce
audacioustux
@audacioustux:matrix.org
[m]
:point_up: Edit: Hi.. complete noob here. not sure if it's related to sbt-jmh or jmh..
i was working with org.graalvm.polyglot in scala3. Context build() works fine inside methods but not as a object/class val. so as a result i can't re-use the Context.
i'm getting error: java.lang.NoClassDefFoundError: org/graalvm/polyglot/Context.
it's somehow related to jmh, because it works properly when not using jmh.
i've already tried:
  1. Compile·/·run·:=·Defaults.runTask(Compile·/·fullClasspath,·Compile·/·run·/·mainClass,·Compile·/·run·/·runner).evaluated in build.sbt
  2. with/without "provided" on "org.graalvm.sdk" package
  3. scala 3 and 2
  4. removing target/ .bloop/
  5. using java.util.ArrayList in the same manner... (it works)
  6. using external java library in the same manner... (it works)
    to reproduce: https://github.com/audacioustux/graalpolyscalafail/blob/main/src/main/scala/bench/PolyCtxBench.scala
audacioustux
@audacioustux:matrix.org
[m]

:point_up: Edit: Hi.. complete noob here. not sure if it's related to sbt-jmh or jmh..

i was working with org.graalvm.polyglot in scala3. Context build() works fine inside methods but not as a object/class val. so as a result i can't re-use the Context.
i'm getting error: java.lang.NoClassDefFoundError: org/graalvm/polyglot/Context.
it's somehow related to jmh, because it works properly when not using jmh.
i've already tried:

  1. Compile·/·run·:=·Defaults.runTask(Compile·/·fullClasspath,·Compile·/·run·/·mainClass,·Compile·/·run·/·runner).evaluated in build.sbt
  2. with/without "provided" on "org.graalvm.sdk" package
  3. scala 3 and 2
  4. removing target/ .bloop/
  5. using java.util.ArrayList in the same manner... (it works)
  6. using external java library (https://github.com/florianingerl/com.florianingerl.util.regex) in the same manner... (it works)
    to reproduce: https://github.com/audacioustux/graalpolyscalafail/blob/main/src/main/scala/bench/PolyCtxBench.scala

:point_up: Edit: Hi.. complete noob here. not sure if it's related to sbt-jmh or jmh..

i was working with org.graalvm.polyglot in scala3. Context build() works fine inside methods but not as a object/class val. so as a result i can't re-use the Context.
i'm getting error: java.lang.NoClassDefFoundError: org/graalvm/polyglot/Context.
it's somehow related to jmh, because it works properly when not using jmh.
i've already tried:

  1. Compile·/·run·:=·Defaults.runTask(Compile·/·fullClasspath,·Compile·/·run·/·mainClass,·Compile·/·run·/·runner).evaluated in build.sbt
  2. with/without "provided" on "org.graalvm.sdk" package
  3. scala 3 and 2
  4. removing target/ .bloop/
  5. using java.util.ArrayList in the same manner... (it works)
  6. using external java library (com.florianingerl.util.regex) in the same manner... (it works)
    to reproduce: https://github.com/audacioustux/graalpolyscalafail/blob/main/src/main/scala/bench/PolyCtxBench.scala
Siddhant Sanyam
@siddhant3s
When I'm running sbt console, sbt will add all the JARs of the dependency in the class path right? Is there a way I can get (as a list) what these jar files are ? I don't want to create a fat jar, but I would like to get the list of jars so that I can package it in a custom way ( figure out which one of these jar files might be already available on a given deployment and not include it).
1 reply
Nikitha963
@Nikitha963

Hi All,

templatesImport ++= Seq(
        "views.html.helper._",
        "polaris._",
        "polaris.api._",
        "polaris.models._",
        "polaris.core._",
        "polaris.core.util._",
        "polaris.core.views.html._"
)

I have above syntax in multi project module in build.sbt file and getting below error:

build.sbt:29: error: not found: value templatesImport
templatesImport += Seq(
^

Kindly help me here . I tried to write like :

TwirlKeys.templateImports ++= Seq(
        "views.html.helper._",
        "polaris._",
        "polaris.api._",
        "polaris.models._",
        "polaris.core._",
        "polaris.core.util._",
        "polaris.core.views.html._"
)

Then also I am facing the issue like below :

[error] References to undefined settings: 
[error] 
[error]   pbxAppPhonebook/*:twirlTemplateImports from pbxAppPhonebook/*:twirlTemplateImports (/home/nikitha/Documents/Polaris/polaris_sbt_play_scala_upgrade_version/polaris-upgrade-sbt-1.3.0/modules/pbx-app-phonebook/build.sbt:20)
[error]
Hanns Holger Rutz
@Sciss

I have a problem when using a ProjectRef to a crossproject:

val scalaColliderURI    = uri("git://github.com/Sciss/ScalaCollider.git#v2.6.4")
val lScalaCollider      = ProjectRef(scalaColliderURI, "rootJVM")

ThisBuild / scalaVersion := "2.13.6"

val snippets = project.withId("scalacollider-snippets").in(file("snippets"))
  .dependsOn(lScalaCollider)

sbt (1.5.3) complains that

[error] Modules were resolved with conflicting cross-version suffixes in ProjectRef(uri("file:/home/hhrutz/Documents/devel/ScalaCollider/site/"), "scalacollider-snippets"):
[error]    de.sciss:scalacollider _2.13, _2.12

what to do?

when I remove scalacollider-snippets from the build (which has actually site project), it works, but of course I don't get my snippets compile-time verified. I don't understand where that _2.12 comes from
Nikitha963
@Nikitha963

Hi All,

sbt run gives below error :

java.io.IOException: User limit of inotify watches reached
    at sun.nio.fs.LinuxWatchService$Poller.implRegister(LinuxWatchService.java:264)
    at sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:260)
    at sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:364)
    at java.lang.Thread.run(Thread.java:748)
[trace] Stack trace suppressed: run 'last polaris/compile:run' for the full output.
[error] (polaris/compile:run) java.io.IOException: User limit of inotify watches reached
[error] Total time: 2 s, completed Jun 11, 2021 2:46:48 PM
[ERROR] Failed to construct terminal; falling back to unsupported
Siddhant Sanyam
@siddhant3s
How do you guys run your programs? Of course we can have an sbt session running and then simply use the run command. But in this case, I would like to run my program from commandline when sbt is not running. Since this program is being invoked by a wrapper script. Now I can do sbt run and that works. But it takes time to start sbt and then run it.
I wish there was a way to ask SBT to give me an equivalent java -cp command that I can use to run the current compiled project. That way I can simply put sbt ~compile to automatically compile if any source changes. But apart from it, running the program would be relatively quick.
DavidGoodenough
@DavidGoodenough
@siddhant3s use sbt-assembly to build a fat jar and the run with Java -jar
Siddhant Sanyam
@siddhant3s
@DavidGoodenough But building assembly can take time. I really am not looking for the whole re-zipping all the class files into one zip file. I just want JVM to start with those separate class files.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
show <module>/fullClasspath from SBT and piping that into a java -cp ... command should be totally possible
Tanin Na Nakorn
@tanin_twitter

Just in case anyone here knows: I can't publish my sbt-web plugin to sonatype (sbt publishSigned). It raises this error:

{"message":"Organization sbt-web was not found"}

full error:

error uploading to io.github.tanin47/sbt-vuefy/scala_2.12/sbt_1.0/6.0.0/srcs/sbt-vuefy-sources.jar: {"message":"Organization sbt-web was not found"}

Used to publish to bintray without any issue. Anyone knows how to fix this error?

Bartosz Bąbol
@BBartosz

I have additional question to answer which @eed3si9n gave in this thread: https://stackoverflow.com/questions/53129745/how-to-create-a-generic-sbt-root-project-with-varying-sub-projects. Lets say I am able to automatically discover subprojects in sbt in the way Eugene explained in this stack overflow answer. Now i would like to know how i can access those discovered projects in main build.sbt ?

What i would like to achieve is something like below:

lazy val services =
  project
    .in(file("services"))
    .dependsOn(SubprojectPlugin.extraProjects:_*)
Bartosz Bąbol
@BBartosz

I have additional question to answer which @eed3si9n gave in this thread: https://stackoverflow.com/questions/53129745/how-to-create-a-generic-sbt-root-project-with-varying-sub-projects. Lets say I am able to automatically discover subprojects in sbt in the way Eugene explained in this stack overflow answer. Now i would like to know how i can access those discovered projects in main build.sbt ?

What i would like to achieve is something like below:

lazy val services =
  project
    .in(file("services"))
    .dependsOn(SubprojectPlugin.extraProjects:_*)

I checked project api and blindly tried:

lazy val services =
  project
    .in(file("services"))
    .dependsOn(SubprojectPlugin.extraProjects.flatMap(_.dependencies):_*)

Looks like its doing what I want

Bartosz Bąbol
@BBartosz
Edit: actually _.dependencies returns me dependencies of Project (which is kinda obvious looking just by name of method). So my still open question is: How to convert sbt.Project into ClasspathDep[sbt.ProjectReference] ?
Dmitry Polienko
@nigredo-tori
@BBartosz, there's an implicit conversion Project => LocalProject, the latter being a subtype of ProjectReference. Not sure why this doesn't get applied. You can make ProjectReferences explicitly, with SubprojectPlugin.extraProjects.map(Project.projectToRef): _*.
eugene yokota
@eed3si9n
sbt 1.5.4 is released - https://eed3si9n.com/sbt-1.5.4
Michael Lewis
@lewismj
Hi, I'm updating an old SBT plugin that I wrote. I've not really been up-to-date with the recent changes, waiting for Scala 3 etc.
Seems the changes could be quite substantial,
I've lots of code for the plugin of the type:
val mainClass = SettingKey[String]("cucumber-main-class")
Which is now giving me errors: Scala 2 macro cannot be used in Dotty, this call will crash at runtime.
So, I'm not sure if this means a re-write or not. Is there anything I can read-online that details the changes? (I'm also getting random errors: ***** missing reference, looking for Serializable/T in package scala, anyone have any ideas on what is going on? I just changed the scala version and sbt version to the most recent, getting lots of errors...
Rich
@Rich2
Can I add a specific file to the unmanagedSource Directories or do I need to add the whole directory and filter it?
Eric K Richardson
@ekrich
@lewismj SBT plugins are limited to Scala 2.12 which is used by sbt itself.
Michael Lewis
@lewismj

@lewismj SBT plugins are limited to Scala 2.12 which is used by sbt itself.

thanks, for some reason, I thought that it was now all Scala 3.

Michael Lewis
@lewismj
Out of interest, Is there a goal to get SBT onto Scala 3 itself?
Eric K Richardson
@ekrich
I don't know the plan there. Maybe 2.13 first?
Mark Hamilton
@mhamilton723
hey all, I made my project use subprojects and now my maven artifacts have a _1.0 suffix on them. Is this normal behavior and is there a way to turn this off?
Eric K Richardson
@ekrich
@lewismj :point_up: June 15, 2021 2:53 PM and a post by me a few up and answer.
Martijn
@martijnhoekstra:matrix.org
[m]
Only of they are sbt plugins @mhamilton723 , the that suffix indicates its built against sbt 1.x rather than 0.13.x
eikek
@eikek:matrix.org
[m]
Hi! I'm a bit confused about a multi project build that cross-compiles against scala 2.12,13 and 3. There is a core project that everyone depends on. Now a new project is added that uses a dependency not available for scala3 (akka). So I excluded scala3 for this one module. by overwriting crossScalaVerisons key in this module to contain only scala 2. When compiling, an error appears saying to add the -Ytasty-reader option to be able to compile against a class from the core module. Now I'm confused, because doesn't this mean that it tries to compile the akka project against a scala 3 artifact of the core?
When I add the -Ytasty-reader option to scalac2 options, it's working. Another way is to set crossScalaVersions to be empty in the root project (that aggregates all) - the error is gone without the -Ytasty-reader option. Which one should I use and why? Thanks!
4 replies
eikek
@eikek:matrix.org
[m]
shvahabi: thank you a lot! Going to try it out tonight! I'm confused because I thought it should not even try to compile against the scala3 artifact when the project in question is only available for scala2. Guess I have to read up a bit regarding scala2-3 cross compilation:)
3 replies
eikek
@eikek:matrix.org
[m]
Ah I see now what for3Use2_13 is for. I publish my core library for all scala versions. Then there is one subproject depending on akka, that is 2.13 only - would it make sense to publish this subproject for scala3, too
Eric K Richardson
@ekrich
It is super helpful. Scala 3 can use Java and Scala 2.13 seamlessly.
eikek
@eikek:matrix.org
[m]
Yes, this is really amazing!
i.e. that Scala 2.13 can consume Scala 3 …
Eric K Richardson
@ekrich
The Scala/Dotty team really did their homework - didn't want to repeat the Python 2 -> 3 scenario. Scala 3 is very cool.
I think the Tasty feature should really be helpful.
eikek
@eikek:matrix.org
[m]
Yes. I'm really looking forward to get more into scala 3. I tried the other day a little but had to fight with my emacs a bit too much :-)
Eric K Richardson
@ekrich
Are you using metals?
eikek
@eikek:matrix.org
[m]
Yes, and I wanted to use the new syntax. But I think scala-mode is not there yet. It was working fine from sbt's perspective (except the goodies like scalafmt and scalafix weren't working); only editing was a bit painful
Andreas Flierl
@asflierl
hmm... is consoleProject working for anyone when using sbt -client ? console looks fine but consoleProject throws an IOException "Stream Closed" immediately
Bjorn Regnell
@bjornregnell
@eed3si9n Could we introduce sbt init defaulting to sbt new scala/scala3.g8; easier to remember for me and less to type for a beginner... ?
Michael Lewis
@lewismj
Just upgrading a few things, and I'm getting errors Some keys were defined with the same name but different types: 'pgpSigningKey' (sbt.Task[scala.Option[java.lang.String]], scala.Option[Long]) I can see that I've only updated the plugin version, anyone come across this previously?
Sean Glover
@seglo
i have a root project with two child projects that are aggregated by the root. i have a setting i want to define at build scope for each child project that's used when i run each sbt child1/run. i've found that in this configuration the setting for the last child defined (or aggregated?) always overrides previous values. is there a way i can define a build scope setting for a sub project (i.e. Project.settings(ThisBuild / mySetting := "foo")) that isn't overridden by other sub projects defining the same setting?
2 replies
Eric Torreborre
@etorreborre
Hi, has anyone tried sbt-unidoc with Scala 3? I sbt/sbt-unidoc#86 and I was wondering if any of you had a workaround already (cc @eed3si9n)