1265 Members
Scala Build Tool4 Servers

Load older messages

26 May 2023
@_discord_525691726354972692:t2bot.iowebguy#4214 Ok, it was just me! 08:35:10
@_discord_525691726354972692:t2bot.iowebguy#4214 * Ok, it was just me, sbt-plugins repo is fine 08:35:19
@_discord_525691726354972692:t2bot.iowebguy#4214 Still doesn't solve the fact Play is pulling in ancient stuff 08:36:05
@_discord_1057604052118151188:t2bot.ioGerard Murphy I’m getting stuck with ModuleId and the Scala cross-build version.

What I’m trying to do is to run Coursier on a locally published artefact to get a nice standalone executable. That works when done manually, but attempting to define a task in the SBT build has got me in trouble with the Scala version associated with the artefact - I’d like to use the nice %% and % syntax if possible, rather than roll it by explicit text manipulation.

However the Scala version isn’t present when localArtifactCoordinates is rendered into a string.

I’m guessing that ModuleId simply has an internal marker that states, “yes, this is an artefact that has a Scala version - go find it.”. Is there something I can use to expand it into the repository coordinate with the actual Scala version used by the build?

import scala.sys.process._

ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "2.13.10"

lazy val packageExecutableTask = taskKey[String]("Package an executable with Coursier")

lazy val root = (project in file("."))
    name := "kinetic-merge",
    organization := "com.sageserpent",
    packageExecutableTask := {
      val _ = publishLocal.value

      val localArtifactCoordinates: ModuleID = organization.value %% name.value % version.value


      //s"cs bootstrap -f $localArtifactCoordinates -o ${name.value}" !

@_discord_1057604052118151188:t2bot.ioGerard Murphy (No, I don't want an uberjar). 11:57:35
@_discord_1057604052118151188:t2bot.ioGerard Murphy SBT 1.8.3, btw. 12:02:07
@_discord_1057604052118151188:t2bot.ioGerard Murphy No - I'm being a ditz - I should be telling Coursier to use a '::' in the artefact coordinates, which for some reason isn't happening. 12:09:18
@_discord_632304134003097621:t2bot.iobpholt#4689 Is there a built-in way to publish artifacts under multiple names? For reasons, I'd like to publish a library artifact using foo and also foo-suffix (with the same organization, version, and jar contents).

(I can probably construct a project matrix that will do this for me, but it'd be nice if everything didn't have to be re-built)
@_discord_632304134003097621:t2bot.iobpholt#4689 It's not obvious that there's anything in https://www.scala-sbt.org/1.x/docs/Artifacts.html that helps, because I don't want to add different types of artifacts at roughly the same coordinates, I want to publish the same artifact at two different coordinates 15:32:50
@_discord_845013677816021083:t2bot.ioarmanbilge#6192 the best I can think of is you can try and take advantage of sbt being stateful and change the name setting and re-run publish 🤔 15:33:52
@_discord_154558903290560512:t2bot.ioJD557#8432 I think if you could have a foo-suffix project and a foo project that just aggregates foo-suffix
I don't think they'll be exactly the same jar, though
@_discord_845013677816021083:t2bot.ioarmanbilge#6192 oh, that's a good idea. do you actually need two separate jars? or just another artifact that has a dependency on the first one? 15:40:38
@_discord_632304134003097621:t2bot.iobpholt#4689 Oh, no, I don't need two separate jars… the unsuffixed one could just depend on the suffixed one

the motivation here is for some libraries we publish that depend on the Twitter / Finagle ecosystem. We want to publish them for multiple versions of the Twitter stuff, with the suffixes indicating which version they support. The unsuffixed version will always point to "latest" for Twitter (well, latest supported by the library)
@_discord_632304134003097621:t2bot.iobpholt#4689 setting that up as a dependency is a great idea, I'll try that 15:42:55
@_discord_845013677816021083:t2bot.ioarmanbilge#6192 ahh, makes sense! 15:43:44
@_discord_845013677816021083:t2bot.ioarmanbilge#6192 thanks JD557 😄 15:43:58
@_discord_694900669248962610:t2bot.ioAleksandr Novikov joined the room.16:40:03
@_discord_353567891054133269:t2bot.iocarlcaulkett joined the room.17:00:37
@_discord_785235861909405716:t2bot.ioVokulsky joined the room.23:21:37
27 May 2023
@_discord_353567891054133269:t2bot.iocarlcaulkett I'm trying to convert a Java project which uses Maven into a Scala project which uses sbt. I'll be honest, I'm a starter in all 4 areas so please be gentle with me! In my Java/Maven project which works, I have...
            <name>Bitwig Maven Repository</name>


In my Scala/sbt project I have...
ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "3.3.0"

lazy val root = (project in file("."))
    name := "MidiMix",
    idePackagePrefix := Some("com.carlca"),
    resolvers += "Bitwig Maven Repository" at "https://maven.bitwig.com/maven",
    libraryDependencies += "com.bitwig" % "extension-api" % "18"

sbt compile in the IntelliJ console is giving this error...
[error] sbt.librarymanagement.ResolveException: Error downloading com.bitwig:extension-api:18

Does anyone know what the problem is? Thanks!
you seem to have added /maven - if you remove it, I can find the artifact just fine:

1. POM: https://maven.bitwig.com/com/bitwig/extension-api/18/extension-api-18.pom
2. Confirmation with coursier (https://get-coursier.io/docs/overview) cli:

cs resolve -t -r https://maven.bitwig.com com.bitwig:extension-api:18
└─ com.bitwig:extension-api:18
resolvers += "Bitwig Maven Repository" at "https://maven.bitwig.com/",

should do it
@_discord_353567891054133269:t2bot.iocarlcaulkett Thanks for the reply! Yes! I've just discovered the same thing. On to the next build error... 13:23:05
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 Good luck 🙂 13:23:48
Download SCR-20230527-mzlq.png
@_discord_353567891054133269:t2bot.iocarlcaulkett Now that I have my Bitwig dependency sorted (?), why is only one of the following imports not marked with a red squiggle indicating "value bitwig is not a member of com". I'd prefer them all to be squiggle free! 13:37:29
@_discord_275357122299035648:t2bot.ioamumurst#6146 Intellij? Try a re-import from sbt (sbt tool window -> 🔃 symbol). 14:15:11
@_discord_353567891054133269:t2bot.iocarlcaulkett Thanks! I got this sorted. A re-import certainly helped! 18:34:26
@_discord_353567891054133269:t2bot.iocarlcaulkettRedacted or Malformed Event18:35:03
@_discord_338642687370592256:t2bot.iomdedetrich#4098 Nvm, I figured out a way around this 20:30:03

There are no newer messages yet.

Back to Room ListRoom Version: 9