diff options
Diffstat (limited to 'compatibility/Context.java')
-rw-r--r-- | compatibility/Context.java | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/compatibility/Context.java b/compatibility/Context.java index a7af740..afd0b15 100644 --- a/compatibility/Context.java +++ b/compatibility/Context.java @@ -1,21 +1,43 @@ package cbt; import java.io.*; import java.util.*; +import java.util.concurrent.*; // TODO: try to reduce the number of members -public abstract class Context{ +public interface Context{ + // recently added methods that needs default values for old versions to work + public default long cbtLastModified(){ + throw new IncompatibleCbtVersionException("You need to define method cbtLastModified."); + }; + public default Map<Object,Object> persistentCache(){ + throw new IncompatibleCbtVersionException("You need to define method persistentCache."); + }; + public default Map<Object,Object> transientCache(){ + throw new IncompatibleCbtVersionException("You need to define method transientCache."); + }; + public default long start(){ + throw new IncompatibleCbtVersionException("You need to define method start."); + }; + + // methods that exist for longer which every CBT version in use should have by now, no default values needed public abstract File projectDirectory(); 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(); public abstract String scalaVersionOrNull(); // needed to propagate scalaVersion to dependendee builds - public abstract Map<Object,Object> persistentCache(); - public abstract Map<Object,Object> transientCache(); public abstract File cache(); public abstract File cbtHome(); public abstract File cbtRootHome(); // REMOVE public abstract File compatibilityTarget(); // maybe replace this with search in the classloader for it? public abstract BuildInterface parentBuildOrNull(); + + // deprecated methods + @java.lang.Deprecated + public abstract Long startCompat(); + @java.lang.Deprecated + public abstract Boolean cbtHasChangedCompat(); + @java.lang.Deprecated + public abstract ConcurrentHashMap<String,Object> permanentKeys(); + @java.lang.Deprecated + public abstract ConcurrentHashMap<Object,ClassLoader> permanentClassLoaders(); } |