diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-06-15 22:38:53 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-06-15 22:43:59 -0400 |
commit | 09051773461b98d374d1b46dd0a2caa57768ab30 (patch) | |
tree | d67c88d10906647c7fd56229e6e56121a9107744 /examples | |
parent | b5194aab6f1f57aff6e4538acaf91245fdf15039 (diff) | |
download | cbt-09051773461b98d374d1b46dd0a2caa57768ab30.tar.gz cbt-09051773461b98d374d1b46dd0a2caa57768ab30.tar.bz2 cbt-09051773461b98d374d1b46dd0a2caa57768ab30.zip |
add sbt-resolver like restart feature
Diffstat (limited to 'examples')
-rw-r--r-- | examples/restart/Readme.md | 10 | ||||
-rw-r--r-- | examples/restart/build/build.scala | 4 | ||||
-rw-r--r-- | examples/restart/src/Main.scala | 6 |
3 files changed, 20 insertions, 0 deletions
diff --git a/examples/restart/Readme.md b/examples/restart/Readme.md new file mode 100644 index 0000000..e4bf1b5 --- /dev/null +++ b/examples/restart/Readme.md @@ -0,0 +1,10 @@ +This example's main method simply prints the current process id. +This can be used to experiment with cbt's restart feature +(the equivalent to sbt-revolver). + +``` +cbt direct loop restart +``` + +starts the main method in a separate process and kills it, when +a change in project, build file or cbt is detected. diff --git a/examples/restart/build/build.scala b/examples/restart/build/build.scala new file mode 100644 index 0000000..a18f951 --- /dev/null +++ b/examples/restart/build/build.scala @@ -0,0 +1,4 @@ +import cbt._ +class Build(val context: Context) extends BaseBuild{ + override def dependencies = super.dependencies :+ libraries.cbt.process +}
\ No newline at end of file diff --git a/examples/restart/src/Main.scala b/examples/restart/src/Main.scala new file mode 100644 index 0000000..1c03832 --- /dev/null +++ b/examples/restart/src/Main.scala @@ -0,0 +1,6 @@ +object Main extends App { + while(true){ + Thread.sleep(1000) + println( "process " + cbt.process.currentProcessId + " is still running" ) + } +} |