$ sbt 'inspect sbtVersion'

[info] Set current project to gilbird (in build file:/C:/cygwin64/home/gilbird/)

[info] Setting: java.lang.String = 0.13.9

[info] Description:

[info]  Provides the version of sbt.  This setting should be not be modified.

[info] Provided by:

[info]  */*:sbtVersion

[info] Defined at:

[info]  (sbt.Defaults) Defaults.scala:135

[info] Delegates:

[info]  *:sbtVersion

[info]  {.}/*:sbtVersion

[info]  */*:sbtVersion

[info] Related:

[info]  */*:sbtVersion




$ sbt sbt-version

[info] Set current project to root--sbt (in build file:/C:/cygwin64/home/gilbird/.sbt/)

[info] 0.13.9


sbteclipse를 설치하면 sbt eclipse 커맨드로 eclipse 프로젝트를 생성할 수 있다.


먼저 sbteclipse 플러그인 사용을 위한 설정을 한다.

프로젝트 디렉토리에서 project 디렉토리와 plugins.sbt 파일을 생성한다.


mkdir project

vi project/plugins.sbt


다음 내용추가 


addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")


프로젝트 디렉토리에서 다음 커맨드 실행


# sbt eclipse

[info] Loading global plugins from /Users/gilbird/.sbt/0.13/plugins

[info] Updating {file:/Users/gilbird/.sbt/0.13/plugins/}global-plugins...

[info] Resolving org.fusesource.jansi#jansi;1.4 ...

[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.10/sbt_0.13/4.0.0/jars/sbteclipse-plugin.jar ...

[info] [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0!sbteclipse-plugin.jar (6861ms)

[info] downloading https://jcenter.bintray.com/org/scalaz/scalaz-core_2.10/7.1.0/scalaz-core_2.10-7.1.0.jar ...

[info] [SUCCESSFUL ] org.scalaz#scalaz-core_2.10;7.1.0!scalaz-core_2.10.jar(bundle) (9362ms)

[info] downloading https://jcenter.bintray.com/org/scalaz/scalaz-effect_2.10/7.1.0/scalaz-effect_2.10-7.1.0.jar ...

[info] [SUCCESSFUL ] org.scalaz#scalaz-effect_2.10;7.1.0!scalaz-effect_2.10.jar(bundle) (1953ms)

[info] Done updating.

[info] Set current project to ScalaTest (in build file:/Users/gilbird/Work/scala/ScalaTest/)

[info] About to create Eclipse project files for your project(s).

[info] Updating {file:/Users/gilbird/Work/scala/ScalaTest/}scalatest...

[info] Resolving org.fusesource.jansi#jansi;1.4 ...

[info] downloading https://jcenter.bintray.com/org/scala-lang/scala-library/2.10.1/scala-library-2.10.1.jar ...

[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.10.1!scala-library.jar (6513ms)

[info] downloading https://jcenter.bintray.com/org/scala-lang/scala-compiler/2.10.1/scala-compiler-2.10.1.jar ...

[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.1!scala-compiler.jar (10524ms)

[info] downloading https://jcenter.bintray.com/org/scala-lang/scala-reflect/2.10.1/scala-reflect-2.10.1.jar ...

[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.1!scala-reflect.jar (3837ms)

[info] downloading https://jcenter.bintray.com/org/scala-lang/jline/2.10.1/jline-2.10.1.jar ...

[info] [SUCCESSFUL ] org.scala-lang#jline;2.10.1!jline.jar (2989ms)

[info] Done updating.

[info] Successfully created Eclipse project files for project(s):

[info] ScalaTest


ls를 해보면 .project파일이 생성되어 있다.


# ls

total 24

0 ./          8 .classpath  0 .settings/  0 lib/        0 src/

0 ../         8 .project    8 build.sbt   0 project/    0 target/


그 다음은 기존의 이클립트 프로젝트 import를 하면된다.



다음 주소에서 스크립트를 sbtmkdirs.sh 스크립트를 다운로드 받는다.

https://gist.github.com/alvinj/3194379


프로젝트를 만들고자 하는 디렉토리에서 스크립트를 실행하고 

몇가지 물음에 답하면 하위에 해당 프로젝트가 만들어진다.


# sbtmkdirs.sh

This script creates an SBT project directory beneath the current directory.


Directory/Project Name (MyFirstProject): ScalaTest

Create .gitignore File? (Y/n): n

Create README.md File? (Y/n): n


-----------------------------------------------

Directory/Project Name: ScalaTest

Create .gitignore File?: n

Create README.md File?: n

-----------------------------------------------

Create Project? (Y/n): y


Project created. See the following URL for build.sbt examples:

http://alvinalexander.com/scala/sbt-syntax-examples

[~/work/scala]#


스크립트 실행 후 다음 디렉토리 및 파일이 생성된 것을 확인할 수 있다.


# ls ScalaTest/

total 8

0 ./         0 ../        8 build.sbt  0 lib/       0 project/   0 src/       0 target/


다음 사이트 방문하여 라이브러리 다운로드


http://www.scala-sbt.org/download.html


압축을 풀고 bin디렉토리로 디동하여 sbt 실행하니 관련 라이브러리를 오랜 시간 받음


[~/gilbird/scala/sbt/bin]# ./sbt

Getting org.scala-sbt sbt 0.13.9 ...

downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.9/jars/sbt.jar ...

[SUCCESSFUL ] org.scala-sbt#sbt;0.13.9!sbt.jar (4724ms)

downloading https://jcenter.bintray.com/org/scala-lang/scala-library/2.10.5/scala-library-2.10.5.jar ...

[SUCCESSFUL ] org.scala-lang#scala-library;2.10.5!scala-library.jar (2985ms)

downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.9/jars/main.jar ...

[SUCCESSFUL ] org.scala-sbt#main;0.13.9!main.jar (9263ms)

downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.9/jars/compiler-interface-bin.jar ...

[SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.9!compiler-interface-bin.jar (6848ms)

downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.9/jars/compiler-interface-src.jar ...

[SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.9!compiler-interface-src.jar (4634ms)

downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_8_2/0.13.9/jars/compiler-interface-bin.jar ...

[SUCCESSFUL ] org.scala-sbt#precompiled-2_8_2;0.13.9!compiler-interface-bin.jar (6416ms)

downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_2/0.13.9/jars/compiler-interface-bin.jar ...

[SUCCESSFUL ] org.scala-sbt#precompiled-2_9_2;0.13.9!compiler-interface-bin.jar (5475ms)

...



다시 실행하면 관련 라이브러리는 이미 다 받았으니 바로 실행되는 것 확인

현재 경로를 .profile에 등록하여 다른 디렉토리에서도 실행 가능하도록 함.


export SBT_HOME=[전체경로]/scala/sbt

export PATH=$SBT_HOME/bin:$PATH




+ Recent posts