Beispiel #1
0
        private DependencyGraph Load(string intermediateFolder, string versionName)
        {
            var expandedBaseFolder = Path.GetFullPath(Environment.ExpandEnvironmentVariables(intermediateFolder));
            var buildInfoFile      = Path.Combine(expandedBaseFolder, BuildInfo.FileName);
            var buildInfo          = JsonUtility.Deserialize <BuildInfo>(buildInfoFile);

            if (buildInfo == null)
            {
                LogErrorAndThrow($"Cache files in the folder '{intermediateFolder}' are corrupted!", null);
            }
            var versionInfo = buildInfo.Versions.FirstOrDefault(v => v.VersionName == versionName);

            if (versionInfo == null)
            {
                Logger.LogInfo($"Cache files for version '{versionName}' is not found!", null);
                return(null);
            }
            var dependencyFile = Path.Combine(expandedBaseFolder, buildInfo.DirectoryName, versionInfo.DependencyFile);

            return(IncrementalUtility.LoadDependency(dependencyFile));
        }