protected override bool PerformPrequisites()
        {
            if (TaskOptions.HasFlag(DDCTaskOptions.ColdDDC))
            {
                StoredEnvVars.Clear();
                CachePaths.Clear();

                // We put our temp DDC paths in here
                DirectoryReference BasePath = DirectoryReference.Combine(CommandUtils.EngineDirectory, "BenchmarkDDC");

                IEnumerable <string> DDCEnvVars = new string[] { GetXPlatformEnvironmentKey("UE-BootDataCachePath"), GetXPlatformEnvironmentKey("UE-LocalDataCachePath") };

                if (TaskOptions.HasFlag(DDCTaskOptions.KeepMemoryDDC))
                {
                    DDCEnvVars = DDCEnvVars.Where(E => !E.Contains("UE-Boot"));
                }

                // get all current environment vars and set them to our temp dir
                foreach (var Key in DDCEnvVars)
                {
                    // save current key
                    StoredEnvVars.Add(Key, Environment.GetEnvironmentVariable(Key));

                    // create a new dir for this key
                    DirectoryReference Dir = DirectoryReference.Combine(BasePath, Key);

                    if (DirectoryReference.Exists(Dir))
                    {
                        DirectoryReference.Delete(Dir, true);
                    }

                    DirectoryReference.CreateDirectory(Dir);

                    // save this dir and set it as the env var
                    CachePaths.Add(Dir);
                    Environment.SetEnvironmentVariable(Key, Dir.FullName);
                }

                // remove project files
                DirectoryReference ProjectDDC = DirectoryReference.Combine(ProjectFile.Directory, "DerivedDataCache");
                CommandUtils.DeleteDirectory_NoExceptions(ProjectDDC.FullName);

                // remove S3 files
                DirectoryReference S3DDC = DirectoryReference.Combine(ProjectFile.Directory, "Saved", "S3DDC");
                CommandUtils.DeleteDirectory_NoExceptions(S3DDC.FullName);
            }

            return(base.PerformPrequisites());
        }
        protected override void PerformCleanup()
        {
            // restore keys
            foreach (var KV in StoredEnvVars)
            {
                Environment.SetEnvironmentVariable(KV.Key, KV.Value);
            }

            foreach (var Dir in CachePaths)
            {
                CommandUtils.DeleteDirectory_NoExceptions(Dir.FullName);
            }

            CachePaths.Clear();
            StoredEnvVars.Clear();
        }