Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

とりあえず使えるSBT

2,298 views

Published on

Scala関西ビギナーズ#4の発表資料です。

2014/09/23 発表時に使用した資料に更新しました.

Published in: Technology
  • ACCESS that WEBSITE Over for All Ebooks (Unlimited) ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... DOWNLOAD FULL EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M }
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THI5 BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

とりあえず使えるSBT

  1. 1. とりあえず 使えるSBT @Kuchitama 関西Scalaビギナーズ 2014/09/20 ver 1.0
  2. 2. 自己紹介 • @Kuchitama(国平清貴) • FuRyu株式会社 • 勉強会 • Kyoto.clj (Clojure) • ScalaMatsuriスタッフ • 関西ソーシャルゲーム勉強会
  3. 3. 対象者 •REPLが使える人 •ちょっと実践的なScalaプログラミン グがしたくなった人 •Scala学習中の人
  4. 4. イメージ Scalaなんとなくわかってきたし、 PlayでWebアプリ作ってみたい とりあえず、ちょっとしたワンランナー 書いてみたい REPLに飽きたので、ちょっと実践的 なプロジェクトやってみたい
  5. 5. SBT
  6. 6. sbt •Simple(?????) • 最近本家でもSimpleの表記が消えた •Scalaのデファクトスタンダードな Build Tool
  7. 7. 0.13.5 or later •ver.1に向けての準備段階 •こないだ0.13.6がでた
  8. 8. .sbt or .scala •基本は.sbtに •複雑な処理は.scalaに • 再利用できそうならpluginに
  9. 9. 目的 •sbtで最低限押さえておきたい使い方を まとめる •あんまり踏み込まない •あくまでScalaを使うために必要な部 分のみを抽出
  10. 10. やること •プロジェクト作成(activator) •依存ライブラリの取得 •sbtプラグインの追加 •基本コマンドの利用
  11. 11. プロジェクト作成
  12. 12. Typesafe Activator •sbt-np pluginいらず •scala, java, playの雛形生成 •プロジェクトテンプレートの取得 •play2.3から標準仕様 •(sbt/play) + new ぐらいの印象 https://typesafe.com/activator
  13. 13. Typesafe Activator •activator コマンド •IDE対応
  14. 14. デモ
  15. 15. 新規プロジェクト作成 activator new
  16. 16. activator new http://youtu.be/-C_ICX8Df0c
  17. 17. やっぱIDEがいい activator ui
  18. 18. activator ui http://youtu.be/QB__3dfFNYU
  19. 19. IDE http://youtu.be/wRXm6HvSGCU
  20. 20. 基本の設定
  21. 21. 基本の設定 •(キー) (メソッド) (Setting[s]) •メソッド • := キーに対してSettingを更新 • += キーにSettingを追加 • ++= キーにSettingを複数追加
  22. 22. 基本の設定 build.sbt name := """scalakb_sample""" ! version := "1.0" ! scalaVersion := "2.11.1" ! // Change this to another test framework if you prefer libraryDependencies += "org.scalatest" %% "scalatest" % "2.1.6" % “test" ! // Uncomment to use Akka //libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.3.3" !
  23. 23. 依存ライブラリの 取得
  24. 24. 依存ライブラリの取得 •% と %% •コンフィギュレーション ライブラリ依存性 http://www.scala-sbt.org/0.13/tutorial/ja/Library-Dependencies.html
  25. 25. % と %% •マネージド依存性 • <-> アンマネージド依存性 •sbt(の内部のivy)に依存性を管理して もらう
  26. 26. % と %% •% • Scalaのバージョンを指定して依存を解決 • Javaのライブラリを使いたいときはこっち • groupId % artifactId % revision •%% • Scalaのバージョンを自動で追加して依存を 解決 • groupId %% artifactId % revision
  27. 27. デモ
  28. 28. 依存ライブラリを 追加してみる build.sbt name := """scalakb_sample""" ! version := "1.0" ! scalaVersion := "2.11.1" ! // Change this to another test framework if you prefer libraryDependencies ++= Seq( “org.scalatest" %% "scalatest" % "2.1.6" % “test”, "joda-time" % "joda-time" % “2.4”, "com.github.scopt" %% "scopt" % “3.2.0") ! …
  29. 29. 依存ライブラリを 追加してみる http://youtu.be/j9xLQDM58cc
  30. 30. コンフィギュレーション •groupID % artifactID % revision % configuration •testとかcompileとか • 使う時だけ依存解決できる
  31. 31. コンフィギュレーション build.sbt name := """scalakb_sample""" ! version := "1.0" ! scalaVersion := "2.11.1" ! // Change this to another test framework if you prefer libraryDependencies += "org.scalatest" %% "scalatest" % "2.1.6" % “test" ! // Uncomment to use Akka //libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.3.3" !
  32. 32. 基本タスクの利用
  33. 33. 基本タスクの利用 •test - テストの実行 •run - プロジェクト実行 •compile - コンパイル •package - jar化
  34. 34. 基本タスクの利用 http://youtu.be/U7e31Ezg2H8
  35. 35. まとめ •activatorで簡単にプロジェクト作成 •依存ライブラリの取得は % or %% •基本のsbtタスクは覚えやすい
  36. 36. Enjoy.Scala!!

×