aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md (renamed from README.txt)65
1 files changed, 38 insertions, 27 deletions
diff --git a/README.txt b/README.md
index a494e36..c900182 100644
--- a/README.txt
+++ b/README.md
@@ -1,6 +1,7 @@
Join the chat at https://gitter.im/cvogt/cbt
Welcome to Chris' Build Tool (CBT) for Scala
+============================================
Fun, fast, intuitive, composable and statically checked builds written in Scala.
@@ -18,23 +19,29 @@ Slides from CBT talk from NEScala 2016:
https://github.com/cvogt/talks/raw/master/2016-03-04_NEScala-2016_A-Vision-For-Scala-Builds.pdf
(video coming soon...)
-Getting started:
+Getting started
+---------------
+### Dependencies
You currently need javac, nailgun, gpg and realpath or gcc installed.
+### Installing
CBT bootstraps from source. To install, just clone the repository.
-To use, just call the "cbt" bash script. You will see CBT first
+
+### Using
+To use, just call the `cbt` bash script. You will see CBT first
building up itself, then trying to start your build.
The easiest CBT build requires no script. It compiles source files from the
-current directory and from "src/ into the target folder. Try calling "cbt compile".
-If you have a class called Main with a main method, try "cbt run".
-Put a source file with a Main class into "test/" in order for
-"cbt test" to run it. It will see your main code.
+current directory and from `src/` into the target folder. Try calling `cbt compile`.
+If you have a class called Main with a main method, try `cbt run`.
+Put a source file with a Main class into `test/` in order for
+`cbt test` to run it. It will see your main code.
-If you need more than this, like dependencies create a scala file in build/
+If you need more than this, like dependencies, create a scala file in `build/`
that describes your build. Here is an example
+```scala
// build/build.scala
import cbt._
class Build(context: cbt.Context) extends PackageBuild(context){
@@ -50,24 +57,25 @@ class Build(context: cbt.Context) extends PackageBuild(context){
}
def foo = "Hello World"
}
+```
-Now you can call methods of this class through cbt. Try "cbt foo".
+Now you can call methods of this class through cbt. Try `cbt foo`.
You can see how your build is configured via overrides.
-call "cbt" to see a full list of available commands for this build.
+call `cbt` to see a full list of available commands for this build.
-Look into the class DefaultBuild in CBT's source code to see their
+Look into the class `DefaultBuild` in CBT's source code to see their
details. The source code is really simple. Don't shy away from
looking, even as a beginner. No crazy stuff, I promise ;). You
-can find the relevant code in CBT's stage2/DefaultBuild.scala
+can find the relevant code in CBT's `stage2/DefaultBuild.scala`
-I order to keep executing the same command triggered by file changes use "cbt loop <command>".
+I order to keep executing the same command triggered by file changes use `cbt loop <command>`.
-You can find example builds in CBT's own "test/"" folder.
+You can find example builds in CBT's own `test/` folder.
Not all of them have a build file, in which case CBT uses the default
-cbt.DefaultBuild.
+`cbt.DefaultBuild`.
-A folder "build/" can have its own folder "build/" inside in order
+A folder `build/` can have its own folder `build/` inside in order
to add source or maven dependencies to your build. Eventually
you'll be able to also choose the CBT and Scala versions for
target builds. Make sure you extend cbt.BuilBuild instead of
@@ -76,26 +84,28 @@ target build.
cbt is fast. It uses Nailgun to keep the JVM hot. It uses the Java
WatchService (respectively a fast OSX port of it) for instant triggering
-re-compilation on file changes. Use "cbt loop compile".
+re-compilation on file changes. Use `cbt loop compile`.
CBT concepts
+------------
There two essential primitives available in build scripts for composing
modular projects:
- 1 Dynamically compiling and loading Build scripts in other
- directories and calling methods (aka tasks) on them to compile,
- get the classpath, ask for version numbers, etc.
+ 1. Dynamically compiling and loading Build scripts in other
+ directories and calling methods (aka tasks) on them to compile,
+ get the classpath, ask for version numbers, etc.
+
+ This allows to do a lot of things just like that:
+ Multi-project builds, source dependencies, builds of builds and
+ allowing tests simply as dependent projects of the main project, etc.
- This allows to do a lot of things just like that:
- Multi-project builds, source dependencies, builds of builds and
- allowing tests simply as dependent projects of the main project, etc.
+ 2. Maven dependencies
- 2 Maven dependencies
- I wrote my own 50 LOC Maven resolver. It's super quick and I have
- yet see it not to being able to handle something. I know cases
- exist, but seem rare.
- alexarchambault's Coursier can be used as a more complete drop-in.
+ I wrote my own 50 LOC Maven resolver. It's super quick and I have
+ yet see it not to being able to handle something. I know cases
+ exist, but seem rare.
+ alexarchambault's Coursier can be used as a more complete drop-in.
Build scripts also have access to a small unsurprising library for
- triggering dependencies to build / download and get the classpath
@@ -105,6 +115,7 @@ Build scripts also have access to a small unsurprising library for
- signing / publishing to sonatype/maven
Missing features in comparison with SBT
+---------------------------------------
Not implemented yet, but rather easily possible without API changes or
major refactors is concurrently building / downloading dependencies and