From 75c32537cd8f29f9d12db37bf06ad942806f0239 Mon Sep 17 00:00:00 2001 From: prassee Date: Tue, 21 Jun 2016 08:24:31 +0530 Subject: Updated usage example in the README.md file (#154) updated usage example and added sbt way to declaring dependencies --- README.md | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'README.md') 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. -- cgit v1.2.3