2015-12-12 98 views
0

我想将IntelliJ IDEA集成到GitHub Scala库中。请指导我如何将库与Jetbrain IDE集成。用IntelliJ IDEA集成GitHub库

+0

你是什么意思'整合'?你想在项目中使用它们吗?您知道IntelliJ IDEA支持sbt构建文件,并且sbt支持发布到Maven存储库的常规库,或者直接链接到git存储库(如GitHub上托管的库)? –

+0

是啊!!但是,我是这个IDE的新手。我不知道如何将它们包含在IntelliJ IDEA中。你可以给一个链接或程序。 – karthick

回答

0

如果你能拿出你的项目的SBT构建文件,包括那些库,所有你需要做的就是开放该项目的IntelliJ IDEA - 文件>打开,并选择目录中的build.sbt文件驻留,那么你将被提供给import a project from the existing sbt build file

你最小的项目目录将

项目/ build.properties

sbt.version=0.13.9 

的src/main /斯卡拉/ mypackage的

的目录你的源代码去

build.sbt

scalaVersion := "2.11.7" 

// example library from Maven Central 
libraryDependencies += "org.scala-lang.modules" % "scala-swing_2.11" % "1.0.2" 

或者,source repository that is not published

build.sbt

lazy val root = Project("root", file(".")) 
    .dependsOn(libOnGitHub) 
    .settings(
    scalaVersion := "2.11.7" 
) 

// example project on GitHub 
lazy val libOnGitHub = 
    ProjectRef(uri("git://github.com/user/repo.git#branch"), "project-name") 

(这要求该项目是由SBT建,太)