Giter8 is a command line tool that helps you to easily setup your project structure from templates published on github. It is written in Scala and based on sbt, but it is not restricted to Scala or sbt projects. You can create and use templates for any project type you like. From version 0.5.0 giter8 also has support for other git repositories than github.
Installation
Just follow the installation instructions, the installation with Conscript worked fine for me.
Verify your installation by typing g8 without parameters on the command line.
$ g8 giter8 0.5.0 Usage: g8 [TEMPLATE] [OPTION]...
Usage
Now we’re good to go, so lets create a Scala sbt project:
$ g8 kobmic/plain-scala.g8 Plain Scala project with scalatest and/or specs2 version [0.1.0-SNAPSHOT]: organization [my.organization]: com.jayway name [MyScalaProject]: TheProject Template applied in ./theproject
After the project is created from your template start coding and run your build with sbt compile
. As stated above giter8 uses sbt, but you can use your favourite build tool in your project template. Here’s an example using maven:
$ g8 kobmic/java-scala-mvn.g8 Mixed Java/Scala maven project with scalatest version [0.1.0-SNAPSHOT]: name [MyProject]: group_id [my.organization]: com.jayway Template applied in ./myproject $ cd myproject $ mvn compile
It is quite easy to create your own templates, just have a look at the documentation. You can use the file protocol to test your template locally:
$ g8 file:///Users/michaelkober/Documents/code/java-scala-mvn.g8/
Resources
- You’ll find a lot of useful templates on github:
- typesafehub: templates for plain scala projects, play or Akka
http://github.com/typesafehub/scala-sbt.g8
http://github.com/typesafehub/akka-scala-sbt.g8
http://github.com/typesafehub/akka-java-maven.g8
http://github.com/typesafehub/play-scala.g8
http://github.com/typesafehub/play-java.g8 - scala-ide: templates for eclipse plugins
http://github.com/scala-ide/scala-plugin.g8 - you’ll find more on the giter8 wiki:
http://github.com/n8han/giter8/wiki/giter8-templates - examples from this blogpost
http://github.com/kobmic/plain-scala.g8
http://github.com/kobmic/java-scala-mvn.g8