简体   繁体   English

将GitHub库与IntelliJ IDEA集成

[英]Integrate GitHub Libraries with IntelliJ IDEA

I would like to integrate GitHub Scala Libraries with IntelliJ IDEA. 我想将GitHub Scala库与IntelliJ IDEA集成在一起。 Please guide me how to integrate libraries with this jetbrain IDE. 请指导我如何将库与此Jetbrain IDE集成。

If you can come up with an sbt build file for your project that includes those libraries, all you have to do is open the project in IntelliJ IDEA - File > Open and select the directory in which the build.sbt file resides, then you will be offered to import a project from the existing sbt build file . 如果您可以为项目提供一个包含这些库的sbt构建文件,则只需在IntelliJ IDEA-File> Open中打开该项目,然后选择build.sbt文件所在的目录, build.sbt可以从现有的sbt构建文件导入项目

Your minimal project directory will be 您的最小项目目录为

project/build.properties 项目/build.properties

sbt.version=0.13.9

src/main/scala/mypackage src / main / scala / mypackage

Directory where your source code goes 源代码所在的目录

build.sbt build.sbt

scalaVersion := "2.11.7"

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

Or, for source repository that is not published : 或者,对于未发布的源存储库

build.sbt 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")

(This requires that the project is built by sbt, too) (这也要求该项目也是由sbt构建的)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM