conscript を使った独自アプリを作ってみよう。
ConscriptPlugin を使ってアプリを作る方法をここでは紹介する。
まずは以下を project/concript.sbt に書く:
addSbtPlugin("org.foundweekends.conscript" % "sbt-conscript" % "0.5.9")
次に、build.sbt でアプリのためのサブプロジェクトで ConscriptPlugin を有効にする:
lazy val root = (project in file(".")).
  enablePlugins(ConscriptPlugin).
  settings(
    // other settings here
  )
このプラグインは sbt の launcher-interface に対して「provided」な依存性を追加する。
xsbti.AppMain を実装して、アプリへのエントリーポイントを作る。
package example
class HelloApp extends xsbti.AppMain {
  def run(configuration: xsbti.AppConfiguration): xsbti.MainResult = {
    // get the version of Scala used to launch the application
    val scalaVersion = configuration.provider.scalaProvider.version
    // Print a message and the arguments to the application
    println("Hello world!  Running Scala " + scalaVersion)
    configuration.arguments.foreach(println)
    new Exit(0)
  }
  class Exit(val code: Int) extends xsbti.Exit
}
1つか 2つのコマンドライン・オプションを作った後は、多分 scopt みたいなコマンドライン・パーサを使うことをお勧めする。
次に、launchconfig ファイルを src/main/conscript/XYZ/launchconfig に置く
(ここで、XYZ は g8 や cs といったスクリプト名に置き換える):
[app]
  version: 0.1.0
  org: com.example
  name: hello
  class: example.HelloApp
[scala]
  version: 2.11.12
[repositories]
  local
  maven-central
launchconfig に関する詳細は sbt レファレンス・マニュアルの sbt Launcher の項目を参照。
アプリを csRun XYZ コマンドを sbt シェルから打ち込むことで、アプリをテストできる。