Bari.Core.Build.Cache.CachedBuilder.CachedBuilder C# (CSharp) Method

CachedBuilder() public method

Creates a cached builder
public CachedBuilder ( IBuilder wrappedBuilder, IBuildCache cache, [ targetDir ) : System
wrappedBuilder IBuilder The builder instance to be wrapped
cache IBuildCache The cache implementation to be used
targetDir [ The target directory's file system abstraction
return System
        public CachedBuilder(IBuilder wrappedBuilder, IBuildCache cache, [TargetRoot] IFileSystemDirectory targetDir)
        {
            Contract.Requires(wrappedBuilder != null);
            Contract.Requires(cache != null);
            Contract.Requires(targetDir != null);

            this.wrappedBuilder = wrappedBuilder;
            this.cache = cache;
            this.targetDir = targetDir;

            supportsFallback = wrappedBuilder.BuilderType.GetCustomAttributes(typeof(FallbackToCacheAttribute), false).Any();

            var agressiveAttribute = wrappedBuilder.BuilderType.GetCustomAttributes(typeof (AggressiveCacheRestoreAttribute), false).OfType<AggressiveCacheRestoreAttribute>().FirstOrDefault();
            aggressive = agressiveAttribute != null;
            agressiveModeExceptions = agressiveAttribute != null
                ? agressiveAttribute.ExceptionExpressions
                : new Regex[0];
        }