aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2016-11-13 16:17:24 -0500
committerGitHub <noreply@github.com>2016-11-13 16:17:24 -0500
commit7a99e875a5818e9eeacb51f9f4ceb139b5235043 (patch)
treec9cd42f4525a8179a912f997c8402f178a4f0368
parent90edc50237d3ea248bb795052195163df716bb41 (diff)
parent094d172617394f337e6d3fe6ad338d43dcb46afb (diff)
downloadcbt-7a99e875a5818e9eeacb51f9f4ceb139b5235043.tar.gz
cbt-7a99e875a5818e9eeacb51f9f4ceb139b5235043.tar.bz2
cbt-7a99e875a5818e9eeacb51f9f4ceb139b5235043.zip
Merge pull request #313 from cvogt/chris3
minor cleanups regarding Context
-rw-r--r--compatibility/Context.java8
-rw-r--r--stage1/cbt.scala3
-rw-r--r--stage2/BasicBuild.scala7
3 files changed, 10 insertions, 8 deletions
diff --git a/compatibility/Context.java b/compatibility/Context.java
index 5e03a7b..1ec0f54 100644
--- a/compatibility/Context.java
+++ b/compatibility/Context.java
@@ -5,8 +5,8 @@ import java.util.concurrent.ConcurrentHashMap;
// TODO: try to reduce the number of members
public abstract class Context{
public abstract File projectDirectory();
- public abstract File cwd();
- public abstract String[] argsArray();
+ public abstract File cwd(); // REPLACE by something that allows to run cbt on some other directly
+ public abstract String[] argsArray(); // replace this by https://github.com/cvogt/cbt/issues/172 ?
public abstract String[] enabledLoggersArray();
public abstract Long startCompat();
public abstract Boolean cbtHasChangedCompat();
@@ -16,7 +16,7 @@ public abstract class Context{
public abstract ConcurrentHashMap<Object,Object> taskCache();
public abstract File cache();
public abstract File cbtHome();
- public abstract File cbtRootHome();
- public abstract File compatibilityTarget();
+ public abstract File cbtRootHome(); // REMOVE
+ public abstract File compatibilityTarget(); // maybe replace this with search in the classloader for it?
public abstract BuildInterface parentBuildOrNull();
}
diff --git a/stage1/cbt.scala b/stage1/cbt.scala
index 6aa73f9..e324fa0 100644
--- a/stage1/cbt.scala
+++ b/stage1/cbt.scala
@@ -78,10 +78,9 @@ object `package`{
def copy(
projectDirectory: File = projectDirectory,
args: Seq[String] = args,
- enabledLoggers: Set[String] = enabledLoggers,
+ //enabledLoggers: Set[String] = enabledLoggers,
cbtHasChanged: Boolean = cbtHasChanged,
scalaVersion: Option[String] = scalaVersion,
- cache: File = cache,
cbtHome: File = cbtHome,
parentBuild: Option[BuildInterface] = None
): Context = ContextImplementation(
diff --git a/stage2/BasicBuild.scala b/stage2/BasicBuild.scala
index 3b1ea19..7ff1f4b 100644
--- a/stage2/BasicBuild.scala
+++ b/stage2/BasicBuild.scala
@@ -3,10 +3,13 @@ package cbt
import java.io._
import java.net._
-class BasicBuild(val context: Context) extends BaseBuild
+class BasicBuild(final val context: Context) extends BaseBuild
trait BaseBuild extends BuildInterface with DependencyImplementation with TriggerLoop with SbtDependencyDsl{
+ //* DO NOT OVERRIDE CONTEXT in non-idempotent ways, because .copy and new Build
+ // will create new instances given the context, which means operations in the
+ // overrides will happen multiple times and if they are not idempotent stuff likely breaks
def context: Context
-
+
// library available to builds
implicit protected final val logger: Logger = context.logger
implicit protected final val classLoaderCache: ClassLoaderCache = context.classLoaderCache