!oXgwMHWllugcPDSKTb:matrix.org

sbt

2081 Members
Scala Build Tool5 Servers

Load older messages


SenderMessageTime
22 May 2024
@_discord_117714065320706054:t2bot.ioptrdom And using coursier launch would work on shells but not play nice with IDEs. At least sbt BSP on IntelliJ IDEA would not work with that, unless I am unaware of some workaround. 13:51:09
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 hmm what if you put --java-home <path> in .sbtopts? 13:52:49
@_discord_117714065320706054:t2bot.ioptrdom That would probably work, but would not be cross-platform. 13:54:05
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 right 13:54:15
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 well you can start a discussion on sbt/sbt to embed some sort of target JVM bootstrap in sbt launcher
ideally I'd put those things in project/build.properties like jvm = adoptium:11
13:55:13
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 * well you can start a discussion on sbt/sbt to embed some sort of target JVM bootstrap in sbt launcher
ideally I'd put those things in project/build.properties like jvm = adoptium:11 and jvm.index= [some url]
13:55:38
@_discord_117714065320706054:t2bot.ioptrdom Aha, that is a neat idea! I will start the discussion. 13:56:00
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 I've been thinking about this for a long time 😄
Most recently due to the various new JDK versions and Scala versions being incompatible - would be good to ensure that one's build can basically launch sbt shell no matter what the host JDK is
13:57:52
@_discord_117714065320706054:t2bot.ioptrdom That is probably the dream - similar to how the hosts sbt can download the project's sbt and boot it. 13:59:06
@_discord_117714065320706054:t2bot.ioptrdom * That is probably the dream - similar to how the host's sbt can download the project's sbt and boot it. 13:59:12
@_discord_533442529270431792:t2bot.iogclaramunt joined the room.14:07:42
@_discord_809772724305395713:t2bot.iovasilmkd Hello 👋🏻

As JetBrains, we forked https://github.com/JetBrains/sbt-kotlin-plugin from https://github.com/pfn/kotlin-plugin, as the original has been dormant for many years. We've only done surface level changes to the plugin in order to get it working with the latest versions of the Kotlin compiler.

We use the plugin to build the Scala plugin for IntelliJ. It is necessary in order to interface with specific new APIs in the IntelliJ Platform. The sbt kotlin plugin is currently isolated to a few small sbt subprojects with a few Kotlin sources.

sbt-kotlin-plugin is very simple and doesn't offer any sort of incremental compilation for the Kotlin sources. In fact, every time compile is issued, it recompiles all Kotlin sources without trying to track any changes or dependencies.

It also compiles the Kotlin code before Zinc gets a chance to run. Therefore, the Kotlin code can only depend on Java symbols (the Kotlin compiler, similar to Scala, can produce stubs for Java classes) and already produced classfiles on the classpath (that's the only way Kotlin code can depend on Scala code in general).

We've opened a tracking ticket for integrating the Kotlin compilation as part of the Zinc incremental compilation in sbt.

https://youtrack.jetbrains.com/issue/SCL-22546/Develop-Kotlin-incremental-compilation-in-sbt-kotlin-plugin

While I have some experience with using and calling Zinc, I've not yet had to expand its incremental compilation.

Is there any way of hooking up the Kotlin sources and produced *.class files into the Zinc Analysis mechanism? I think it would get us 99% of the way there if we can have the following features (continuing in thread).
21:55:04
@_discord_809772724305395713:t2bot.iovasilmkd * Hello 👋🏻

As JetBrains, we forked https://github.com/JetBrains/sbt-kotlin-plugin from https://github.com/pfn/kotlin-plugin, as the original has been dormant for many years. We've only done surface level changes to the plugin in order to get it working with the latest versions of the Kotlin compiler.

We use the plugin to build the Scala plugin for IntelliJ. It is necessary in order to interface with specific new APIs in the IntelliJ Platform. The sbt kotlin plugin is currently isolated to a few small sbt subprojects with a few Kotlin sources.

sbt-kotlin-plugin is very simple and doesn't offer any sort of incremental compilation for the Kotlin sources. In fact, every time compile is issued, it recompiles all Kotlin sources without trying to track any changes or dependencies.

It also compiles the Kotlin code before Zinc gets a chance to run. Therefore, the Kotlin code can only depend on Java symbols (the Kotlin compiler, similar to Scala, can produce stubs for Java classes) and already produced classfiles on the classpath (that's the only way Kotlin code can depend on Scala code in general).

We've opened a tracking ticket for integrating the Kotlin compilation as part of the Zinc incremental compilation in sbt.

https://youtrack.jetbrains.com/issue/SCL-22546/Develop-Kotlin-incremental-compilation-in-sbt-kotlin-plugin

While I have some experience with using and calling Zinc, I've not yet had to expand its incremental compilation.

Is there any way of hooking up the Kotlin sources and produced *.class files into the Zinc Analysis mechanism? I think it would get us 99% of the way there if we can have the following features (continuing in the next message).
21:55:26
@_discord_809772724305395713:t2bot.iovasilmkd 1. Track *.kt source files and their stamps, such that edited files are automatically reconsidered for recompilation.
2. Track the produced *.class files, such that deleted *.class files automatically mark their originating sources for recompilation.
3. Track the public API of Kotlin classes. Here we don't need anything crazily ambitious, JavaAnalyze would suffice. Kotlin classes should be treated as binary dependencies, so any changes in the public API should cause recompilation of Scala sources that depend on them.
4. Track the library dependencies of Kotlin classes. If the classpath changes, Kotlin sources should be recompiled.
21:58:25
@_discord_809772724305395713:t2bot.iovasilmkd Has anyone done anything similar? Any advice to share? Thanks in advance. 21:59:33
@_discord_809772724305395713:t2bot.iovasilmkd * 1. Track *.kt source files and their stamps, such that edited files are automatically reconsidered for recompilation.
2. Track the produced *.class files, such that deleted *.class files automatically mark their originating sources for recompilation.
3. Track the public API of Kotlin classes. Here we don't need anything crazily ambitious, JavaAnalyze would suffice. Kotlin classes should be treated as binary dependencies, so any changes to a Kotlin classfile should cause recompilation of Scala sources that depend on them.
4. Track the library dependencies of Kotlin classes. If the classpath changes, Kotlin sources should be recompiled.
22:08:20
@_discord_1231680366973292725:t2bot.iozornthimmberglobber joined the room.22:10:42
23 May 2024
@_discord_1008283709474082826:t2bot.iobabawazer joined the room.02:09:22
@_discord_843896430917320714:t2bot.ioim_bharadwajj no build target found for /home/sai/MySpinalProject/hw/spinal/projectname/MyTopLevel.scala. Using presentation compiler with project's scala-library version: 3.3.3, this is the error I am getting, please look into it, as I tried to compile a scala file, it is throwing an error. 04:49:43
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 How are you compiling that file? What tool produced that error? 05:07:58
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 That doesn't look like a valid sbt project} 05:08:07
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 * That doesn't look like a valid sbt project 05:08:08
@_discord_843896430917320714:t2bot.ioim_bharadwajj i am using vscode 05:08:30
@_discord_843896430917320714:t2bot.ioim_bharadwajj just ruunning the files after installing metal extensions in VSCode 05:11:54
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 So you are not using sbt at all? Then why asking in this channel? 05:20:53
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 Anyways vscode can't just open a Scala file 05:21:02
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 It needs a build server 05:21:07
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 For simple programs of a single file 05:21:14
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 * For simple programs of a single file you may use scala-cli rather than sbt 05:21:26
@_discord_270243703015079946:t2bot.ioBalmungSan#5059 https://scala-cli.virtuslab.org/docs/commands/setup-ide/ 05:21:37

Show newer messages


Back to Room ListRoom Version: 9