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];
}