aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorprassee <prassee@users.noreply.github.com>2016-06-21 08:24:31 +0530
committerJan Christopher Vogt <oss.nsp@cvogt.org>2016-06-20 22:54:31 -0400
commit75c32537cd8f29f9d12db37bf06ad942806f0239 (patch)
treea08d52753cc5afd6a3c31b7626ddc5cc7ca5b8b1 /README.md
parentd6952b4703f9363c8c8a2756091559d63ed3497a (diff)
downloadcbt-75c32537cd8f29f9d12db37bf06ad942806f0239.tar.gz
cbt-75c32537cd8f29f9d12db37bf06ad942806f0239.tar.bz2
cbt-75c32537cd8f29f9d12db37bf06ad942806f0239.zip
Updated usage example in the README.md file (#154)
updated usage example and added sbt way to declaring dependencies
Diffstat (limited to 'README.md')
-rw-r--r--README.md41
1 files changed, 29 insertions, 12 deletions
diff --git a/README.md b/README.md
index d7235e4..7a1174e 100644
--- a/README.md
+++ b/README.md
@@ -43,29 +43,46 @@ that describes your build. Here is an example
```scala
// build/build.scala
-import cbt._
-class Build(val context: cbt.Context) extends Publish{
- override def version = "0.6.1"
+class Build(val context: cbt.Context) extends PackageJars {
+ override def defaultVersion = "0.6.1"
+
+ override def name = "play-json-extensions"
+
override def groupId = "org.cvogt"
- override def artifactId = "play-json-extensions"
+
override def dependencies =
super.dependencies ++
- Resolver(mavenCentral).bind(
- // encouraged way to declare dependencies
- ScalaDependency("com.typesafe.play", "play-json", "2.4.4"),
- MavenDependency("joda-time", "joda-time", "2.9.2")
- // also supported for SBT syntax compatibility:
- // "com.typesafe.play" %% "play-json" % "2.4.4"
- // Maven.central % "joda-time" % "joda-time % "2.9.2"
- )
+ Resolver(mavenCentral).bind(
+ // encouraged way to declare dependencies
+ ScalaDependency("com.typesafe.play", "play-json", "2.4.4"),
+ MavenDependency("joda-time", "joda-time", "2.9.2")
+ )
+
override def compile = {
println("Compiling...")
super.compile
}
+
def foo = "Hello World"
}
```
+Dependencies could also be declared using SBT style.
+
+```scala
+class Build(val context: cbt.Context) extends PackageJars {
+...
+// sbt compatible dependencies definition
+override def dependencies =
+ super.dependencies ++
+ Resolver(mavenCentral).bind(
+ "com.typesafe.play" %% "play-json" % "2.4.4",
+ "joda-time" % "joda-time" % "2.9.2"
+ )
+...
+}
+```
+
Now you can call methods of this class through cbt. Try `cbt foo`.
You can see how your build is configured via overrides.