16 May 2024 |
felher#6050 | Just need the tests | 16:27:42 |
SethTisue#7418 | if it's just running the tests, sbt-projectmatrix seems like overkill to me | 16:27:44 |
SethTisue#7418 | especially if n is large-ish (like closer to 10 than 2), since your build will start taking forever to load | 16:28:11 |
felher#6050 | Okay, then I'll just put a .sh script into my repo to run the tests against different versions of the library. | 16:28:28 |
felher#6050 | Thanks | 16:28:29 |
bjornregnell | It seems like a general use case though, so writing and publishing an sbt plugin might be a nice contribution.... | 16:28:39 |
SethTisue#7418 | it would be interesting to see what the custom command to do it looks like. because if it's only a few lines, maybe it would be fine to just have it exist as a code example rather than a whole plugin? not sure | 16:29:23 |
bjornregnell | a whole plugin?
I have never written an sbt plugin but from the docs, if the logic is simple it should be a simple plugin... | 16:30:38 |
felher#6050 | Yeah, sadly my SBT-foo is really not that great. So a plugin is more or less out of the question. Defining some task to do it inside the build seems feasable. Not sure it is better than to .sh it. | 16:30:48 |
felher#6050 | * Yeah, sadly my SBT-foo is really not that great. So a plugin is more or less out of the question. Defining some task to do it inside the build seems feasable. Not sure it is better than to .sh it, though | 16:31:07 |
bjornregnell | If you look att the "Obfuscate" example plugin here https://www.scala-sbt.org/1.x/docs/Plugins.html then it does not look that scary. But maybe I'm too optimistic 🤷♂️ | 16:32:29 |
bjornregnell | In a plugin compared to normal settings DSL you have the sanctuary of "normal" scala 2 and the process api of sbt seems reasonable. | 16:33:44 |
bjornregnell | * In a plugin (in contrast to tyhe magic settings DSL) you have the sanctuary of "normal" scala 2 and the process api of sbt seems reasonable. | 16:34:11 |
bjornregnell | * In a plugin (in contrast to the magic settings DSL) you have the sanctuary of "normal" scala 2 and the process api of sbt seems reasonable. | 16:34:30 |
felher#6050 | Interesting. I find that extremely hard to read. I suppose it is way easier if you already have a very firm grasp on all the SBT conecpts, like tasks, definitions, scopes, etc. | 16:41:01 |
bjornregnell | But yeah; the whole multi-dimensional settings thing is there so perhaps it's too much fuzz trying to fiddle with settings etc. My thinking is that there is this way of setting the scala version dynamically in the shell so it should be possible, but I guess making it a scala-cli script that mutates your build.sbt file is a much quicker ("uggly" but effectful) hack... | 16:42:50 |
Matthias Berndt#5019 | Setting the Scala version in sbt is trivial, set Scala version := "3.3.3" | 17:15:39 |
Matthias Berndt#5019 | * Setting the Scala version in sbt is trivial, set scalaVersion := "3.3.3" | 17:15:56 |
Matthias Berndt#5019 | It's probably best to use sbt --client for this | 17:16:29 |
Matthias Berndt#5019 | * Setting the Scala version in the sbt shell is trivial, set scalaVersion := "3.3.3" | 17:16:42 |
mtomko | I would like to override a task (main/Docker/publish ) in sbt so that it sets the scala version first. My build has something like:
lazy val scala3 = "3.3.3"
(main / Docker / publish) := {
// ?? what goes here to select the value of $scala3?
(main/Docker/publish).value
} | 17:36:28 |
armanbilge#6192 | if I understand you correctly, that's not possible | 17:37:07 |
armanbilge#6192 | tasks cannot assing values to settings | 17:37:13 |
armanbilge#6192 | * tasks cannot assign values to settings | 17:37:22 |
armanbilge#6192 | you could create a command alias that assigns a value to a setting and then runs a task | 17:37:32 |
mtomko | cross-compiling is no fun | 17:37:36 |
mtomko | that might be enough. Otherwise our build node is going to have to run the task in the context of that setting, like ++3.3.3 main/Docker/publish which I don't want because I don't want it to have to figure out what version of Scala 3 we're currently using. | 17:38:31 |
| @flamengo2024:matrix.org joined the room. | 17:39:19 |
| @flamengo2024:matrix.org left the room. | 17:40:02 |
armanbilge#6192 | you can just write ++3 | 17:47:02 |