aboutsummaryrefslogtreecommitdiff
path: root/stage1
diff options
context:
space:
mode:
Diffstat (limited to 'stage1')
-rw-r--r--stage1/cbt.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/stage1/cbt.scala b/stage1/cbt.scala
index 4caa085..8b6ebd8 100644
--- a/stage1/cbt.scala
+++ b/stage1/cbt.scala
@@ -38,6 +38,16 @@ object `package`{
case e:java.lang.UnsupportedOperationException if e.getMessage === "empty.max" => None
}
}
+ implicit class ClassLoaderExtensions(classLoader: ClassLoader){
+ def canLoad(className: String) = {
+ try{
+ classLoader.loadClass(className)
+ true
+ } catch {
+ case e: ClassNotFoundException => false
+ }
+ }
+ }
implicit class BuildInterfaceExtensions(build: BuildInterface){
import build._
// TODO: if every build has a method triggers a callback if files change