This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import std._ | |
class TaskTest extends SingleProject | |
{ | |
lazy val hello: Task[Unit] = | |
task { println("Hi!") } | |
lazy val three: Task[Int] = | |
task { 3 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import xsbti.api._ | |
class Single(info: ProjectInfo) extends DefaultProject(info) | |
{ | |
lazy val allDefs = compile map { _.apis.internal.flatMap(_._2.definitions) } | |
lazy val modules = allDefs map { | |
_.collect { case c: ClassLike if c.definitionType == DefinitionType.Module => c.name } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You'll need 0.9.x set up (probably best to track 0.9 branch at this point): | |
https://github.com/harrah/xsbt/tree/0.9 | |
$ git clone git://github.com/jorgeortiz85/rogue.git | |
$ cd rogue/ | |
$ git checkout xsbt | |
$ xsbt | |
> compile | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** not compiled or checked, just for the idea *** | |
import sbt._ | |
import Keys._ | |
object MyBuild extends Build | |
{ | |
... wiring into project not shown, see FullConfiguration for where to put `defaults` ... | |
val protocExePath = SettingKey[File]("protoc-exe-path") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jsoup._ | |
import java.io.{File, FileWriter} | |
/* | |
libraryDependencies += "org.jsoup" % "jsoup" % "1.7.1" | |
scalaVersion := "2.10.0-M7" | |
*/ | |
object Main { | |
val WikiSuffix = ".wiki" | |
val HtmlSuffix = ".html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io._ | |
object A | |
{ | |
/* | |
* Starts two concurrent threads that acquire file locks in a timed manner. | |
* Arguments: | |
* initialDelayA(ms) lockTimeA(ms) lockFileA initialDelayB(ms) lockTimeB(ms) lockFileB | |
* | |
* Example usage: demonstrates "Resource deadlock avoided" when there is no actual deadlock. |
OlderNewer