Is there a Mill "Run Configuration" for IntelliJ? - scala

I'm trying to figure out how to create a "Run Configuration" for a Scala Mill project.
There are entries for Maven and SBT, but nothing for Mill. There doesn't seem to be a "Mill" plugin for IntelliJ either.
I create a Scala Mill project with this command:
mill mill.scalalib.GenIdea/idea
And install the Build Server Protocol:
mill mill.bsp.BSP/install
Is it best just to make a "Shell Script" configuration that runs mill foo.run?

Related

IntelliJ: what difference between "SBT Console" and "SBT Shell"?

In the IntelliJ I see two tool windows: SBT Console and SBT Shell. What is the difference between these tools?
You may have installed both scala and sbt plugins. The newer version of scala plugin has sbt as part of it.
sbt console is the sbt plugin -- click start you will enter into sbt interactive mode.
sbt shell is part of the scala plugin, which is similar to the above mentioned sbt console and can autocomplete commands.
Here is a description: https://blog.jetbrains.com/scala/2017/03/23/scala-plugin-for-intellij-idea-2017-1-cleaner-ui-sbt-shell-repl-worksheet-akka-support-and-more/
SBT Console plugin is deprecated in favour of IntelliJ Scala Plugin. Deprecation notice states:
JetBrains have recently added support for an SBT console to the
IntellIJ Scala Plugin. This is now the recommended way to use SBT
within IntellIJ. No new releases of this plugin are planned.

Can not download jars when building scala project with sbteclipse?

As shown in the picture, when I build scala project with sbteclipse and import to eclipse, when changing build.sbt , jars are downloaded to my computer but not to scalaProject. I do not know why. Can someone help me?
scala version: 2.11.8
sbt version: 0.13.15
stbeclipse:5.1.0
I assume that you're using the Scala IDE plugin for Eclipse, correct?
The sbteclipse SBT plugin merely provides a command to generate an Eclipse Scala project from the SBT build. Before using Eclipse, you're supposed to issue the following command (from the command line) to SBT:
sbt eclipse
This should generate the project files for your Eclipse project. After executing this command, you can open your project using Eclipse (with the Scala IDE plugin).
Note that, at present, the Scala IDE Eclipse plugin does not support SBT build files. That is, if you change your SBT build file, then Eclipse will be none the wiser, until you re-run the above command.
You might want to consider switching to IntelliJ IDEA (instead of Eclipse) which has a full-featured Scala plugin that fully supports SBT builds, including downloading any dependencies. For my money (both IDEs are free) IntelliJ is light-years ahead of Eclipse for Scala development.

IntelliJ, Scala plugin and h2-browser

Is there any way to add the h2-browser flag in a Play 2 IntelliJ run configuration? I prefer not to manually run sbt and / or and sbt console.

How to set up IntelliJ external Scala compiler for Maven projects

I'm using IntelliJ 13 community version. I have a Maven project with multiple modules.
Currently, I'm using IntelliJ internal compiler. I find that every time I run maven clean XXX, I have to manually trigger Scala rebuild in IntelliJ before I run any Cucumber acceptance tests. Otherwise IntelliJ will complaints "no class file". It is annoying. It takes 2 to 3 minutes for the clean re-build.
Finally, I decide to try the external compiler. I have no idea how to do it. I does not seems as easy as enable external compiler.
Can any one please teach me how to properly set up external compiler for a multi-module maven Scala project?
Maven clean command deletes your jar and target folder.
therefor you need to compile the maven project with the maven command "compile" / "install" after clean .
if you want to use your command line to clean and compile you can run $ mvn clean compile . but actually since "clean" is the 1st step at maven's build life cycle you only need to run the compile command . it will run "clean" (or $ mvn compile) as the 1st step of the build .
check out maven build life cycle here

how to load activator in intellij with sbt plugin

I'm a novice on sbt.
I looked at activator project
Now I see it uses sbt and there are sbt and scala files under the project directory.
But i was sure there would also be a main sbt (like main pom) in main directory where I can open it in intellij with sbt plugin and it would open all projects in the IDE.
Can anyone please let me know how to open this project in intellij with all its dependencies? Most probably with intellij sbt plugin because it uses sbt (i mean like in maven would bring all sub dependencies)
I never used intellij sbt plugin.
But you could try to add the sbt idea plugin to the plugins.sbt file.
Then you can generate the intellij idea project files with the gen-idea task.