- Scalaインタープリタ(REPL)
- 変数、定数
- 関数(メソッド)
- whileループ
- ifループ
- インクリメンタル演算子、デクリメント演算子はない
- foreachとforによる反復実行
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object Resource { | |
// 実行時例外 | |
val prop1 = new Properties | |
prop1.load(new FileInputStream("config.properties")) // -> FileNotFoundExceptionが投げられる | |
// target/scala-ver/classes/config.propertiesが読み込まれる | |
// (コンパイル前: src/main/resources/config.properties) | |
val prop2 = new Properties | |
prop2.load(this.getClass().getClassLoader().getResourceAsStream("config.properties")) // -> 読み込む |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SET CURRENT_DIR=%~dp0 | |
SET JAVA_OPTION=-Xms128m -Xmx512m -server -Dhttp.port=9000 | |
SET CLASS_PATH=%CURRENT_DIR%app\lib\* | |
SET ARGS=%CURRENT_DIR%app\ | |
java %JAVA_OPTION% -cp "%CLASS_PATH%" play.core.server.NettyServer %ARGS% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sbt.version=0.13.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" | |
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "app_name" | |
version := "1.0-SNAPSHOT" | |
libraryDependencies ++= Seq( | |
// libraryDependencies | |
) | |
play.Project.playScalaSettings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazy val project = Project ( | |
"app_name", | |
file(".") | |
).enablePlugins(PlayScala).settings( | |
// VersionとかlibraryDependenciesとか | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.slick.driver.JdbcDriver.simple._ | |
val db = Database.forURL("jdbc:h2:mem:slicktest", driver = "org.h2.Driver") | |
implicit val session = db.createSession() | |
session.close() | |
db.withSession { implicit session => | |
// query | |
} |
- sbt-pgp
- sbt-sonatype
- sbt-release
- Sonatype設定
- SBTのマニュアルに従って、SonatypeのプロジェクトJIRAにアカウントを作成する。