sbt版本和scala版本。使用sbt-idea插件进行intellij想法的项目配置 [英] sbt version and scala version. project configuration for intellij idea with sbt-idea plugin

查看:1417
本文介绍了sbt版本和scala版本。使用sbt-idea插件进行intellij想法的项目配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照这些步骤配置项目IntelliJ的想法。

I follow these steps to configure a project for IntelliJ idea.

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0")

我使用 sbt-idea for sbt version 0.12 with fixed bug for Idea。

I use sbt-idea for sbt version 0.12 with fixed bug for Idea.

当我在项目目录中输入 sbt 时,我注意到它使用了scala 2.9.2 ..但我将使用scala 2.10.1作为我的项目。

When I type sbt in my project's directory, I noticed that it uses scala 2.9.2.. but I'm going to use scala 2.10.1 for my project.

问题:

哪个scala版本用于插件是否有意义(〜/ .sbt / plugins ) - 编译,或者我应该使用一个/相同的scala版本?我可以更改插件的scala版本吗?

Does it make sense which scala version to use for plugin(s) (~/.sbt/plugins)-compilation, or I should use one/same scala version for everything? Can I change scala version for plugins?

所以,我创建了带有上述内容的〜/ .sbt / plugin / build.sbt 文件。

So, I created ~/.sbt/plugin/build.sbt file with mentioned content.

推荐答案

其实我知道了。


  1. 如果您的项目包含 build.sbt (使用2.10.1 scala)文件 - 只要输入 sbt ..所有依赖项将被下载到〜/ .sbt 文件夹中 - 甚至scala编译器也会在那里下载(〜/ .sbt / boot )。它甚至可能是scala的几个版本:例如2.10.1和2.9.2。

  1. if you have a project with build.sbt (that uses 2.10.1 scala) file - as soon as you type sbt.. all dependencies will be downloaded into ~/.sbt folder - even scala compiler will be downloaded there (~/.sbt/boot). It could be even several version of scala: 2.10.1 and 2.9.2 for example.

以及关于sbt-idea和〜 / sbt / plugins ..它可以是任何scala版本 - 取决于它的 build.sbt 文件,例如在我的情况下:

and about sbt-idea and ~/sbt/plugins .. it could any scala version - depending on its build.sbt file, for example in my case:




解析器+ =Sonatype snapshotsat
http://oss.sonatype.org/content/repositories/snapshots/

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0-SNAPSHOT")


我应该注意尝试不同的版本..比如 1.1.0-M2-TYPESAFE 它不起作用..(至少在我的情况下) - gen-idea 命令不可用。我不知道为什么。我想它应该。

I should notice if try different version.. like 1.1.0-M2-TYPESAFE it will not work.. (at least in my case) - gen-idea command is not available then. I do not know why. I guess it should.

此外,如果你不指向解析器+ = - 它将无法工作..但它不会告诉你这个..

Also if you do not point resolvers += - it will will not work.. but it it will not tell you about that..

这个插件使用的是scala 2.9.2 - 我们在这里看不到它,但我们可以从输出中看到它它在安装/下载时产生。这就是为什么我们有〜/ .sbt / boot / scala-2.9.2 / 的原因。

This plugin is using scala 2.9.2 - we can not see it here, but we can see it from that outputs it produces while installing/downloading. That's why we have ~/.sbt/boot/scala-2.9.2/ as a result.

在任何情况下我们都不应该关心它。它由sbt处理。

当你通过输入 gen-idea <将你的sbt-project转换为你的intellij-idea项目时/ code>在sbt控制台中,因此你的IDE项目将引用〜/ .sbt / scala 而不是你的某个地方安装的scala ..因此,即使不需要指向scala位置 - sbt-idea sbt的插件将完成所有工作。这很好!

When you converted your sbt-project into your intellij-idea project by typing gen-idea in sbt console, as the result your IDE project will be referencing to ~/.sbt/scala but not to your somewhere-installed-scala.. So even no need to pointing the scala location - that sbt-idea sbt's plugin will do all the work. And that's good!

这就是我想得到的答案。通过尝试来获得/理解它。

That's the answer I wanted to get. One gets/understands it by trying it.

这篇关于sbt版本和scala版本。使用sbt-idea插件进行intellij想法的项目配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆