示例#1
0
            private static DateTime GetLastWriteTimeUtc(string filePath, IProjectSnapshot projectSnapshot)
            {
                var projectSnapshot2 = (IProjectSnapshot2)projectSnapshot;

                // If the assets file wasn't included as part of the <AdditionalDesignTimeBuildInput> item,
                // consider it up-to-date by return MaxValue, so that it is not forever stuck out-of-date.
                return(projectSnapshot2.AdditionalDependentFileTimes.GetValueOrDefault(filePath, DateTime.MaxValue));
            }
示例#2
0
            private static bool IsRestoreUpToDate(IProjectSnapshot projectSnapshot, RestoreData restoreData)
            {
                // If restore failed, we treat as though it is up-to-date to avoid it forever being stuck out of date.
                if (!restoreData.Succeeded)
                {
                    return(true);
                }

                DateTime lastEvaluationWriteTime = GetLastWriteTimeUtc(restoreData.ProjectAssetsFilePath, projectSnapshot);

                return(lastEvaluationWriteTime >= restoreData.ProjectAssetsLastWriteTimeUtc);
            }
        private async Task <bool> OnRestoreCompleted(IProjectSnapshot projectSnapshot, RestoreData restoreData)
        {
            bool result = false;
            var  dataProgressTrackerService = IDataProgressTrackerServiceFactory.ImplementNotifyOutputDataCalculated(_ => { result = true; });

            var instance = await CreateInitializedInstance(dataProgressTrackerService : dataProgressTrackerService);

            var tuple = ValueTuple.Create(projectSnapshot, restoreData);
            var value = IProjectVersionedValueFactory.Create(tuple);

            instance.OnRestoreCompleted(value);

            return(result);
        }
示例#4
0
 public static string TempFileExclude(this IProjectSnapshot project)
 {
     return(String.Format(@"{0}\exclude.txt", project.WorkingDirectoryTemp));
 }
示例#5
0
 public static string TempFileSnapshot(this IProjectSnapshot project)
 {
     return(String.Format(@"{0}\{1}", project.WorkingDirectoryTemp, project.SnapshotFileName()));
 }
示例#6
0
 public static string SnapshotFileName(this IProjectSnapshot project)
 {
     return(String.Format(@"{0}.snapshot.zip", project.Name));
 }