-
Notifications
You must be signed in to change notification settings - Fork 36
Fppis week 2
Brandon JeongYeol Choi edited this page Jul 11, 2013
·
3 revisions
- 원하는 디렉토리 생성
- 디렉토리로 이동 후
build.sbt파일 생성
sbt 프로젝트 설정파일
scalaVersion := "2.10.2"
name := "testSbt"
version := "0.1"- scalaVersion : 스칼라의 버전
- name : 프로젝트의 이름
- version : 프로젝트 버전
각각의 dependency를 한 라인씩 추가(주의 : 각각에는 한 라인씩 공백이 존재해야 함)
libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % "test"
libraryDependencies += "junit" % "junit" % "4.10" % "test"각각의 라인 사이에는 공백이 존재해야 함. 단 다음과 같이 붙여 쓸 수 있음(주의 : 한라인씩 작성할 때 += 을 사용하는데 반해, ++=를 사용함을 유의한다)
- SBT는 dependency 관리로 Apache Ivy를 사용
libraryDependencies += groupID % artifactID % revision % configurationlibraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "1.9.1" % "test",
"junit" % "junit" % "4.10" % "test"
)
libraryDependencies += "org.scala-tools" % "scala-stm_2.9.1" % "0.3"
다음 코드의 %% "scala-stm은 scala-stm_2.9.0 도 인식함
libraryDependencies += "org.scala-tools" %% "scala-stm" % "0.3"
/project/plugins.sbt 에 다음을 추가(이클립스 플러그인)
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0")
ScalaTest, JUnit이 추가 된 build.sbt 예제
-
compile: 컴파일 -
run: 실행 -
test: 테스트 수행 -
test-only: 지정한 테스트만을 수행 -
update: 의존성 업데이트 -
~: 소스변경 감시 - 예를 들어
~ run이라고 입력하고 소스를 수정하면, 이를 감지하고 실행
// TODO
// TODO