Skip to content

Commit

Permalink
Added template project. Shortened readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulp committed Sep 14, 2011
1 parent 7e759c1 commit c098d04
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ target
lib_managed
src_managed
/ext
.lib
.lib
/template-project/project/boot
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,15 @@ Current -help output:
shows precedence: JAVA_OPTS lowest, command line options highest.


## Template project
## Template project ##

To gain access to the awesome, simply add the following <project>/project/plugins/project/Build.scala file:
To see the plugin in action, including the thrilling custom sbt command "help-names":

import sbt._
object PluginDef extends Build {
override def projects = Seq(root)
lazy val root = Project("plugins", file(".")) dependsOn(extras)
lazy val extras = uri("git://github.com/jsuereth/sbt-extras")

This comment has been minimized.

Copy link
@jsuereth

jsuereth Sep 14, 2011

Contributor

Hey, love the new template project, great idea (for testing I had one locally). I think this documentation might still be useful for folk who don't know how to have SBT pull a plugin from source, unless you plan to publish it. I was hoping to get a few people trying out the DSL to see if they like it.

This comment has been minimized.

Copy link
@jsuereth

jsuereth Sep 14, 2011

Contributor

BTW - It's not a huge deal since you have the copy-able plugins/project/Build.scala. I just try to look out for other copy-paste programmers, so keeping paste-able code close at hand is good :)

This comment has been minimized.

Copy link
@paulp

paulp via email Sep 19, 2011

Author Collaborator
}
cd template-project && ../sbt -sbt-rc help-names

The template files are:

Now to continue the amazement, simply extend the TemplateBuild trait in your project. For example, in your
<project>/project/Build.scala file add:

import sbt._
import template.TemplateBuild

object MyAwesomeBuild extends TemplateBuild {}
project/plugins/project/Build.scala # you can use this as-is if you want
project/Build.scala # this is a starting point for your real Build.scala

The Template build isn't quite finished. There will most likely be a build.sbt DSL variant that does not require a project scala file.
4 changes: 4 additions & 0 deletions template-project/project/Build.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import sbt._
import template.TemplateBuild

object MyAwesomeBuild extends TemplateBuild {}
7 changes: 7 additions & 0 deletions template-project/project/plugins/project/Build.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sbt._

object PluginDef extends Build {
override def projects = Seq(root)
lazy val root = Project("plugins", file(".")) dependsOn(extras)
lazy val extras = uri("git://github.com/paulp/sbt-extras")
}

0 comments on commit c098d04

Please sign in to comment.